BANA7030_DES_Python_Intro
BANA7030_DES_Python_Intro
BANA7030
Denise L. White, PhD MBA
SIMPY
Introduction to SimPy
• Uses Python for DES modeling
• Process-oriented DES language
– Easier to write model
– Proven event manager implementation
– Guarantees order of execution
SimPy Terminology
• Process
– Simulates an entity that evolves over time
– Referred to as a thread
• Resource
– Simulates something to be requested and queued if not
available
https://www.slideshare.net/pycontw/introduction-to-simpy
Basic Concepts
• Modeled with processes that live in an environment
• Processes interact with the environment via events
• Processes are described as generators in Python
• During their lifetime, processes create events and
yield them in order to wait to be triggered
https://simpy.readthedocs.io/en/latest/simpy_intro/index.html
Basic Concepts
• When a process yields an event, the process gets
suspended and resumes when the event is triggered
• An important event type is Timeout. Events of this type are
triggered after an amount of time has passed.
• A Timeout and all other events can be created by calling the
appropriate method of the Environment that the process lives
in. (For example, Environment.timeout())
https://simpy.readthedocs.io/en/latest/simpy_intro/index.html