1 Editing/Creating FDDEVS model Couplings using System Entity Structures Note : Before you read this guide, you need to have followed and updated FDDEVS Software following the “Guide to updating FDDEVS software to latest versions” to enable the features discussed This step by step guide will help you to understand - how to use an advanced feature of FDDEVS involving System Entity Structures to modify/create model coupling The topics we will visit in this Guide 1) A Brief Note on System Entity Structure (SES) 2) Step1: Creating Atomic and Coupled Models revisited 3) Step 2: Modify Couplings using System Entity Structures 4) Step 3: Modified model renaming with SES
23
Embed
Editing/Creating FDDEVS model Couplings using …lahiru/10SES/10FDDEVSwithSES.pdf · Editing/Creating FDDEVS model Couplings using ... Modify Couplings using System Entity Structures
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
Editing/Creating FDDEVS model Couplings
using
System Entity Structures
Note :
Before you read this guide, you need to have followed and updated FDDEVS
Software following the “Guide to updating FDDEVS software to latest
versions” to enable the features discussed
This step by step guide will help you to understand
- how to use an advanced feature of FDDEVS involving System Entity Structures to
modify/create model coupling
The topics we will visit in this Guide
1) A Brief Note on System Entity Structure (SES)
2) Step1: Creating Atomic and Coupled Models
revisited
3) Step 2: Modify Couplings using System Entity
Structures
4) Step 3: Modified model renaming with SES
2
1) A Brief note on System Entity Structure (SES)
• System Entity Structure
o is a knowledge representation framework for supporting the compositions
of hierarchical and modular structures
o Please see pg 18 for reference material
• SESs allows
o large/complex systems to be defined using smaller and simpler ones in a
structured/organized manner.
• Since SES originated from the representation of simulation model structure
o it is easily accommodated in modeling and simulation for automation
o as you will see in future tutorials
� FDDEVS framework has the capability to use SES descriptions
defined in a natural language to specify model couplings.
Basic structural composition of a SES involve
o Entity : could be anything that exist in the real world or maybe
in imagined world.
� Ex: Tennis Match, Book, Car, House, a
Dragon! etc
o Variable : are an attribute of an Entity
� Ex : Name of Player
o Aspect : represent ways of decomposing things into even
smaller ones.
� Ex : Tennis Match can be decomposed into
Player A , Player B, Umpire etc.
o Specialization : represent categories or families of specific forms that a
thing can assume.
� Ex : Tennis Match can be Singles match or
Doubles. Tennisball can be Green or yellow
color.
o Multi Aspect : are aspects for which the components are all of the
same kind.
� Ex : Tennisballs
3
Figure1 depicts the basic structural composition of an SES
Figure 1: Basic structural composition of an SES
4
Using SES concepts, Figure 2 is the structural representation of a Tennis Game.
Please refer to Appendix B for further information SES and PES structures.
5
Step 1 : Creating Atomic and Coupled Models revisited
Recall the below diagram for Tennis PlayerA?
1. As a refresher, can you fill in the blanks for the FDDEVS natural language description
below of PlayerA?
2. As we will be experimenting with a new FDDEVS concepts in this tutorial
• let us create a new folder named “TennisExp” and set the work path to it
• if you forgot how to you can refer to Appendix A
• save the text as “PlayerA.txt” using the FDDEVS Builder GUI
3. Generate PlayerA DEVS java model 3.1. using the Builder GUI view the PlayerA.java using SimView.
3.2. Make sure your model is behaving correctly as it should. \
o If not, you can “cheat” a bit this time and refer the prior tutorials for
correct natural language description.
___________ in play for time 0.5!
____ play ____ ShotA!
from play go to ____!
hold in _____ for time Infinity!
when in __________ ShotB go to ____!
6
4. Now can you fill in the blanks for PlayerB natural language description below?
5. Save the text as “PlayerB.txt”.
5.1. As before Generate DEVS java model and experiment through SimView for
functionality.
6. Next make a Coupled Model named “GameBetweenAandB”
• with the 2 Tennis Players created above.
• To do so ( as recap) , on FDDEVS Builder GUI Natural Language tab
a) Click Open and type “GameBetweenAandBSeS.txt”
b) Create Coupled Button
c) In opened selection box choose PlayerA.xml and PlayerB.xml
d) In Eclipse IDE view GamesBetweenAandBSeS.java and (repeat until
code is full)
e) View GamesBetweenAandBSeS.java in SimView . Observe the
correct coupling and behavior of shot exchanges
to start passivate in wait!
when in ___ and ____ go to ____!
_________ for time 0.5!
___________ ShotB !
from play go to _____!
7
Step 2 : Modify Couplings using System Entity Structures
Before you proceed make sure you have Updated your FDDEVS software to the
Latest Version with new features .
i) Execute FDDEVS and notice that there are 2 new Tabs
1) SES
2) SES with Prune
ii) Click on the SES Tab to start with
8
iii) ( In SES Tab) Open GameBetweenAandBSeS.txt
Contents:
From the struct perspective, GameBetweenAandB is made of PlayerA, and PlayerB !
From the struct perspective, GameBetweenAandB sends ShotB to PlayerA !
From the struct perspective, GameBetweenAandB sends ShotA to PlayerB !
From the struct perspective, PlayerA sends ShotA to GameBetweenAandB !
From the struct perspective, PlayerB sends ShotB to GameBetweenAandB !
From the struct perspective, PlayerA sends ShotA to PlayerB !
From the struct perspective, PlayerB sends ShotB to PlayerA !
Note :
The above natural language SES description was automatically
created and used when the coupled model GameBetweenAandB was
generated.
9
Though the descriptions are generally intuitive it is good to note in
• From the struct perspective, GameBetweenAandB is made of PlayerA, and PlayerB !
o GameBetweenAandB , PlayerA and PlayerB are all Entities.
o The Top Entity ( Parent) of the SES is GameBetweenAandB, and it is
decomposed in to two parts namely PlayerA and PlayerB
iv) Modify the SES description to experiment,
For example
o delete the sentence
“From the struct perspective, PlayerA sends ShotA to PlayerB !”
v) Click ShowParse button to
1) check for syntax errors ( there should be none in this case)
2) visualize the SES Tree as below
10
vi) Click Transform
• to generate a modified DEVS Java version of the Coupled Model.
Make sure in Eclipse IDE, GamesBetweenAandB.java code is updated.
vii) View the newly generated GameBetweenAandB.java
o using Sim View
Did you notice any difference related to overall model behavior and couplings?
11
Step 3: Modified model renaming with SES
Since the model behavior is changed now
o GameBetweenAandB will not be an appropriate descriptive name.
1) To give an appropriate name and save
• Click RenameTopEntity button
2) An Input Box will pop up where you can type a new name
12
The new name “ModifiedGame” will used as an example.
• Click OK
• note ModifiedGame is not a good descriptive name for
the above model behavior but will be used only an
example for discussion
• the relatively simple task of observing the modified model
behavior and giving it an appropriate name is left as task to
the student.
13
3) Notice that once you click OK
a) the revised version will be saved as
ModifiedGameSeS.txt
b) the revised content will be updated on text area as
below
Modified Contents:
From the struct perspective, ModifiedGame is made of PlayerA, and PlayerB !
From the struct perspective, ModifiedGame sends ShotB to PlayerA !
From the struct perspective, ModifiedGame sends ShotA to PlayerB !
From the struct perspective, PlayerA sends ShotA to ModifiedGame !
From the struct perspective, PlayerB sends ShotB to ModifiedGame !
From the struct perspective, PlayerB sends ShotB to PlayerA !
The old name GameBetweenAandB
• is revised
• with the new name ModifiedGame
• which is also now the Top Entity.
14
4) With ModifiedGame is updated in SES tab text area
• Click Transform button to generate the new version
with the new name.
Question : Could we not have done a simple Save As to change the model name?
Answer : Though it is possible to do a Save As , all instances of the old name appearing in
the SES description ( ie GameBetweenAandB) needs to be replaced with the new
name ( ie ModifiedGame) before you do the save. Also the name under which the
model is saved needs to match the top entity name in the SES. Else the model
generation will run into irregularities.
RenameTopEntity process will handle these issues automatically.
15
EXERCISE
Please follow the exercise titled “An Exercise “ FDDEVS with SES” on FDDEVS website.
16
APPENDIX
Creating a new work folder
Steps to follow
i) On ECLIPSE IDE
a. under FDDEVS project ,
b. Select “src” then New and Folder
c. Give name TennisExp
Images below show screen captures of the process..
17
ii) On FDDEVS Builder Workspace
a. Goto File, and next Create Folder
b. Browse to TennisExp Folder and select it
c. Type path for File Name ( recall we followed the same procedure in the guide “
Intro to FDDEVS Builder Working Environment”)
d. Click Open
18
APPENDIX B
Acknowledgment
Material mentioned herewith is an excerpt from Prof B Zeigler “DEVS Primer” which
would give the reader a short and effective introduction to SESs.
If you need to learn in detail about SESs please refer to
1. Theory of Modeling and Simulation, B.P Zeigler, T.G Kim et al, Academic