pydsol-model package
Submodules
pydsol.model.basic_logger module
pydsol.model.entities module
- class pydsol.model.entities.Entity(simulator, t, speed=1.4, **kwargs)[source]
Bases:
objectThis class defines a basic entity for a discrete event simulation model.
- id_iter = count(1)
- class pydsol.model.entities.Vehicle(simulator, speed=10, **kwargs)[source]
Bases:
EntityThis class defines a vehicle in a discrete event simulation model, and is a subclass of Entity. A vehicle is an entity of which other entities can be transported. The entities on the vehicle are tracked by a list.
pydsol.model.link module
- class pydsol.model.link.Link(simulator, origin, destination, length, selection_weight=1, **kwargs)[source]
Bases:
objectThis class defines a basic link between an origin and destination for a model.
- enter_link(entity, **kwargs)[source]
Determines the time for travelling on the link by length and speed of the entity, and schedules the event for exiting the link.
- Parameters:
entity (object) – the target on which a state change is scheduled.
kwargs – kwargs are the keyword arguments that are used to expand the link class.
- exit_link(entity, **kwargs)[source]
Schedules the event for entering the input node of the destination of the link. Each destination needs a method “enter_input_node”.
- Parameters:
entity (object) – the target on which a state change is scheduled.
kwargs – kwargs are the keyword arguments that are used to expand the link class.
- id_iter = count(1)
- class pydsol.model.link.TimePath(simulator, origin, destination, time, selection_weight=1, **kwargs)[source]
Bases:
objectThis class defines a time path between an origin and destination for a model.
- enter_path(entity, **kwargs)[source]
Determines the time for travelling on the link by length and speed of the entity, and schedules the event for exiting the link.
- Parameters:
entity (object) – the target on which a state change is scheduled.
kwargs – kwargs are the keyword arguments that are used to expand the link class.
- exit_path(entity, **kwargs)[source]
Schedules the event for entering the input node of the destination of the link. Each destination needs a method “enter_input_node”.
- Parameters:
entity (object) – the target on which a state change is scheduled.
kwargs – kwargs are the keyword arguments that are used to expand the link class.
- id_iter = count(1)
pydsol.model.node module
pydsol.model.queue_model module
pydsol.model.resource module
- class pydsol.model.resource.Resource(id, simulator, queue, distribution, processing_time, transfer_in_time, **kwargs)[source]
Bases:
objectThis class defines a basic resource for a discrete event simulation. An object (often an entity) can seize a resource. If the resource is seized, other objects cannot seize it anymore until it is released after the processing time. The remaining objects are put into a queue.
- check_queue(**kwargs)[source]
Checks whether there are objects in the queue to seize the resource. If there are no objects in the queue, the resource stays free. If there are objects in the queue, the first object seizes the resource.
- Parameters:
obj – optional
kwargs – kwargs are the keyword arguments that are used to expand the function.
- enter_resource()[source]
Schedules the event to transfer into the resource and starts processing.
- Parameters:
entity (object) – the target on which a state change is scheduled.
- exit_input_node()[source]
Schedules the event to enter the resource when the input node is exited. To ensure that the right resource is called, the resource key is given.
- Parameters:
entity (Entity) – the target on which a state change is scheduled.
- exit_resource(**kwargs)[source]
Exits the resource. The resource is released and the queue attached to this resource is checked.
- Parameters:
entity – the target on which a state change is scheduled.
kwargs – kwargs are the keyword arguments that are used to expand the function.
- id_iter = count(1)
pydsol.model.server module
pydsol.model.sink module
- class pydsol.model.sink.Sink(simulator, transfer_in_time=0, **kwargs)[source]
Bases:
objectThis class defines a sink for a discrete event simulation model. A Sink is the end-station of an entity, meaning the system will end here for the entity. The entity will be destroyed to reduce the number of objects in the model.
- destroy_entity(entity, **kwargs)[source]
Destroys the entity.
- Parameters:
entity (object) – the target on which a state change is scheduled.
- enter_input_node(entity)[source]
Schedules the event to transfer into the sink and exit the input node.
- Parameters:
entity (object) – the target on which a state change is scheduled.
- exit_input_node(entity, **kwargs)[source]
Schedules the event to exit the input node and to destroy the entity.
- Parameters:
entity (object) – the target on which a state change is scheduled.
- id_iter = count(1)