simpype.build

SimPype’s build library.

simpype.build.generator(sim, id, model=None)

Create a Resource object implementing a generator.

Dynamically build a generator object based on the model. If model is None the default generator model is built.

Parameters:
  • sim (Simulation) – The SimPype simulation object
  • id (str) – The resource id to build
  • model (str, optional) – The model of the resource
Returns:

Resource

simpype.build.logger(name, path)

Create a logger object.

This function creates a logger object for logging the simulation results. A logger accepts a (str) as input and writes it to the log file.

Parameters:
  • name (str) – The name of the logger
  • path (str) – The path of the log file managed by the logger
Returns:

Python Logger from logging module logging.Logger

simpype.build.pipe(sim, resource, id, model=None)

Create a Pipe object.

Dynamically build a pipe object based on the model. If model is None the default pipe model is built.

Parameters:
  • sim (Simulation) – The SimPype simulation object
  • resource (Resource) – The resource object this pipe is associated to
  • id (str) – The pipe id to build
  • model (str, optional) – The model of the pipe
Returns:

Pipe

simpype.build.queue(sim, pipe, id, model=None)

Create a Queue object.

Dynamically build a queue object based on the model. If model is None the default queue model is built.

Parameters:
  • sim (Simulation) – The SimPype simulation object
  • pipe (Pipe) – The pipe object this queue is associated to
  • id (str) – The queue id to build
  • model (str, optional) – The model of the queue
Returns:

Queue

simpype.build.resource(sim, id, model=None, capacity=1, pipe=None)

Create a Resource object.

Dynamically build a resource object based on the model. If model is None the default resource model is built.

Parameters:
  • sim (Simulation) – The SimPype simulation object
  • id (str) – The resource id to build
  • model (str, optional) – The model of the resource
  • capacity (int, optional) – The capacity of the resource
  • pipe (str, optional) – The model of the pipe associated to the resource
Returns:

Resource