COMP 522 – Modelling and Simulation Project Presentation

advertisement
COMP 522 – Modelling and
Simulation Project Presentation
Project Title:
Use the multi-formalism modelling and
simulation tool Ptolemy II to study a
personalized rapid transportation system
Presented by:
Onur DUMAN
onur.duman@mail.mcgill.ca
Motivation
• Project was done using multi modelling and
formalism tool Ptolemy II
• Transportation System : Trains which are
travelling between terminals.
• Both time concept and event concept are
taken into account during modelling
Motivation(2)
• Usage of “Modal Model” feature of Ptolemy II
• Simulation will be done by getting a trace of
locations that the train has passed
• State of train is mainly dependent on location
of train
Proposal/Requirements
• Four trains and six stations.
• Each train has an initial location given at the
start
• Train can depart if there is no train 100 yards
front of the train
Proposal/Requirements(2)
• Train will go with its maximum speed unless
there is another train within 80 yards after the
train
• Trains follow a circular track
• Each train has a passenger button
Proposal/Requirements(3)
• If train stops at a station, it will wait 90
seconds before the next departure.
• If there are no trains within 100 yards of the
train, it will depart
DesingAndModels
• Both Statecharts and Block Diagrams are used
• Firstly, simple functional blocks, which will be
used for complicated tasks are modeled
DesignAndModels(2) TrainDistanceComparator
DesignAndModels(3) TrainComparisonUnit
DesignAndModels(4) ComparisonUnitForShortDistance
DesignAndModels(5) TerminalDistanceAndNumber
DesignAndModels(6) - TrainModel
DesignAndModels(7) - TrainFunction
DesignAndModels(8) - TrainRunning
DesignAndModels(9) – A Simple Delay
DesignAndModels(10) – Operation for
Passenger Button
DesignAndModel11 - CompleteModel
Implementation
• Performed using Ptolemy II tool
• Each model discussed above is implemented as a
seperate file instead of simple units: So, 6 XML
Files:
–
–
–
–
–
–
completeTrainModel.xml
terminalDistanceAndNumber.xml
trainComparisonUnit.xml
trainDistanceComparison.xml
trainModel.xml
trainShortDistanceComparison.xml
Experiments
• Two experimental configurations:
– Firstly, train initially at position 195, it is scheduled
to stop at station 4, but a passenger requests to
stop at station 1 by pushing the button but after
stopping for 90 seconds, train can not continue
because there is another train at 300( stopped
train is at 200)
Experiments(2)
Experiments(3)
• Outputs:
Train Locations :
196 197 198 199 200 200 200 200 200 200 200
Train Next Stations: 4 4 4 1 1 1 1 1 1 1 ( at fourth
iteration a passenger requested to stop at
station 1( nearest station) )
Experiments(4)
• Train is at location 195 initially, stops at station
located at 200, and after stopping continues
its travel because there is no train after 100
yards from the train.
Experiments(5)
Experiments(6)
• Output:
Train Locations :
196 197 198 199 200 200 200 201 202 203 (After
stopping at station 1, train can continue its travel)
Train Next Stations:
0 0 0 1 1 1 1 1 1 1 ( at fourth iteration a passenger
requested to stop at station 1( nearest station) )
Conclusion
• Study of public transportation system using
Ptolemy II
• Trains travel counterclockwise and if there is a
passenger is going to get off at the next
station, the train stops at the station
• Train maintains its speed according to its
distance to the train in front of it
Conclusion(2)
• State of the train and variables of the train(
location and next station) change according to
location of train and calculations done
according to locations of all the trains
• Delay was introduced in order to simulate stop
at station
Live Demo
• A demo of experiment 1 and experiment 2
References
• Transportation System inspired from the
article:
– Executable Object Modelling with Statecharts
http://ieeexplore.ieee.org/iel1/2/13072/00596624.
pdf?isNumber=13072
• Ptolemy II Documentation and Tutorials:
– http://ptolemy.berkeley.edu/ptolemyII/
Thanks for Listening
• Any questions?
• Any comments?
Download