Пример #1
0
 def __init__(self, id_, name, U0, Um, Sigma, Lambda, Xi, time_window, min_duration):
     ''' U0 is the baseline utility level of acivity. 
         Um is the maximum utility of activity. 
         Sigma determines the slope or steepness of the curve. 
         Lambda determines the relative position of the inflection point. 
         Xi determines the time of day at which the marginal utility reaches the maximum. 
         time_window is the interval of starting time for this activity (a 2-tuple). 
         min_duration is the minimum duration for this activity. 
     '''
     # activity name
     self.id, self.name = id_, name
     # utility function parameters
     self.U0, self.Um, self.Sigma, self.Lambda, self.Xi = U0, Um, Sigma, Lambda, Xi
     # temproal constraints
     self.time_window = (Time.min2tick(time_window[0]), Time.min2tick(time_window[1]))
     self.min_duration = Time.min2tick(min_duration)
Пример #2
0
 def __init__(self, id_, name, U0, Um, Sigma, Lambda, Xi, time_window,
              min_duration):
     ''' U0 is the baseline utility level of acivity. 
         Um is the maximum utility of activity. 
         Sigma determines the slope or steepness of the curve. 
         Lambda determines the relative position of the inflection point. 
         Xi determines the time of day at which the marginal utility reaches the maximum. 
         time_window is the interval of starting time for this activity (a 2-tuple). 
         min_duration is the minimum duration for this activity. 
     '''
     # activity name
     self.id, self.name = id_, name
     # utility function parameters
     self.U0, self.Um, self.Sigma, self.Lambda, self.Xi = U0, Um, Sigma, Lambda, Xi
     # temproal constraints
     self.time_window = (Time.min2tick(time_window[0]),
                         Time.min2tick(time_window[1]))
     self.min_duration = Time.min2tick(min_duration)
Пример #3
0
 def calc_travel_time(self, flow):
     if flow > self.capacity * 8:
         print "%s: %s / %s" % (self, flow, self.capacity)
         # raise PendingDeprecationWarning('Sidewalk capacity excess (8x)! ')
     travel_time = Time.min2tick(self.walk_time*(1.0 + .15*math.pow(flow/self.capacity, 4.0)))
     return travel_time
Пример #4
0
 def calc_travel_time(self, flow):
     if flow / self.capacity > 4.0:
         print "  !! %s: %s / %s > 4.0" % (self, flow, self.capacity)
         # raise PendingDeprecationWarning('Street capacity excess (20x)! ')
     travel_time = Time.min2tick(self.drive_time*(1.0 + .15*math.pow(flow/self.capacity, 4.0)))
     return travel_time
Пример #5
0
 def calc_travel_time(self, flow):
     if flow > self.capacity * 8:
         print "%s: %s / %s" % (self, flow, self.capacity)
         # raise PendingDeprecationWarning('Sidewalk capacity excess (8x)! ')
     travel_time = Time.min2tick(self.walk_time * (1.0 + 0.15 * math.pow(flow / self.capacity, 4.0)))
     return travel_time
Пример #6
0
 def calc_travel_time(self, flow):
     if flow / self.capacity > 4.0:
         print "  !! %s: %s / %s > 4.0" % (self, flow, self.capacity)
         # raise PendingDeprecationWarning('Street capacity excess (20x)! ')
     travel_time = Time.min2tick(self.drive_time * (1.0 + 0.15 * math.pow(flow / self.capacity, 4.0)))
     return travel_time