def reset(self): SimEntityBase.reset(self) self.number_in_queue1 = 0 self.number_in_queue2 = 0 self.number_available_server1 = self.number_server1 self.number_available_server2 = self.number_server2 self.number_blocked = 0
def __init__(self, interarrival_time_generator, service_time_generator, prob_needs_rework): SimEntityBase.__init__(self) self.interarrival_time_generator = interarrival_time_generator self.service_time_generator = service_time_generator self.prob_needs_rework = prob_needs_rework self.number_in_queue = nan self.number_available_resources = nan
def __init__(self, initial_loc, max_speed): SimEntityBase.__init__(self) self.initial_loc = initial_loc self.max_speed = max_speed self.last_stop_loc = None self.velocity = None self.start_move_time = nan self.destination = None
def __init__(self, number_servers, service_time_generator): SimEntityBase.__init__(self) self.number_servers = number_servers self.service_time_generator = service_time_generator self.number_available_servers = nan self.queue = [] self.delay_in_queue = nan self.time_in_system = nan
def __init__(self, total_number_servers, service_time_generator): SimEntityBase.__init__(self) self.total_number_servers = total_number_servers self.service_time_generator = service_time_generator self.queue = [] self.number_available_servers = nan self.number_reneges = nan self.number_served = nan
def __init__(self, interarrival_time_generator, service_time_generator, number_resources): SimEntityBase.__init__(self) self.interarrival_time_generator = interarrival_time_generator self.service_time_generator = service_time_generator self.number_resources = number_resources self.number_in_queue = nan self.number_available_resources = nan
def __init__(self, number_stations, number_machines, service_time_generators): SimEntityBase.__init__(self) self.number_stations = number_stations self.service_time_generators = service_time_generators self.number_machines = number_machines self.queue = [] self.number_available_machines = [] self.validate()
def __init__(self, mover, path, start_on_run): SimEntityBase.__init__(self) self.mover = mover self.path = path self.start_on_run = start_on_run self.next = nan self.add_sim_event_listener(self.mover) self.mover.add_sim_event_listener(self)
def __init__(self, total_number_servers, service_time_generator, queue_capacity): SimEntityBase.__init__(self) self.total_number_servers = total_number_servers self.service_time_generator = service_time_generator self.queue_capacity = queue_capacity self.number_in_queue = nan self.number_available_servers = nan self.number_balks = nan self.number_potential_customers = nan if (self.queue_capacity < 0): raise ValueError( 'queue_capacity must be \u2265 0: {cap:%d}'.format( cap=self.queue_capacity))
def __init__(self, interarrival_time_generator, number_server1, number_server2, \ service_time1_generator, service_time2_generator, buffer_size): SimEntityBase.__init__(self) # Parameters self.interarrival_time_generator = interarrival_time_generator self.number_server1 = number_server1 self.number_server2 = number_server2 self.service_time1_generator = service_time1_generator self.service_time2_generator = service_time2_generator self.buffer_size = buffer_size # State variables self.number_in_queue1 = nan self.number_in_queue2 = nan self.number_available_server1 = nan self.number_available_server2 = nan self.number_blocked = nan
def __init__(self, number=1): SimEntityBase.__init__(self) self.number = number self.name = 'Pinger2'
heappush(heap, evt3) heappush(heap, evt4) copy = heap.copy() copy.sort() dump='Event List:' for e in copy: dump += '\n' + str(e) print(dump) el = EventList() evt = source.schedule('Foo', 1.0) evt1 = SimEntityBase().schedule('bar', 2.0, [1]) evt2 = SimEntityBase().schedule('boo', 2.0, [], priority=Priority.HIGH) print (EventList.dump()) print (Priority.DEFAULT < Priority.HIGH) print (Priority.DEFAULT > Priority.HIGH) # print(evt1 < evt2) # print(evt1 > evt2) copy = EventList.event_list copy.sort() for e in copy: print(e)
def __init__(self, name='TestSimEntity'): SimEntityBase.__init__(self) self.count = 0
def __init__(self, interarrival_time_generator): # (3) SimEntityBase.__init__(self) self.interarrival_time_generator=interarrival_time_generator self.number_arrivals = nan
def reset(self): SimEntityBase.reset(self) self.next = 0
def reset(self): SimEntityBase.reset(self) self.number_in_queue = 0 self.number_available_servers = self.total_number_servers self.number_balks = 0 self.number_potential_customers = 0
from simkit.stats import IndexedSimpleStatsTally from simkit.base import IndexedStateChangeEvent from simkit.base import SimEntityBase from simkit.rand import RandomVariate source = SimEntityBase() print(source.describe()) name = 'foo' rv = RandomVariate.instance('Exponential', mean=2.3) stats = IndexedSimpleStatsTally(name) for i in range(1000): for j in range(4): event = IndexedStateChangeEvent(j, source, name, rv.generate) stats.state_change(event) print(stats)
def __init(self, interarrival_time_generator, service_time_generator, closing_time): SimEntityBase.__init__(self) self.interarrival_time_generator = interarrival_time_generator self.service_time_generator = service_time_generator self.closing_time = closing_time
def __init__(self, number): SimEntityBase.__init__(self) self.number = number
def __repr__(self): return SimEntityBase.__repr__(self) + ' (' + str(self.interarrival_time_generator) + ', ' + str(self.renege_time_generator) + ')'
def __init__(self): SimEntityBase.__init__(self) self.count = 0
def __init__(self): SimEntityBase.__init__(self) self.queue = [] self.berths = [] self.delay_in_queue = nan self.time_in_System = nan
def reset(self): SimEntityBase.reset(self) self.number_arrivals = 0 self.number_available_servers = self.number_servers self.queue = [] self.number_in_queue = 0
def reset(self): SimEntityBase.reset(self) self.queue.clear() self.berths.clear() self.delay_in_queue = nan self.time_in_System = nan
def reset(self): SimEntityBase.reset(self) self.number_in_queue = 0 self.number_available_resources = 1
def reset(self): # (4) SimEntityBase.reset(self) self.number_arrivals = 0
def __int__(self): SimEntityBase.__init__(self) self.outer = None self.truncation_point = nan
def __init__(self, interarrival_time_generator): SimEntityBase.__init__(self) self.interarrival_time_generator = interarrival_time_generator