# SimPy

Python discrete\-event simulation framework for interacting processes and shared resources\.

ID: Q1314 · Revision: 1362

Type: software · License: MIT[^sp-license] · Status: active

Website: https://simpy.readthedocs.io/



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\.[^sp-home][^sp-resource]

## 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\.[^sp-home][^sp-resource]

## 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\.[^sp-home][^sp-time]

## 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\.[^sp-monitor]

## 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\.[^sp-license][^sp-home]

## When it substitutes

SimPy can replace the discrete\-event portion of [AnyLogic](/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\.[^sp-home][^sp-resource][^sp-monitor][^al-multi][^al-pro]

## Capabilities and substitutions

### Queue and resource simulation — supported

Code interacting processes with capacity, priority and preemption\.[^sp-resource]

Use case: Dynamic system modeling and simulation · Platforms: Python environment · Region: Edition, deployment and model dependencies affect availability

### Custom monitoring — supported

Model code can collect process/resource observations into chosen storage\.[^sp-monitor]

Use case: Dynamic system modeling and simulation · Platforms: Python environment · Region: Edition, deployment and model dependencies affect availability

### Continuous\-model assistance — unsupported

The project explicitly offers no dedicated continuous\-simulation features\.[^sp-home]

Use case: Dynamic system modeling and simulation · Platforms: Python environment · Region: Edition, deployment and model dependencies affect availability

### [Substitute for AnyLogic](/anylogic) — limited

Substitutes for code\-first discrete\-event queue and resource models after reimplementation; not the full visual multimethod environment\.[^sp-home][^sp-resource][^al-multi]

Use case: Dynamic system modeling and simulation · Platforms: Python environment · Region: Edition, deployment and model dependencies affect availability

## References

[^sp-license]: [SimPy license](<https://simpy.readthedocs.io/en/stable/about/license.html>) — MIT license (vendor; retrieved 2026-10-07T09:42:23Z)

[^sp-home]: [SimPy overview](<https://simpy.readthedocs.io/en/stable/index.html>) — Process\-based Python simulation; continuous\-model limits (vendor; retrieved 2026-10-07T09:42:23Z)

[^sp-resource]: [SimPy shared resources](<https://simpy.readthedocs.io/en/stable/topical_guides/resources.html>) — Queues, priority/preemption, containers and stores (vendor; retrieved 2026-10-07T09:42:40Z)

[^sp-time]: [SimPy time and scheduling](<https://simpy.readthedocs.io/en/stable/topical_guides/time_and_scheduling.html>) — Sequential deterministic execution and equal\-time ordering (vendor; retrieved 2026-10-07T09:43:15Z)

[^sp-monitor]: [SimPy monitoring](<https://simpy.readthedocs.io/en/stable/topical_guides/monitoring.html>) — Custom process/resource observations and storage (vendor; retrieved 2026-10-07T09:42:32Z)

[^al-multi]: [Combining AnyLogic modeling methods](<https://anylogic.help/anylogic/multimethod/index.html>) — Shared namespace and continuous/discrete interactions (vendor; retrieved 2026-10-07T09:37:24Z)

[^al-pro]: [AnyLogic Professional](<https://anylogic.help/anylogic/introduction/anylogic-professional.html>) — Development, debugging and integration (vendor; retrieved 2026-10-07T09:37:14Z)

Source revision: https://substitutefor.net/entities/Q1314?revision=1362
