Exemplo n.º 1
0
 def GetDayVisitParameters(start_datetime, end_datetime, lunch_start_datetime):
   return city_visit.DayVisitParameters(
       start_datetime=start_datetime,
       end_datetime=end_datetime,
       lunch_start_datetime=lunch_start_datetime,
       lunch_hours=1.,
       start_coordinates=test_util.MockCoordinates('Hotel'),
       end_coordinates=test_util.MockCoordinates('Restaurant'))
 def GetDayVisitParameters(day):
     return city_visit.DayVisitParameters(
         start_datetime=datetime.datetime(2015, 7, day, 10, 0, 0),
         end_datetime=datetime.datetime(2015, 7, day, 15, 0, 0),
         lunch_start_datetime=datetime.datetime(2015, 7, day, 14, 0, 0),
         lunch_hours=1.,
         start_coordinates=test_util.MockCoordinates('Hotel'),
         end_coordinates=test_util.MockCoordinates('Hotel'))
Exemplo n.º 3
0
 def GetDayVisitParameters(day):
     return city_visit.DayVisitParameters(
         start_datetime=datetime.datetime(2015, 7, day, 10, 0, 0),
         end_datetime=datetime.datetime(2015, 7, day, 19, 0, 0),
         lunch_start_datetime=datetime.datetime(2015, 7, day, 14, 0, 0),
         lunch_hours=1.,
         start_coordinates=start_end_coordinates,
         end_coordinates=start_end_coordinates)
 def GetDayVisitParameters(start_datetime, end_datetime, lunch_start_datetime):
   return city_visit.DayVisitParameters(
       start_datetime=start_datetime,
       end_datetime=end_datetime,
       lunch_start_datetime=lunch_start_datetime,
       lunch_hours=1.,
       start_coordinates=CityVisitTestExample.GetHotelCoordinates(),
       end_coordinates=CityVisitTestExample.GetHotelCoordinates())
Exemplo n.º 5
0
 def testDatelessHashKey(self):
     day_visit_parameters_9to21 = city_visit.DayVisitParameters(
         start_datetime=datetime.datetime(2014, 9, 1, 9, 0, 0),
         end_datetime=datetime.datetime(2014, 9, 1, 21, 0, 0),
         lunch_start_datetime=datetime.datetime(2014, 9, 1, 13, 0, 0),
         lunch_hours=1.,
         start_coordinates=self.hotel_coordinates,
         end_coordinates=self.hotel_coordinates)
     day_visit_parameters_9to23 = city_visit.DayVisitParameters(
         start_datetime=datetime.datetime(2014, 9, 1, 9, 0, 0),
         end_datetime=datetime.datetime(2014, 9, 1, 23, 0, 0),
         lunch_start_datetime=datetime.datetime(2014, 9, 1, 13, 0, 0),
         lunch_hours=1.,
         start_coordinates=self.hotel_coordinates,
         end_coordinates=self.hotel_coordinates)
     # Stupid test.
     self.assertEqual(day_visit_parameters_9to21.DatelessHashKey(),
                      day_visit_parameters_9to21.DatelessHashKey())
     self.assertNotEqual(day_visit_parameters_9to21.DatelessHashKey(),
                         day_visit_parameters_9to23.DatelessHashKey())
Exemplo n.º 6
0
import os
from config import config as config_
config = config_.GetConfig(os.path.join('config', 'runner.config'))

import datetime
from data import city_visit
from data import point

start_end_coordinates = point.Coordinates(40.763582, -73.988470)

day1 = city_visit.DayVisitParameters(
    start_datetime=datetime.datetime(2019, 7, 1, 10, 0, 0),
    end_datetime=datetime.datetime(2019, 7, 1, 19, 0, 0),
    lunch_start_datetime=datetime.datetime(2019, 7, 1, 14, 0, 0),
    lunch_hours=1.,
    start_coordinates=start_end_coordinates,
    end_coordinates=start_end_coordinates)

day2 = city_visit.DayVisitParameters(
    start_datetime=datetime.datetime(2019, 7, 2, 10, 0, 0),
    end_datetime=datetime.datetime(2019, 7, 2, 17, 0, 0),
    lunch_start_datetime=datetime.datetime(2019, 7, 1, 14, 0, 0),
    lunch_hours=1.,
    start_coordinates=start_end_coordinates,
    end_coordinates=start_end_coordinates)

from data import city_visit
from data import point

visit_location = city_visit.VisitLocation('New York City')