SlideShare una empresa de Scribd logo
1 de 22
Summer Solstice 2013 / Warszawa 1/22
Jiří Fišer, Jiří Škvára
ETOS
discrete event simulation framework
focused on easier team cooperation
this contribution is supported by grant from
company Severočeské doly a.s. Chomutov (http://www.sdas.cz)
Summer Solstice 2013 / Warszawa 2/22
SimPy
[phase 1] student project (2011)
● simple simulations of e-car (transport, refueling,
parking&shopping)
[phase 2: enthusiasm]
selecting a usable tool for discrete event simulation
SimPy
●
Python programming language (modern, simple,
effective)
●
clear design and reasonable complexity
Summer Solstice 2013 / Warszawa 3/22
SimPy – problems
[phase 3, disillusion] disadvantages and limits of SimPy
●
SimPy uses coroutines based on generators by
providing a central dispatcher on top of active coroutines
– trampoline
⇒ dispatch requests are propagated by re-yielding
● nested coroutines are not directly supported
⇒ large single level coroutines
● the separation of developer's roles is almost
impossible
– simulation modelers and specifiers (engineers)
– low level Python programmers
Summer Solstice 2013 / Warszawa 4/22
SimPy – problems II
● typical SimPy design patterns (e.g. reneging) are both
extremely error-prone and almost non-reusable
●
problematic post-modifications and extensions (code is not
stackable)
● behaviour of Python exceptions in SimPy is undefined or
esoteric
●
very difficult debugging (some types of failures do not abort
simulation)
● slightly surprising GeneratorExit exception (called in
generators after leaving of iterator)
Summer Solstice 2013 / Warszawa 5/22
Solution
[phase 4] search for solution
● using a more abstract formalism together with a high-level framework
(if possible in Python)
● DEVS (Discrete Event System Specification) and DEVSimPy
- relatively complex formalism, different from SimPy model
- almost non-existent documentation (DEVSimPy)
● design and implementation of new framework on top of SimPy
+ utilization of SimPy framework and our know-how
+ early involvement of student in the project
Summer Solstice 2013 / Warszawa 6/22
Design objectives
separation of simulation code into (at least) two
levels of abstraction:
●
declarative description of parametres and lifetime of
simulated objects by high level structured language (e.g.
XML)
●
procedural representation of actions by extended
SimPy code in the form of generator coroutines
●
the maximal expressivity of declarative code (declarative
notation is preferred)
● relaxed and extensible structural notation
(elimination of deeply nested „matryoshka“ constructs)
Summer Solstice 2013 / Warszawa 7/22
Implementation objectives
● simplified and integrated support of basic SimPy
constructs (especially yielding arguments)
●
re-usability of repetitive code by object oriented
inheritance or by Python metaprogramming
●
time and memory efficiency
● re-usability of auxiliary objects (goal: one instance of
auxiliary objects per simulation)
●
optimization of slow operations (multiple re-yielding,
creation of coroutines)
Summer Solstice 2013 / Warszawa 8/22
Design of ETOS library
PyYAMLPyYAML
SIM-DSL
parser
SIM-DSL
parser
SimPy
process
SimPy
processcontrol
entities
control
entities
transaction
engine
transaction
engine
simulation
entities
simulation
entities
SIM-DSL
model of simulation
SIM-DSL
model of simulation
SimPy
objects
(queues, resources,
signals, etc)
SimPy
objects
(queues, resources,
signals, etc)
executes
use
checkpointscheckpoints
executes
use
collect
data from
extends
reads by
XValue
(context)
XValue
(context)
ETreeETree
existing Python libraries ETOS code end-user simulation code
Summer Solstice 2013 / Warszawa 9/22
SIM-DSL
●
SIM – domain specific language
●
abstract structural notation for structured simulation
data and simulation code
●
unification of declarative and procedural code as in
Lisp (homoiconicity)
●
SIM-DSL supports:
●
hierarchical tree of nodes with complex attributes
●
specification of random numbers with specific
distribution
●
time dependent values
Summer Solstice 2013 / Warszawa 10/22
(ETOS) Simulation
simulation as a whole (global states)
declarative (SIM-DSL) representation
set of interlinked SIM-DSL documents
procedural (Python) representation
instance of class Etos.Simulation derived from class SimPy.Simulation
ETOS supports multiple simulation instances which can be
executed in multiple threads or processes (e.g. in simple cluster
based on Python multiprocessing package)
Summer Solstice 2013 / Warszawa 11/22
Actor
simulated object with attributes during its
lifetime
declarative (SIM-DSL) representation
explicit declarative representation of an actor is optional
defines attributes with initial values
procedural (Python) representation
instance of class Actor or derived class
Summer Solstice 2013 / Warszawa 12/22
(ETOS) Transaction
task executing actions from (part of) lifetime of an
actor (actor's carrier)
declarative (SIM-DSL) representation
●
SIM-DSL node with child nodes describing individual actions
●
transaction can be nested (auxiliary constructs)
procedural (Python) representation
● instance of the class Transaction (derived from SimPy.Process
class)
● main method -- action: generator based coroutine
Summer Solstice 2013 / Warszawa 13/22
(ETOS) Entity
basic building block – individual executing step of
transaction
A) simple activity of actor = end user entities
B) interface to shared services (resources, storages, etc.)
C) control statement
loop, exception handler, block, etc.
D) subtransaction
independent SimPy process, which execute part of
transaction e.g. body of loop
Summer Solstice 2013 / Warszawa 14/22
Entity representation
declarative (SIM-DSL) representation
SIM-DSL node encapsulating several types of subnodes:
●
attributes of given entity
●
common attributes of shared service
●
subentities (control entity and subtransactions)
procedural (Python) representation
instance of class inheriting from ETOS.Entity class
shared service entity manages a shared object referring to
shared service (Resource, Level, Store)
cooperation or competition of several transaction
Summer Solstice 2013 / Warszawa 15/22
Class diagram (UML)
Summer Solstice 2013 / Warszawa 16/22
XValue – value within context
●
values in simulation are often related to simulation time,
actors or they are bound to single action (entity)
example (e-car, cash of recharge):
cash = price ∙ (capacity - ttravel
∙ power)
●
x-value type and its context are specified only in declarative
code
<power context=“actor“><normal mu=“2500“ sigma=“100“/></power>
Python code is quite simple with minimum of explicit context
function of sim.time
function of actor's time
random for every action = simulated travel
random for every actor = e-car
Summer Solstice 2013 / Warszawa 17/22
<transaction>
<counted_loop count=“#5“>
<work>
<duration>
<normal mu="30600" sigma="3600"/>
</duration>
<hourly_wage context="transaction">
<lognormal mu="1.73" sigma="0.57"/>
</hourly_wage>
</work>
<transport>
<distance context="transaction">
<lognormal mu="8.0" sigma="1.5"/>
</distance>
<fare_per_km>0.09</fare_per_km>
</transport>
<checkpoint>
<measure property="a.balance" type="log"/>
</checkpoint>
</counted_loop>
</transaction>
hourly-wage
is randomly set
only once
per transaction
(explicit context)
duration
is randomly set for each
loop iteration
(implicit context: entity)
control
entities
model
entities
attribute with fixed
logging to stderr
checkpoint = collects data from simulated system
SIM-DSL
XML
Summer Solstice 2013 / Warszawa 18/22
class Person(Actor):
def __init__(self, simulation):
super().__init__(simulation)
self.balance = 0.0
class Work(SimpleEntity):
tag = "work"
def __init__(self, transaction, xmlSource):
super().__init__(transaction, xmlSource)
self.attributeSetter(("duration", float),
("hourly_wage", float))
def action(self):
income = self.duration * self.hourly_wage / 3600.0
self.actor.balance += income
yield self.hold(self.duration)
registerModule(SummerSolstice)
sim = Simulation()
sim.start(xmlFile, actor = Person(sim))
registration
of entity attributes
(name and type)
SIM-DSL node name
registration
of external names
from entire Python module
Python
Summer Solstice 2013 / Warszawa 19/22
Transfer of control
(sub-transaction)
Summer Solstice 2013 / Warszawa 20/22
Conclusions I
Separation of roles
key roles:
● specifiers of actors
(input, global states, SIM-
DSL)
● entity implementors
(activity specification,
SimPy programming)
● transaction editors
(high level model, SIM-
DSL)
●
final processing
(statistics, vizualization, ...)
Summer Solstice 2013 / Warszawa 21/22
Conclusions II
New challenges
●
SIM-DSL representation of directional graphs
(for more complex inputs and graph controlled
simulations)
●
automatic optimization of subtransactions and re-
yielding overheads
●
documentation with examples
●
active software project
project is hosted on Google Code
http://code.google.com/p/etos
Summer Solstice 2013 / Warszawa 22/22
Thank you for your attention.
Dzi kuj za uwagę ę ę.

