def enter(self): customer = Entity() customer.stamp_time() heappush(self.queue, customer) self.notify_state_change('queue', self.queue) self.number_in_queue = len(self.queue) self.notify_state_change('number_in_queue', self.number_in_queue) self.number_arrivals += 1 self.notify_state_change('number_arrivals', self.number_arrivals) if self.number_available_servers > 0: self.schedule('start', 0.0) self.schedule('enter', self.interarrival_time_generator.generate())
def __repr__(self): return '{super} {remain:.4f}'.format( super=Entity.__repr__(self), remain=self.remaining_unloading_time)
def arrival(self): ArrivalProcess.arrival(self) self.schedule('entity_arrival', 0.0, Entity())
def __init__(self, unloading_time_generator): Entity.__init__(self) self.remaining_unloading_time = unloading_time_generator self.name = 'Ship'
def __init__(self, renegeTime): Entity.__init__(self, 'RenegingCustomer') self.renegeTime = renegeTime
def __repr__(self): return Entity.__repr__(self) + ' (' + str(round(self.renegeTime,4)) + ')'
def __init__(self): Entity.__init__(self, 'Job') self.total_delay_in_queue = 0.0 self.time_in_system = 0.0
def generate(self): self.schedule('generate', self.interarrival_time_generator.generate()) self.schedule('arrival', 0.0, Entity())