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())
示例#2
0
 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())
示例#4
0
 def __init__(self, unloading_time_generator):
     Entity.__init__(self)
     self.remaining_unloading_time = unloading_time_generator
     self.name = 'Ship'
示例#5
0
 def __init__(self, renegeTime):
     Entity.__init__(self, 'RenegingCustomer')
     self.renegeTime = renegeTime
示例#6
0
 def __repr__(self):
     return Entity.__repr__(self) + ' (' + str(round(self.renegeTime,4)) + ')'
示例#7
0
 def __init__(self):
     Entity.__init__(self, 'Job')
     self.total_delay_in_queue = 0.0
     self.time_in_system = 0.0
示例#8
0
 def generate(self):
     self.schedule('generate', self.interarrival_time_generator.generate())
     self.schedule('arrival', 0.0, Entity())