pydsol-model package

Submodules

pydsol.model.basic_logger module

pydsol.model.basic_logger.get_module_logger(mod_name, level=50)[source]

pydsol.model.entities module

class pydsol.model.entities.Entity(simulator, t, speed=1.4, **kwargs)[source]

Bases: object

This 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: Entity

This 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.node module

pydsol.model.queue_model module

class pydsol.model.queue_model.QueueModel(attached_to)[source]

Bases: object

This class defines a basic queue to a specific object for a discrete event simulation model, and keeps track of the objects in the queue with a contents list.

pydsol.model.resource module

class pydsol.model.resource.Resource(id, simulator, queue, distribution, processing_time, transfer_in_time, **kwargs)[source]

Bases: object

This 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)
processing(**kwargs)[source]

Schedules the event to process the entity and exit the resource.

Parameters:
  • entity (object) – the target on which a state change is scheduled.

  • kwargs – kwargs are the keyword arguments that are used to expand the function.

set_processing_time()[source]

Draws a processing time from the distribution and parameter processing time.

pydsol.model.server module

pydsol.model.sink module

class pydsol.model.sink.Sink(simulator, transfer_in_time=0, **kwargs)[source]

Bases: object

This 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)

pydsol.model.source module

Module contents