Más contenido relacionado

Similar a ETOS discrete event simulation framework focused on easier team cooperation

Mobility insights at Swisscom - Understanding collective mobility in Switzerland
Mobility insights at Swisscom - Understanding collective mobility in SwitzerlandMobility insights at Swisscom - Understanding collective mobility in Switzerland
Mobility insights at Swisscom - Understanding collective mobility in SwitzerlandFrançois Garillot
 
Spark Summit EU talk by Francois Garillot and Mohamed Kafsi
Spark Summit EU talk by Francois Garillot and Mohamed KafsiSpark Summit EU talk by Francois Garillot and Mohamed Kafsi
Spark Summit EU talk by Francois Garillot and Mohamed KafsiSpark Summit
 
The magic behind your Lyft ride prices: A case study on machine learning and ...
The magic behind your Lyft ride prices: A case study on machine learning and ...The magic behind your Lyft ride prices: A case study on machine learning and ...
The magic behind your Lyft ride prices: A case study on machine learning and ...Karthik Murugesan
 
20101215-fxug-tokyo
20101215-fxug-tokyo20101215-fxug-tokyo
20101215-fxug-tokyoJun Funakura
 
Design and development of a CityGML Visualization Tool
Design and development of a CityGML Visualization ToolDesign and development of a CityGML Visualization Tool
Design and development of a CityGML Visualization Tool3DGIS
 
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slidesDavid Barreto
 
