Esempio n. 1
0
    def get24HrRoutes(self,geo0,geo1,planned_date):
        
        route24Hr=[]
        init_routes_info=self.listRoutes(geo0,geo1)

        for route in init_routes_info:
            index=0
            total= 24*60
            step =5
            while index < total:
                mm=index%60
                hh=index/60
                
                if mm<10:
                    mm_str='0'+str(mm)
                else:
                    mm_str=str(mm)
                
                if hh<10:
                    hh_str='0'+str(hh)
                else:
                    hh_str=str(hh)
                
                planned_time=planned_date+hh_str+mm_str
                route_info=Route(route,planned_time,geo0,geo1)
                route_info.calculateRoute(index)
                route24Hr.append(route_info);
                index +=step
            
            # ******   Attention ********
            # only select the first route
            break
        
        return route24Hr
Esempio n. 2
0
 def getRoutes(self,geo0,geo1,planned_time):
     routeOption=[]
     init_routes_info=self.listRoutes(geo0,geo1)
     
     for route in init_routes_info:
         route_info=Route(route,planned_time,geo0,geo1)
         route_info.calculateRoute()
         routeOption.append(route_info)
     
         
     return routeOption