Title: Discrete Event System Modeling and Simulation in Metropolis
1Discrete Event System Modeling and Simulation in
Metropolis
2Outline
- Separation of Capability and Cost
- Quantity Manager and Quantity Annotation
- Discrete Event Systems in Metropolis
- Discrete Event Systems Simulation
- Challenges
- Conclusion and Future Work
3Capability v.s. Cost
- One of the pairs of concerns whose
orthogonalization increases model reusability - Capability a sequence of events
- Cost captured by various quantities
Instruction Set
4Capability v.s. Cost in TSM
(v1, ?) (v2, ?) (vn, ?)
m-event tag ?
(v1, 0) (v2, ?) (vn, 10)
costs correspond to tags
5Quantity Annotation Quantity Manager
(v1, ?)
(v1, 0)
- Quantity Manager
- Data type
- Functions
- Axioms
6Discrete Event Systems in Metropolis
Process 1 (v11, 0) (v12, ?) (v1n, 10)
Process 2 (v21, ?) (v22, 4) (v2n, 8)
Process 3 (v31, 2) (v32, 5) (v3n, ?)
7Discrete Event Systems Simulation
- Formally,
- N processes p1, p2, , pN
- N m-event sequences me1, me2, , meN
- Annotated tag for the ith m-event in mej
, Tmej(i) - The most recent but prior to the ith annotated
m-event in mej - The next annotated m-event in mej after the ith
m-event
8DES Simulation (cont)
- is the segment of
m-events that could be interleaved with other
m-events from other processes - In order for and
- to be arbitrarily
interleaved, the following condition must be
satisfied - The end point e.g. can join
the interleaving if it falls into the other
segment
9DES Simulation (cont)
- Simulation proceeds round by round.
- At each round, each process issues one m-event or
event. - Based on time tags information and other
constraints (e.g. mutual exclusion,
simultaneity), disable some of (m-)events and let
the rest run.
10DES Simulation (cont)
Process 1 (v11, 0) (v12, ?) (v1n, 10)
Process 2 (v21, ?) (v22, 4) (v2n, 8)
Process 3 (v31, 2) (v32, 5) (v3n, ?)
11Challenges
- No history information
- ? No rollback
- No future information
- ? Cannot avoid rollback if do blind interleaving
12Solution
- Postpone interleaving until there is enough
information - Whenever there is a m-event, let it run.
- Resolve time quantity only if all processes come
to events or m-events get stuck
13Example
Process 1 (v11, 0) (v12, ?) (v1n, 10)
Process 2 (v21, ?) (v22, 4) (v2n, 8)
Process 3 (v31, 2) (v32, 5) (v3n, ?)
14Solution
- Postpone interleaving until there is enough
information - Whenever there is a m-event, let it run.
- Resolve time quantity only if all processes come
to events or events get stuck - Works but not so efficient
- Waste on constraint resolution
- Increase the number of simulation rounds
15Get hints from designers
- Identify regularities in the tags
- Periodical tasks
- Tasks with latency/rate constraints
-
- Introduce built-in logic of constraints (LOC)
- to be able to predict future
- period(event, p)
- maxrate/minrate(event1, event2, r)
- maxlatency/minlatency(event1, event2, r)
16Quantity Annotation Quantity Manager
(v1, ?)
(v1, 0)
- Quantity Manager
- Data type
- Functions
- Axioms
Built-in LOC
17Experiments
P0 write(w) (10)
C read() (15)
M
P1 write(w) (10)
18Simulation Statistics
- Postpone interleaving
- Number of Scheduling Rounds Done by Simulation
Manager 2120 - Average Number of RUN Processes Scheduled per
Scheduling Round 1.25283 - Total Simulation Time 280000 us
- Built-in loc
- Number of Scheduling Rounds Done by Simulation
Manager 1168 - Average Number of RUN Processes Scheduled per
Scheduling Round 1.49914 - Total Simulation Time 190000 us
19Conclusion and Future Work
- Formally analyze the simulation strategy
- Identify problems in terms of simulation
efficiency - Discuss the possible solutions
- Future work
- Are there better solutions to the efficiency
problem? - How to co-simulate Metropolis DES with external
CT/Hybrid system simulators?
20Thank you!!! Questions?