Digital twin for ports and terminals schuett slideshare
Digital twin for ports and terminals schuett slideshareDigital twin for ports and terminals schuett slideshare
Digital twin for ports and terminals schuett slideshareHolger Schuett
 
DDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkDDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkbanq jdon
 
An Inter-Wiki Page Data Processor for a M2M System @Matsue, 1sep., Eskm2013
An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013
An Inter-Wiki Page Data Processor for a M2M System @Matsue, 1sep., Eskm2013Takashi Yamanoue
 
Lab Practices and Works Documentation / Report on Computer Graphics
Lab Practices and Works Documentation / Report on Computer GraphicsLab Practices and Works Documentation / Report on Computer Graphics
Lab Practices and Works Documentation / Report on Computer GraphicsRup Chowdhury
 
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with XgxperfDeveloping and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with XgxperfPrabindh Sundareson
 
WSO2 Product Release Webinar - Introducing the WSO2 Complex Event Processor
WSO2 Product Release Webinar - Introducing the WSO2 Complex Event Processor WSO2 Product Release Webinar - Introducing the WSO2 Complex Event Processor
WSO2 Product Release Webinar - Introducing the WSO2 Complex Event Processor WSO2
 
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE 2015)
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE 2015)Efficient and Advanced Omniscient Debugging for xDSMLs (SLE 2015)
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE 2015)Benoit Combemale
 
WSO2 Complex Event Processor - Product Overview
WSO2 Complex Event Processor - Product OverviewWSO2 Complex Event Processor - Product Overview
WSO2 Complex Event Processor - Product OverviewWSO2
 
pythonOCC PDE2009 presentation
pythonOCC PDE2009 presentationpythonOCC PDE2009 presentation
pythonOCC PDE2009 presentationThomas Paviot
 
Aspect-Oriented Programming
Aspect-Oriented ProgrammingAspect-Oriented Programming
Aspect-Oriented ProgrammingAndrey Bratukhin
 
