editing/creating fddevs model couplings using …lahiru/10ses/10fddevswithses.pdf ·...
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
Press NY, 2000.
http://www.amazon.com/Theory-Modeling-Simulation-Bernard-
Zeigler/dp/0127784551/ref=sr_1_1?ie=UTF8&s=books&qid=1283293163&sr
=8-1
2. Modeling and Simulation-Based Data Engineering: Introducing Pragmatics
into Ontologies for Net-Centric Information Exchange,B.P Zeigler and Phillip
Hammond, Academic Press, 2007.
http://www.amazon.com/Modeling-Simulation-Based-Data-Engineering-
Introducing/dp/0123725151/ref=sr_1_1?s=books&ie=UTF8&qid=128329329
2&sr=1-1
19
System Entity Structures
The System Entity Structure (SES) is a high level ontology framework targeted to modeling,
simulation, systems design and engineering. Its expressive power, both in strength and limitation,
derive from that domain of discourse. An SES is a formal structure governed by a small number
of axioms that provide clarity and rigor to its models. The structure supports hierarchical and
modular compositions allowing large complex structures to be built in stepwise fashion from
smaller, simpler ones. Tools have been developed to transform SESs back and forth to XML
allowing many operations to be specified in either SES directly or in its XML guise. The axioms
and functionally based semantics of the SES promote pragmatic design and are easily
understandable by data modelers.
Ontology is a knowledge representation concerned with describing things and their
relationships. An ontology contains classes (elements), attributes of the classes, and relationships
between classes with which to represent or model knowledge of a certain domain. The System
Entity Structure (SES) is a formal ontology framework, axiomatically defined, to represent the
elements of a system (or world) and their relationships in hierarchical manner. It provides a
model to describe knowledge of a domain in a structural way. Since it is originated from the
representation of simulation model structure, SES is easily accommodated in modeling and
simulation for automation. While SES represents complex data in a rigorous way, it has
flexibility and efficiency to change the structure according to a variety of choices. Figure 1
shows the basic representation elements of the SES.
Figure 1.Basic SES representation
SES consists of entities, (multi-)aspects, specialization, and variables.
• Entities represent things that have existence in a certain domain. Entities can have variables
which can be assigned a value within given range and types
• Aspects represent ways of taking things apart into more detailed ones and labeled
decomposition relation between the parent and the children.
20
• Multi-aspects are aspects for which the components are all of the same kind.
• Specialization categorizes things in specific forms that it can assume. It is a labeled relation
that expresses alternative choices that a system entity can take on.
• Entities can have variables, which can be assigned a value within given range.
For example, a book can be represented in SES structure in Figure 2.
Figure 2.Representation of a book in SES
A book consists of front cover, back cover, and pages, which show the physical
decomposition relation between book and covers. The front cover of a book can be made of
either cardboard or paper. The cardboard is also manufactured in red or blue. Pages contain
multiple entities of the same characteristics. Pages has a variable of numOfPage whose values
take on integer values.
Decomposition of event sets provides an example of the use of SES in time segment XML
descriptions.
The SES operations causing structural change to extract specific information are: pruning,
restructuring, and transforming. Pruning is an operation to cut off unnecessary structure in a
SES based on the specification of a pragmatic frame. More specifically, it includes processes:
a) to assign particular values to variables of entities,
b) to trim the SES and get the minimal SES for end-users by picking specific elements from
multiple choices. Restructuring is a mapping process within the same domain, and may result in
the alternative structures. Transforming is also a mapping process, but from one domain to
another domain. For example, a pruned SES is transformed into a simulatable DEVS model.
An important computational representation of the System Entity Structure uses the extended
markup language (XML). With the availability of appropriate tool support, this makes
development of XML Schema transparent to the modeler. Finally, SES structures are compact
relative to equivalent Schema and automatically generate associated executable simulation
21
models.
Natural Language Representation
The basic idea is as follows. The entity is considered as a collection of various message
streams. It has been observed in complex systems that an entity node can act as receiver and
sender simultaneously. It is logical to consider that a node may be processing more than one
messages at a given instant. Consequently, developing a framework where the entity node model
can operate with multiple message streams is the objective of this type of requirement
specifications.
The rules that provide a binding to this type of requirement specifications are provided in
Table 1. The designer can specify each node’s behavior as a sender and a receiver with respect
to any specific message type.
22
Rules:
1 Copula "is" and "are" are treated the same.
2 Compounds
x and y;
x, y, and z; NOTE: the commas are
mandatory for 3 or more constituents
x, y, z, and w;
x or y;
x, y, or z;
x, y, z, or w;
3 Determiners
“a”,”the”,… are removed from the
input before processing
4 End of Sentence use “!” instead of “.”
5 Sentence Order
· The entity mentioned first in the first
sentence becomes the root of the SES.
· A variable must be attached to an
entity before giving it a range
specification (see below).
· Otherwise sentences can be in any
order.
6 Forms
In the following, CAPITALs indicate
variables, lower case indicate
mandatory key words in the order
shown.
7 Specialization
THING can be VARIANT1,
VARIANT2, or VARIANT3 in
CLASSFAMILY!
8 Aspect
From VIEW perspective, THING is
made of COMPONENT1,
COMPONENT2, and
COMPONENT3 !
9 MultiAspect
From multiple perspective, THINGS
are made of more than one THING !
10 Attached Variables
THING has VAR1, VAR2, and
VAR3!
11 Range specifications of variables
The range of THING's VAR1 is
RANGE!
23
Prepared by
Lahiru Ariyananda
ACIMS , University of Arizona.