SimPy compatibility API Reference¶
The usim.py
package recreates the API of the simpy
package.
It serves as a drop-in replacement for SimPy in order to gradually integrate
and migrate simulations to μSim. For use in an existing SimPy simulation,
it is sufficient to import usim.py
in place of simpy
.
# load the compatibility layer in place of simpy
import usim.py as simpy
The usim.py
package itself provides direct access to the most relevant objects.
However, they can be fetched from their respective submodules as well.
Environments (usim.py.core
)¶
|
Execution environment for a simulation |
|
Not supported by μSim |
Hint
μSim simulations are started by usim.run()
.
Events (usim.py.events
)¶
|
Event that is manually triggered, |
|
Event that triggers after a |
|
Active event that processes an event-yielding generator |
|
Event that triggers once all |
|
Event that triggers once any |
|
Exception to |
Hint
μSim simulations can await
events and may
succeed()
and fail()
them.
Resources (usim.py.resources
)¶
|
Resource with a fixed capacity of usage slots |
|
Resource with a fixed capacity of usage slots granted with priorities |
|
Resource with a fixed capacity of usage slots preempted with priorities |
|
Resource with a fixed capacity of continuous, indistinguishable content |
|
Resource with a fixed capacity of slots for storing arbitrary objects |
|
Resource with capacity slots for storing objects in priority order. |
|
Wrap an arbitrary item with an orderable priority. |
|
Resource with capacity slots for storing arbitrary objects supporting filtered get requests. |
Exceptions (usim.py.exceptions
)¶
|
Base case for all non-internal exceptions |
|
Exception to |
|
Exception to |