JSUG - Filthy Flex by Christoph Pickl
JSUG - Filthy Flex by Christoph PicklJSUG - Filthy Flex by Christoph Pickl
JSUG - Filthy Flex by Christoph PicklChristoph Pickl
 

Similar a ETOS discrete event simulation framework focused on easier team cooperation (20)

Mobility insights at Swisscom - Understanding collective mobility in Switzerland
Mobility insights at Swisscom - Understanding collective mobility in SwitzerlandMobility insights at Swisscom - Understanding collective mobility in Switzerland
Mobility insights at Swisscom - Understanding collective mobility in Switzerland
 
Spark Summit EU talk by Francois Garillot and Mohamed Kafsi
Spark Summit EU talk by Francois Garillot and Mohamed KafsiSpark Summit EU talk by Francois Garillot and Mohamed Kafsi
Spark Summit EU talk by Francois Garillot and Mohamed Kafsi
 
The magic behind your Lyft ride prices: A case study on machine learning and ...
The magic behind your Lyft ride prices: A case study on machine learning and ...The magic behind your Lyft ride prices: A case study on machine learning and ...
The magic behind your Lyft ride prices: A case study on machine learning and ...
 
20101215-fxug-tokyo
20101215-fxug-tokyo20101215-fxug-tokyo
20101215-fxug-tokyo
 
Model Based Development For 3 D User Interfaces
Model Based Development For 3 D User InterfacesModel Based Development For 3 D User Interfaces
Model Based Development For 3 D User Interfaces
 
Design and development of a CityGML Visualization Tool
Design and development of a CityGML Visualization ToolDesign and development of a CityGML Visualization Tool
Design and development of a CityGML Visualization Tool
 
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slides
 
Digital twin for ports and terminals schuett slideshare
Digital twin for ports and terminals schuett slideshareDigital twin for ports and terminals schuett slideshare
Digital twin for ports and terminals schuett slideshare
 
DDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkDDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFramework
 
An Inter-Wiki Page Data Processor for a M2M System @Matsue, 1sep., Eskm2013
An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013
An Inter-Wiki Page Data Processor for a M2M System @Matsue, 1sep., Eskm2013
 
Lab Practices and Works Documentation / Report on Computer Graphics
Lab Practices and Works Documentation / Report on Computer GraphicsLab Practices and Works Documentation / Report on Computer Graphics
Lab Practices and Works Documentation / Report on Computer Graphics
 
Rock Overview
Rock OverviewRock Overview
Rock Overview
 
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with XgxperfDeveloping and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
 
WSO2 Product Release Webinar - Introducing the WSO2 Complex Event Processor
WSO2 Product Release Webinar - Introducing the WSO2 Complex Event Processor WSO2 Product Release Webinar - Introducing the WSO2 Complex Event Processor
WSO2 Product Release Webinar - Introducing the WSO2 Complex Event Processor
 
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE 2015)
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE 2015)Efficient and Advanced Omniscient Debugging for xDSMLs (SLE 2015)
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE 2015)
 
Oopp Lab Work
Oopp Lab WorkOopp Lab Work
Oopp Lab Work
 
WSO2 Complex Event Processor - Product Overview
WSO2 Complex Event Processor - Product OverviewWSO2 Complex Event Processor - Product Overview
WSO2 Complex Event Processor - Product Overview
 
pythonOCC PDE2009 presentation
pythonOCC PDE2009 presentationpythonOCC PDE2009 presentation
pythonOCC PDE2009 presentation
 
Aspect-Oriented Programming
Aspect-Oriented ProgrammingAspect-Oriented Programming
Aspect-Oriented Programming
 
JSUG - Filthy Flex by Christoph Pickl
JSUG - Filthy Flex by Christoph PicklJSUG - Filthy Flex by Christoph Pickl
JSUG - Filthy Flex by Christoph Pickl
 

