Skip to main content
  1. Posts/

Overview-SimPy-4-0-2-dev1-g2973dbe-documentation

204 words·1 min

Overview-SimPy-4-0-2-dev1-g2973dbe-documentation #

Overview — SimPy 4.0.2.dev1+g2973dbe documentation #

Created: June 19, 2020 11:21 AM URL: https://simpy.readthedocs.io/en/latest/ learn the basics of SimPy in just a couple of minutes for a complete overview SimPy is a process-based discrete-event simulation framework based on standard Python. SimPy also provides various types of shared resources to model limited capacity congestion points (like servers, checkout counters and tunnels). Simulations can be performed “as fast as possible”, in real time (wall clock time) or by manually stepping through the events. A short example simulating two clocks ticking in different time intervals looks like this:

>>> import simpy
>>>
>>> def clock(env, name, tick):
... while True:
... print(name, env.now)
... yield env.timeout(tick)
...
>>> env = simpy.Environment()
>>> env.process(clock(env, 'fast', 0.5))
>>> env.process(clock(env, 'slow', 1))
>>> env.run(until=2)
fast 0
slow 0
fast 0.5
slow 1
fast 1.0
fast 1.5

The documentation contains a tutorial, several guides explaining key concepts, a number of examples and the API reference. Simulation model developers are encouraged to share their SimPy modeling techniques with the SimPy community. Please post a message to the SimPy mailing list. There is an introductory talk that explains SimPy’s concepts and provides some examples: watch the video or get the slides.