simpy

The simpy module aggregates SimPy’s most used components into a single namespace. This is purely for convenience. You can of course also access everything (and more!) via their actual submodules.

The following tables list all the available components in this module.

Environments

Environment([initial_time])

Execution environment for an event-based simulation.

RealtimeEnvironment([initial_time, factor, ...])

Execution environment for an event-based simulation which is synchronized with the real-time (also known as wall-clock time).

Events

Event(env)

An event that may happen at some point in time.

Timeout(env, delay[, value])

A Event that gets processed after a delay has passed.

Process(env, generator)

Process an event yielding generator.

AllOf(env, events)

A Condition event that is triggered if all of a list of events have been successfully triggered.

AnyOf(env, events)

A Condition event that is triggered if any of a list of events has been successfully triggered.

Interrupt(cause)

Exception thrown into a process if it is interrupted (see interrupt()).

Resources

Resource(env[, capacity])

Resource with capacity of usage slots that can be requested by processes.

PriorityResource(env[, capacity])

A Resource supporting prioritized requests.

PreemptiveResource(env[, capacity])

A PriorityResource with preemption.

Container(env[, capacity, init])

Resource containing up to capacity of matter which may either be continuous (like water) or discrete (like apples).

Store(env[, capacity])

Resource with capacity slots for storing arbitrary objects.

PriorityItem(priority, item)

Wrap an arbitrary item with an order-able priority.

PriorityStore(env[, capacity])

Resource with capacity slots for storing objects in priority order.

FilterStore(env[, capacity])

Resource with capacity slots for storing arbitrary objects supporting filtered get requests.

Exceptions

SimPyException

Base class for all SimPy specific exceptions.

Interrupt(cause)

Exception thrown into a process if it is interrupted (see interrupt()).