Último

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Último (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

ETOS discrete event simulation framework focused on easier team cooperation

  • 1. Summer Solstice 2013 / Warszawa 1/22 Jiří Fišer, Jiří Škvára ETOS discrete event simulation framework focused on easier team cooperation this contribution is supported by grant from company Severočeské doly a.s. Chomutov (http://www.sdas.cz)
  • 2. Summer Solstice 2013 / Warszawa 2/22 SimPy [phase 1] student project (2011) ● simple simulations of e-car (transport, refueling, parking&shopping) [phase 2: enthusiasm] selecting a usable tool for discrete event simulation SimPy ● Python programming language (modern, simple, effective) ● clear design and reasonable complexity
  • 3. Summer Solstice 2013 / Warszawa 3/22 SimPy – problems [phase 3, disillusion] disadvantages and limits of SimPy ● SimPy uses coroutines based on generators by providing a central dispatcher on top of active coroutines – trampoline ⇒ dispatch requests are propagated by re-yielding ● nested coroutines are not directly supported ⇒ large single level coroutines ● the separation of developer's roles is almost impossible – simulation modelers and specifiers (engineers) – low level Python programmers
  • 4. Summer Solstice 2013 / Warszawa 4/22 SimPy – problems II ● typical SimPy design patterns (e.g. reneging) are both extremely error-prone and almost non-reusable ● problematic post-modifications and extensions (code is not stackable) ● behaviour of Python exceptions in SimPy is undefined or esoteric ● very difficult debugging (some types of failures do not abort simulation) ● slightly surprising GeneratorExit exception (called in generators after leaving of iterator)
  • 5. Summer Solstice 2013 / Warszawa 5/22 Solution [phase 4] search for solution ● using a more abstract formalism together with a high-level framework (if possible in Python) ● DEVS (Discrete Event System Specification) and DEVSimPy - relatively complex formalism, different from SimPy model - almost non-existent documentation (DEVSimPy) ● design and implementation of new framework on top of SimPy + utilization of SimPy framework and our know-how + early involvement of student in the project
  • 6. Summer Solstice 2013 / Warszawa 6/22 Design objectives separation of simulation code into (at least) two levels of abstraction: ● declarative description of parametres and lifetime of simulated objects by high level structured language (e.g. XML) ● procedural representation of actions by extended SimPy code in the form of generator coroutines ● the maximal expressivity of declarative code (declarative notation is preferred) ● relaxed and extensible structural notation (elimination of deeply nested „matryoshka“ constructs)
  • 7. Summer Solstice 2013 / Warszawa 7/22 Implementation objectives ● simplified and integrated support of basic SimPy constructs (especially yielding arguments) ● re-usability of repetitive code by object oriented inheritance or by Python metaprogramming ● time and memory efficiency ● re-usability of auxiliary objects (goal: one instance of auxiliary objects per simulation) ● optimization of slow operations (multiple re-yielding, creation of coroutines)
  • 8. Summer Solstice 2013 / Warszawa 8/22 Design of ETOS library PyYAMLPyYAML SIM-DSL parser SIM-DSL parser SimPy process SimPy processcontrol entities control entities transaction engine transaction engine simulation entities simulation entities SIM-DSL model of simulation SIM-DSL model of simulation SimPy objects (queues, resources, signals, etc) SimPy objects (queues, resources, signals, etc) executes use checkpointscheckpoints executes use collect data from extends reads by XValue (context) XValue (context) ETreeETree existing Python libraries ETOS code end-user simulation code
  • 9. Summer Solstice 2013 / Warszawa 9/22 SIM-DSL ● SIM – domain specific language ● abstract structural notation for structured simulation data and simulation code ● unification of declarative and procedural code as in Lisp (homoiconicity) ● SIM-DSL supports: ● hierarchical tree of nodes with complex attributes ● specification of random numbers with specific distribution ● time dependent values
  • 10. Summer Solstice 2013 / Warszawa 10/22 (ETOS) Simulation simulation as a whole (global states) declarative (SIM-DSL) representation set of interlinked SIM-DSL documents procedural (Python) representation instance of class Etos.Simulation derived from class SimPy.Simulation ETOS supports multiple simulation instances which can be executed in multiple threads or processes (e.g. in simple cluster based on Python multiprocessing package)
  • 11. Summer Solstice 2013 / Warszawa 11/22 Actor simulated object with attributes during its lifetime declarative (SIM-DSL) representation explicit declarative representation of an actor is optional defines attributes with initial values procedural (Python) representation instance of class Actor or derived class
  • 12. Summer Solstice 2013 / Warszawa 12/22 (ETOS) Transaction task executing actions from (part of) lifetime of an actor (actor's carrier) declarative (SIM-DSL) representation ● SIM-DSL node with child nodes describing individual actions ● transaction can be nested (auxiliary constructs) procedural (Python) representation ● instance of the class Transaction (derived from SimPy.Process class) ● main method -- action: generator based coroutine
  • 13. Summer Solstice 2013 / Warszawa 13/22 (ETOS) Entity basic building block – individual executing step of transaction A) simple activity of actor = end user entities B) interface to shared services (resources, storages, etc.) C) control statement loop, exception handler, block, etc. D) subtransaction independent SimPy process, which execute part of transaction e.g. body of loop
  • 14. Summer Solstice 2013 / Warszawa 14/22 Entity representation declarative (SIM-DSL) representation SIM-DSL node encapsulating several types of subnodes: ● attributes of given entity ● common attributes of shared service ● subentities (control entity and subtransactions) procedural (Python) representation instance of class inheriting from ETOS.Entity class shared service entity manages a shared object referring to shared service (Resource, Level, Store) cooperation or competition of several transaction
  • 15. Summer Solstice 2013 / Warszawa 15/22 Class diagram (UML)
  • 16. Summer Solstice 2013 / Warszawa 16/22 XValue – value within context ● values in simulation are often related to simulation time, actors or they are bound to single action (entity) example (e-car, cash of recharge): cash = price ∙ (capacity - ttravel ∙ power) ● x-value type and its context are specified only in declarative code <power context=“actor“><normal mu=“2500“ sigma=“100“/></power> Python code is quite simple with minimum of explicit context function of sim.time function of actor's time random for every action = simulated travel random for every actor = e-car
  • 17. Summer Solstice 2013 / Warszawa 17/22 <transaction> <counted_loop count=“#5“> <work> <duration> <normal mu="30600" sigma="3600"/> </duration> <hourly_wage context="transaction"> <lognormal mu="1.73" sigma="0.57"/> </hourly_wage> </work> <transport> <distance context="transaction"> <lognormal mu="8.0" sigma="1.5"/> </distance> <fare_per_km>0.09</fare_per_km> </transport> <checkpoint> <measure property="a.balance" type="log"/> </checkpoint> </counted_loop> </transaction> hourly-wage is randomly set only once per transaction (explicit context) duration is randomly set for each loop iteration (implicit context: entity) control entities model entities attribute with fixed logging to stderr checkpoint = collects data from simulated system SIM-DSL XML
  • 18. Summer Solstice 2013 / Warszawa 18/22 class Person(Actor): def __init__(self, simulation): super().__init__(simulation) self.balance = 0.0 class Work(SimpleEntity): tag = "work" def __init__(self, transaction, xmlSource): super().__init__(transaction, xmlSource) self.attributeSetter(("duration", float), ("hourly_wage", float)) def action(self): income = self.duration * self.hourly_wage / 3600.0 self.actor.balance += income yield self.hold(self.duration) registerModule(SummerSolstice) sim = Simulation() sim.start(xmlFile, actor = Person(sim)) registration of entity attributes (name and type) SIM-DSL node name registration of external names from entire Python module Python
  • 19. Summer Solstice 2013 / Warszawa 19/22 Transfer of control (sub-transaction)
  • 20. Summer Solstice 2013 / Warszawa 20/22 Conclusions I Separation of roles key roles: ● specifiers of actors (input, global states, SIM- DSL) ● entity implementors (activity specification, SimPy programming) ● transaction editors (high level model, SIM- DSL) ● final processing (statistics, vizualization, ...)
  • 21. Summer Solstice 2013 / Warszawa 21/22 Conclusions II New challenges ● SIM-DSL representation of directional graphs (for more complex inputs and graph controlled simulations) ● automatic optimization of subtransactions and re- yielding overheads ● documentation with examples ● active software project project is hosted on Google Code http://code.google.com/p/etos
  • 22. Summer Solstice 2013 / Warszawa 22/22 Thank you for your attention. Dzi kuj za uwagę ę ę.