SimPy Python discrete-event simulation framework for interacting processes and shared resources.
Overview SimPy is a Python framework for process-based discrete-event simulation. Models describe interacting activities and limited resources in code, making it suitable for queues, service processes and capacity experiments.[2] [3]
Contents Processes and resources Python generators describe activities that wait for events, spend simulated time or acquire resources. The framework distinguishes capacity-limited resources, containers holding interchangeable quantities and stores holding individual objects. Priority and preemption support different service policies. Those distinctions matter when translating a real operation into a model: a pool of identical servers is not the same as a store of machines with different attributes.[2] [3]
Simulation time Runs can advance as quickly as computation allows, follow wall-clock time or be stepped manually. SimPy processes events sequentially; equal-time events are ordered by scheduling sequence. Parallel activity in the modeled world does not mean parallel execution on the computer. Timing resolution and random-input handling therefore belong in the model's reproducibility checks.[2] [4]
Observations and output Monitoring is designed around the modeler's questions. Process variables, resource utilization and queue lengths can be recorded at intervals or when events occur, then stored in lists, files or databases. This flexibility comes with implementation work: the framework does not automatically choose meaningful statistics or produce a complete analysis report for a new model.[5]
Scope and licensing SimPy uses the MIT license and runs as part of a Python program. It is not a ready-made graphical modeling application. Its own overview says it offers no special help for continuous simulation and may be unnecessary for fixed-step processes that never interact. Existing graphical projects need their behavior reimplemented rather than assuming a native import path.[1] [2]
When it substitutes SimPy can replace the discrete-event portion of AnyLogic when a team wants a code-first Python model of queues and resource contention. The assessment does not extend to AnyLogic's complete visual environment, animation or mixed-method tooling. Recreate event rules, observations and validation cases before comparing outcomes.[2] [3] [5] [6] [7]
Also included: 3 capabilities and 0 substitute relationships. Check substitutes in section 1 and capabilities in section 3.