Using
the CD++ Modeler Graphical User Interface (GUI), atomic and coupled models can
be created for the CD++ toolkit. The basic functions of the GUI include:
creating atomic and coupled models, exporting the models to different formats,
and animating the simulations. The GUI
also includes: - a simple text editor to directly modify Cell-DEVS models, -
the RUN/SIMU commands to execute the simulation with the CD++ toolkit, and -
the DRAWLOG command to generate the draw information from the simulation. This
section describes in detail how to use the GUI for inputting DEVS model, and
for visualizing the results of the Cell-DEVS, Atomic-DEVS, and Coupled-DEVS
models.
Since the GUI is coded in Java (JDK1.4.1[MSOffice1]), it is platform portable and can be run in various
environments, such as Eclipse or JBuilder (with JDK 1.4.1[MSOffice2]). Although this tool is a standalone program, it can also be accessed
through CD++Builder by clicking on ,
located in menus of CD++Builder, CELL-DEVS, DEVS, and GGAD perspectives.
Note: If you are using CD++Builder, you don’t have to install
the standalone version. You can access CD++ Modeler directly from the Cellae’s
perspective, by clicking on .
1) Download the cdModeler.zip file, which contains
source code, class files, and some example files. Decompress the cdModeler.zip file in the
Windows environment.
2) Install JDK 1.4.1[MSOffice3] or above.
3) Set
up the JAVA_HOME environment variable to point to the JDK directory.
To do this, modify the PATH environment variable by
adding " %JAVA_HOME%\bin; ".
Note: To modify environment variables, go to Control
Panel > System > Advanced > Environment Variables.
In the cdModeler directory, double click the run.bat
file to start the program.
When the program has started, it will display a dialog as seen in Figure 127.
Once
the CD++Modeler tool is running, the following screen will appear.
Figure 127: CD++ Modeler window.
Figure 128: CD++ Modeler menu bar.
1
2 3 4
5 6 7
8 9 10 11
12 13 14
Figure 129: CD++
Modeler button bar.
The button bar contains the
following buttons (in order from left to right):
Please see the Help files
(in Atomic>Distribution and Coupled>Distribution) for a more detailed
description of the button bar.
The following sections
explore the functions of the GUI with examples.
Models can be defined within
the design space. First select the
appropriate design space (Atomic or Coupled) for the model by clicking on the
appropriate tab.
The basic steps required for
creating an atomic model are as follows:
1) Choose the atomic design
space by clicking once on the Atomic tab in the interface.
(The atomic design space
consists of a central panel and two lateral panels.)
2) Select File > New from the main menubar.
3) Position the mouse within
the design space, and right-click. The
following popup menu will be displayed.
Figure 130: Creating an atomic
model
1) Left-click on Model title. The Set Title ("Model ClassName") dialog will be displayed.
Figure 131: Entering the model title
2) Type in the appropriate
Model Title, and press Set.
1) Left double-click on the
design space. A circular unit will be drawn in blue.
Figure 132: Adding Units to an Atomic Model
2) Left double-click on the
circular unit. This will select the circular unit, as represented by the unit
becoming red.
Figure 133: Selecting a unit
3) Left double-click on the
selected unit. This will de-select the circular unit, as represented by the
unit returning to blue.
4) Right-click on the circular unit. The following popup menu will be displayed.
Figure 134: Setting initial property units
5) To set this unit as the initial unit of the model,
left-click on Set initial.
When
another unit is set as the initial unit of the model, the previous unit is
automatically de-selected as the initial unit.
6) To set the properties of this unit, left-click on
Properties. The State Properties
("Atomic Unit properties") dialog will be displayed. Type in the
appropriate state ID and state Time-to-Leave.
Press OK.
Figure 135: Entering State ID and state TL
7) Select the circular unit (ie. left double-click on
the circular unit). After the unit
becomes red, press the Delete button on the keyboard, or select Edit>Delete from the main
menubar.
When a
unit is deleted, all links connected to the unit will also be deleted.
To delete multiple units, select the multiple units
(ie. left double-click on each of the units), and press Delete or Edit>Delete.
1) Right-click within the "canvas" (design
space). The following popup menu will be
displayed.
Figure 136: Adding ports
2) Left-click on Add
port. The
Figure 137: Entering Port ID
Repeat this procedure to add all the necessary ports
for a unit.
3) Right-click within the "canvas" (design
space). The following popup menu will be
displayed.
Figure 138: Deleting Ports
4) Left-click on Delete
port. The
Figure 139:
Links represent transitions between different or
similar units. After creating all the necessary atomic units, links can be made
between the units or be created as a selflink.
Two types of links are available for atomic models:
Internal link (representing an internal transition):
Transition happens automatically as a timer runs out.
External link (representing an external transition):
Transition happens when a certain expression returns true.
Steps to creating a link:
1) Before drawing a link, the user should select the
desired link type by clicking either the internal or external link button on
the toolbar.
2) To
draw a link between two units, position the mouse on one of the units, press
and hold the left mouse button on one unit, drag the mouse to the other unit,
and release the left mouse button. A link with the pre-selected type will be
drawn.
Figure 140: Adding links (external and internal)
3) To create a 'self link'
(a link between an atomic unit and itself), position the mouse cursor on the
unit. Make shure that the unit is not selected [unit is not coloured in red].
Press and hold the left mouse button. Drag the mouse away from and back to the
unit with the left mouse button being held. Release the left mouse button to
finish creating the self link.
Figure 141: Creating a self link
A Warning Message dialog
will be displayed, verifying the creation of a self link. Click OK.
Figure 142: Warning message for creating a self link
Figure 143: Example of internal and external
selflinks attatched to an atomic unit
Internal Link Transition: To attach a port and value assignment to an internal
link, right-click on the link. The following popup menu will be displayed.
Figure 144: Attaching a link to a port
Left-click on Add
port & value. The Add port & value dialog box will be displayed
(See Figure 145). Select the appropriate port [output ports are for
internal transition], and type in the appropriate value for the port. Press OK.
When an internal transition occurs the selected output port will receive
the assigned value which is set in the Add port & value dialog box.
Figure 145: Adding port and value dialog box
External Link Transition: These transitions will allow transitions between
different atomic units [states]. In general the transition happens when a
user-defined value is received on a specific input port.
To add an expression to an external link [represented
by a solid arrow] the following must be done:
1)
Right click on
the on the external link. And select Edit
Expression....
Figure 146: Adding an
expression to an external link
2)
Expressions can
be either added manually [if you know what to type] or with the help of the Add Function button. Inorder to use the Add Function button first select a
function to add from the bottom text field then click on the Add Function button. Now a dialog box
will pop up asking for parameters required in the function. Fill in the
parameters and click ok. Now that a
function is added, user must MANUALLY configure the rest of the expression by
typing “?value” [without the quotes] after the expression. The “value”
represents any number. An example external transition expression would be:
Value(in)?2 . This simply means that when the value at the port “in”
[represented by the Value(port) function] is equal to “2” then make a
transition to the other state.
Figure 147: Showing a
dialog window when the Add Function button is clicked.
5) Select the link (ie. left double-click on the
link). After the link becomes red, press
the Delete button on the keyboard, or select Edit>Delete from the main menubar.
To
delete multiple links, select the multiple links (ie. left double-click on each
of the links), and press Delete or Edit>Delete.
1) To save the model to disk, select File>Save or File>Save As from the
main menubar. The model will be saved as
a .gam file.
Figure 148: Save file Dialog box
2) In order to use the model in the[MSOffice4] other CD++ tools, the model must be exported to a
standard .cdd file. To export the model,
select File>Export. *.cdd must be the file name extension.
Figure 149: Choosing cdd files only
3) To save and export the model in one step, select
File>Save and Export.
The basic steps required for creating a coupled model
are similar to those for creating an atomic model.
Open CD++ Modeler and choose the coupled design space
by clicking once on the Coupled tab in the interface.
The coupled design space consists of a central panel
and three lateral panels:
Figure 150: The coupled design space
The central panel displays the objects (in graphical
form) of the coupled model. Objects
(such as ports, atomic models, and coupled models) can be added, and links can
be connected between the objects.
The top lateral panel displays the types of objects
that are available for defining the model. It is divided into ports (input and
output), predefined atomic models, and predefined coupled models.
The middle lateral panel displays the objects (in
textual form) that define the model.
(The textual form of the objects in the middle lateral panel correspond
to the graphical form of the objects in the central panel.)
When an object/element is selected in the middle
lateral panel, the description/details of the element will be displayed in the
bottom lateral panel. (ie. The bottom lateral panel displays a description of
the element currently selected in the middle lateral panel.)
The central panel is referred to as the 'Modeling
Panel'.
The middle lateral panel is
referred to as the 'Units Panel/Tree'.
1) To add a new atomic model
that is not yet defined, click once on the Add
new Atomic Model Unit button. The new atomic model unit will be drawn in
the upper-left corner of the Modeling Panel, and will be given a default name
(eg. newAtomicModel0).
Figure 151: Adding atomic units
2) To edit the atomic model
unit, right-click on the unit. The following popup menu will be displayed.
Figure 152: Right clicking on the image to edit
Select
Image - change the icon for the unit
Properties
- change the unit name
Explode
- explode the unit for its definition
Reload
- reload the unit if its
definition has been modified
3)
To change the unit name, left-click on Properties. The Model Properties dialog
will be displayed. Type in the appropriate Unit ID. Press OK.
Figure 153: Changing unit name
The
Explode and Reload options will be described in later sections.
Adding
Coupled Models
1)
To add a new coupled model that is not yet defined, click once on the Add new
Coupled Model Unit button. The new coupled model unit will be drawn in the
upper-left corner of the Modelling Panel, and will be given a default name (eg.
newCoupledModel2).
Figure 154: Adding coupled models
2) To edit the coupled model unit, right-click
on the unit. The following popup menu will be displayed.
Figure 155: Editing a coupled model
Select Image - change the icon for the unit
Properties - change the unit name
Explode
- explode the unit for its definition
Reload
- reload the unit if its
definition has been modified
3)
To change the unit name, left-click on Properties.
The Model Properties dialog will be displayed. Type in the appropriate Unit
ID. Press OK.
Figure 156: Changing the unit name
The
Explode and Reload options will be described in later sections
Two types of ports are
available for coupled models: Input and Output.
1) To add a port, first select
the type of port in the top lateral panel. Within the canvas (design space),
position the mouse cursor at the desired location of the port. Left
double-click. The selected port type will be drawn, and will be given a default
name. For example, Port0 represents an
input port, while Port1 represents an output port.
Figure 157: Adding ports
The
name of the port can be changed in two ways:
2a)
Right-click on the appropriate port. The following popup menu will be displayed.
Left-click on Properties.
Figure158:
Changing the name of the port
2b)
In the Units Tree (the middle lateral panel), expand the Ports folder. Left
double-click on the appropriate port. An alternative method is to right click
on the appropriate port and select properties as seen in Figure158.
3)
The Port Properties dialog will be displayed. Type in the appropriate PortID.
Press OK.
Figure 159: Entering port ID
Adding
Links
To add a link between two
objects, position the mouse cursor on the first object (the origin of the
link). Press and hold the left mouse button. Drag the mouse to the second
object (the destination of the link). Release the left mouse button. The link
will be drawn form the origin to the destination. For example, the origin of
the link is Port 2, while the destination of the link is newAtomicModel0.
The link will be created
only if both the origin and destination are valid.
Figure 160: Adding links
NOTE: If you uncheck the Show link port checkbox then (Port2)->0 will not be displayed.
Selflinks can also be created for coupled models. One can add selflinks to the
coupled or atomic model unit as seen in Figure 161. Selflinks are added in the same way as one would add
a selflink to an atomic model (See section 8.16.2.1.7).
Figure 161:
Example selflink starts and ends at newCoupledModel1
A coupled model is composed of other atomic and
coupled models, which can be imported as predefined models. Three model types
are valid for importing:
-
predefined coupled models (.ma)
-
predefined atomic models (.cdd)
- basic
atomic models (from register.cpp)
For example, let’s consider
the ATM model.
You can download the
necessary files for the ATM model here: http://chat.carleton.ca/~jcao/blog/cd++files/ATM%20MODEL%20USING%20NEW%20CD%20MODELER.zip
Continue reading once you
have extracted the zip files.
Open CDModeler, click on the
coupled tab, click File>New to
start the creation of a new coupled model.
Figure 162: Fresh new coupled design space.
A predefined model can be
imported by selecting File>Import.
The Import dialog will be displayed. (Only .ma, .cdd, and .cpp files can be
imported.)
Figure 163: Import dialog box
Browse to the extracted
folder containing ATM files, select register.cpp,
and press Import. Now, a dialog box
will popup as a reminder that one must create ports to the model(s) before
adding them to the design space. Click OK.
In the top lateral panel
browse to Models>Atomic. The
CDmodeler window should now look like the following:
Figure 164: Showing imported models.
The name of the imported models will be displayed in
the top lateral panel, within the appropriate folder (Atomic or Coupled). In
this example the Register.cpp corresponds to a series of atomic models and thus
expanding the atomic subfolder one can find all the models associated with
Register.cpp.
For example: When a coupled model definition file
(.ma) is imported, the name of the imported model is displayed in the top
lateral panel under Models>Coupled. When an atomic model definition file
(.cdd) is imported, the name of the imported model is displayed in the top
lateral panel under Models>Atomic.
To add a unit of the imported model to the definition
of the current coupled model, first select the imported model name
(PINverifier) in the top lateral panel. Within the canvas (design space), at
the desired location of the unit, left double-click. A unit of the imported
model will be drawn.
Figure 165: Creating a model on the canvas (design
space)
NOTE: Units of imported
models cannot be modified.
Importing an *.ma file:
Continuing from the previous
example, click File>Import. Browse
to the ATM folder again but this time select atmNEW.ma and click on import.
A coupled model definition
file (.ma) named "ATM" is imported:
(1) The name "ATM[MSOffice6]" is displayed in the top lateral panel under
Models>Coupled.
(2) “ATM9[MSOffice7]” (a unit of "ATM") is added to the
definition of the current coupled model [This is done by selecting ATM in the
top lateral panel and double clicking on the canvas (design space)].
(3) The predefined ports of “ATM9[MSOffice8]” are displayed in the middle lateral panel. (For "ATM", there are two output
ports: 'cash_out' and 'card_out'. There is also one input port: ‘in’.)
Figure 166: Importing and
creating a coupled model.
NOTE: Importing a *.cdd file undergoes the same
process as importing a *.cpp file the only difference is that one will need to
select a *.cdd file and the model imported will still be found in the Atomic subfolder.
Adding
ports to imported atomic models:
Ports can be added to any unit of the imported atomic
models.
To do so, follow the steps:
Figure 167: Adding a
port to imported model.
A coupled model
(henceforth referred to as "current coupled model") is composed of
other atomic and coupled models (henceforth referred to as "component
models"), which (as demonstrated in previous sections) can be added as
blank models from the button bar or imported as predefined models.
These component
models (within the current coupled model) can be inspected, or
"exploded", for the purposes of definition and modification.
1) To explode a
component model, right-click on the model. The following popup menu will be
displayed. Left-click on Explode. A new model editor (henceforth referred to as
"exploded editor") will be displayed, in which the exploded model can
be edited. (The original model editor will be temporarily hidden, and will become
visible again after the exploded editor has been closed.)
Figure 168: Explode model menu
If an atomic model is exploded, an atomic model
editor will be displayed. If a coupled model is exploded, a coupled model
editor will be displayed.
Figure 169: Atomic and Coupled editor corresponding to exploded
model
Note that within the exploded editor, the exploded
model type (ie. atomic or coupled) cannot be changed.
2) The exploded model can be edited using the same procedures as for
non-exploded models.
For example,
consider the following exploded coupled model, which was created for
newCoupledModel1 (seen in step 1).
Figure 170: Editing exploded models
3) When the definition/modification of the exploded
model is complete one must close the exploded model and choose to save/cancel
the changes made in order to return to the original model editor.
Figure 171:
Original Model Editor
The ports from
the exploded model (shown in step 2) are now available in the original model
editor (after saving). For example, the ports for newCoupledModel1 (ie. input
Port2 and output Port3) are displayed in the middle lateral panel, under
Coupled Model>Units>newCoupledModel1 (See Figure 171).
4) Once all
remaining component models are defined, links can be added between the ports of
the component models.
For example, once
newAtomicModel0 has been exploded and defined/modified, the ports for newAtomicModel0
(ie. input portA and PortB, and output PortC) will be displayed in the middle
lateral panel, under CoupledModel>Units>newAtomicModel0.
Additional ports
(ie. input Port3 and output Port4) can be added to the current coupled model,
and will be displayed in the middle lateral panel, under CoupledModel>Ports.
Links can be
added between the ports of the current coupled model and the ports of the
component models. These links will be displayed in the middle lateral panel,
under CoupledModel>Links.
In the current coupled model seen below, there are
three links:
(1) output PortC of newAtomicModel0 is connected to
input Port2 of newCoupledModel1
(2) input Port3 of the current coupled model is
connected to input Port2 of newCoupledModel1
(3) output Port3 of newCoupledModel1 is connected to
output Port4 of the current coupled model
Figure 172: Coupled model with links
5) If a component
model is exploded for modification after links have been connected, the links
connected to the ports of the component model will be disengaged. This will
prevent unpredictable changes from occurring.
For
example, if newCoupledModel1 is exploded, the links connected to the ports of
newCoupledModel1 (i.e. input Port2 and output Port3) will be disengaged.
Figure 173: Disengaged
links on an exploded coupled model
Figure 174: Detailed visualization of disengaged links
Images can be added to a model in two ways.
One way is to set an image as a background, the second way is to set an image
to represent a unit within the model.
To add a background to the canvas; right
click on the canvas [white space] and select background (see Figure 175). When the
file browser window pops up select an image file to load and click Set.
Figure 175: Loading
Background
Note: The menu you get when right clicking on the canvas may be
different than the one shown in Figure 175. This is because you are adding the background to the
atomic canvas and not the coupled canvas. However, the steps to add the image
is all the same. [Hint: click on Background]
Alter an image has been set as background you
should see the background image stretched to cover the whole canvas. (See Figure 176)
Figure 176: Image of a
car set as background
Note: Images can only be added to units [any object that is not a
link] on the coupled canvas.
Images can be added to atomic units, coupled units, input ports and
output ports.
To add an image right click on the unit and click Select Image (see Figure 177).
Figure 177: Adding image to unit
In the the file browser window select an image you wish to set as the
image for the unit and click Set.
Figure 178: Choosing an image
The following is an example of having an image representing a unit
[note the yellow car].
Figure 179: Image added to atomic unit
This section describes how to visualize the result
files of atomic Cell-DEVS models, atomic-DEVS models, and coupled-DEVS
models.
From the main menubar,
left-click on Animate. The following menu will be displayed. Select the
appropriate option, depending on the model type to be visualized:
Cell-DEVS animation -
atomic Cell-DEVS models
AtomicAnimate -
atomic-DEVS models
CoupledAnimate -
coupled-DEVS models
Figure 180: Animate menu
The following sections
describe the commands of the Animate menu for the version of CD++ Modeler
included in the CD++ Builder plugin for Eclipse, not the stand-alone version of
CD++ Modeler.
AtomicAnimate
using: Atomic-DEVS, Coupled-DEVS, Atomic Cell-DEVS
A DEVS model must include at least one atomic model.
After simulating the DEVS model, a .log file is generated. The .log file
records all the messages sent between DEVS components. This includes all messages sent/received by all atomic models
in the coupled model. The message values sent/received by a specific atomic
model can be extracted from the .log file and visualized.
The steps required for visualizing the message values
sent/received by a specific atomic model are as follows:
1) In the Animate menu, left-click on AtomicAnimate.
An atomic animate dialog box will be displayed.
Figure 181: Atomic Aniamte Options
2) Left-click on the browse button[MSOffice9]. A Set dialog will be displayed. Select the .log
file that contains the messages sent/received by the atomic-DEVS model to be
visualized. (The atomic-DEVS models that send/receive messages within the
selected .log file will be available for visualization.) After choosing the
appropriate .log file, left-click on Set.
Figure 182: Set dialog box
If an [MSOffice10]invalid file type is chosen, the (blank) visualization window
will be displayed as follows:
Figure 183: Empty visualization window due to invalid file type
The following example demonstrates the functionality
of the Atomic Animate visualization window, using the atomic-DEVS model
FunctionEval (which was extracted from the Hybrid model). Additional examples for a coupled-DEVS model
(4BitCounter) follows.
AtomicAnimate
Example of Atomic-DEVS: FunctionEval
To run this example, download the FunctionEval
project. Where
would one download this?
FunctionEval is an atomic-DEVS model that contains
one output signal.
In the Set and atomic animate dialogs, open
tester_caso1.log.
Figure 184: Opening tester_caso1.log
The atomic-DEVS models that send/receive messages
within tester_caso1.log will be available for visualization. Since
tester_caso1.log only contains the messages sent/received by the
function@FunctionEvaluator model, the only atomic-DEVS model available for this
example is the function model.
The following Atomic Animate visualization window
will be displayed.
Figure 185: Atomic Animate visualization window
The Atomic Animate visualization window has several
functions for modifying the appearance of the visualization, such as:
-select
the atomic-DEVS model to be visualized (1)
-select
the output signals (of the selected atomic-DEVS model) to be plotted (2)
-zoom
in/out on the vertical axis (3, 4) and the horizontal axis
(5, 6) of the plot
-set the
upper and lower bounds of the vertical scale (7)
-jump to
the specified time interval (8)
-go to
the previous/next time interval (9, 10)
-show the
values of the output signal on the plot (11)
-select
the time format to be displayed on horizontal axis (12)
Select the atomic-DEVS model to be visualized
1) Left-click on the drop-down list. From the
drop-down list, select or left-click the atomic-DEVS model to be visualized.
The output signals of the selected atomic-DEVS model will be displayed.
In this example, the only atomic-DEVS model available
for visualization is the function model.
Figure 186:Atomic DEVS model visualization
1) To remove a signal from the visualization, uncheck
or left-click the box beside the signal name. The plot of the output signal
will be removed from the visualization window.
In this example, the function model has one signal, out.
Figure 187: Removing output signal from visualization window
2) To include a signal in the visualization, check or
left-click the box beside the signal name.
1)
Left-click on the drop-down list located below the Values checkbox. From the drop-down list, select or left-click
the appropriate time format to be displayed on the horizontal axis.
HH - represents hours
mm - represents minutes
ss - represents seconds
SSS - represents milliseconds
Figure 188: Values drop down menu
In this example, the time selected time format is SSS
(which represents milliseconds).
Figure 189: Specifying time
The entire visualization plot for the out signal of function model appears as follows:
Figure 190: Visualization of the out signal
For upcoming sections, the following plot will be
modified:
Figure 191: Plot to be modified
1)
To remove the output signal values from the plot, uncheck or left-click the box
beside Values. The values of the output signal(s) will be removed from the
visualization.
In this example, the values of the signal out are removed, and so are
no longer visible.
Figure 192: Removing values of the out signal
2) To include the output signal values in
the plot, check or left-click the box beside Values. The values of the output signal(s) will be
added to the visualization.
In this example, the values of the signal
out are added, and so are visible. (The
values are not legible due to their proximity.)
Figure 193: Adding the values of the out signal (making the
signal visible)
Note: When the plot is zoomed in (and the
time format changed), the values can be made legible:
Figure 194: Viewing the values only
(Zooming in and out of the horizontal
axis is described in the following section.)
Zoom
in or out of the horizontal axis of the plot
1) To 'zoom in' or stretch the horizontal scale,
press the X In button. The length of the horizontal scale will increase.
Figure 195: Zooming in on the horizontal scale
2) To 'zoom out' or compress the horizontal scale,
press the X Out button. The length of the horizontal scale will decrease.
Figure 196: Zooming out on the horizontal scale
Zoom
in or out of the vertical axis of the plot
1) To 'zoom in' or stretch the vertical scale, press
the + button. The length of the vertical scale will increase.
Figure 197: Zooming in on the vertical scale
2) To 'zoom out' or compress the vertical scale,
press the - button. The length of the vertical scale will decrease.
Figure 198: Zooming out on the vertical scale
1) To set the lower and upper bounds of the vertical
scale, first specify the desired lower and upper bounds in the Scale fields.
In this example, the upper bound is specified as 2.0,
while the lower bound remains unchanged.
Figure 199: Setting lower and Upper bounds
2) Press the Set button. The parts of the output
signal that fall within the lower and upper bounds will be displayed. (The
values for the lower and upper bounds are visible on the vertical axis.)
In this example, the parts of the output signal that
fall within -0.899982 and 2.0 on the vertical scale are displayed.
Figure 200: Displaying the signal between the lower and upper
bounds
1) To go directly to a particular time interval of
the visualization, first specify the desired range of the time interval in the
From and To fields.
In this example, the To field (or upper bound of the
time interval range) is specified as 100, while the From field (or lower bound
of the time interval range) remains unchanged.
Figure 201:Specifying desired range of time
2) Press the Jump button. The parts of the output
signal that occur at times that fall within the From and To range will be
displayed. (The values for the time interval range are visible on the
horizontal axis.)
In this example, the parts of the output signal that
occur between 0 and 100 (milliseconds) are displayed.
Figure 202: Viewing only the specified time range
Note: When zoomed in (ie. by pressing the X In button
several times), the plot from the previous figure will appear as follows:
Figure 203: Zooming in to the previous plot
Go
to the previous/next time interval
1) To go to the next increment of the specified
interval, press the Next button.
In this example, using the same time interval as
previously specified, when the Next button is pressed, the parts of the output
signal that occur between 100 and 200 (milliseconds) are displayed.
Figure 204: Going to the next time interval
In this example, when the Next button is pressed
again, the parts of the output signal that occur between 200 and 300
(milliseconds) are displayed.
Figure 205: Signal between 200 and 300 milliseconds
2) To go to the
previous increment of the specified interval, press the Previous button.
In this example,
when the Previous button is pressed, the parts of the output signal that occur
between 100 and 200 (milliseconds) are displayed. This is the same plot as the first plot seen
in step 1.
Figure 206: Going to the previous increment
Jump
to a specific time
1) To go directly to a specific instance
of time of the visualization, first specify the instance in both the From and
To fields.
In this example, the specific instance to
be plotted is 200.
Figure 207: Jumping to a specific instance
2) Press the Jump
button. The part of the output signal that occurs at the specified instance
will be displayed. The value for the specified instance of time will be visible
on the horizontal axis. The output value for the signal at the specified
instance will be visible on the plot.
In this example,
the part of the output signal that occurs at the instance of 200 (with a
corresponding time of 196 milliseconds) is displayed. The output value of the
signal at 196 milliseconds is 0.94299.
Figure 208: Viewing a specific instance
Note: When the From and To fields contain the same value,
the Previous and Next buttons are inoperable.
Note: As demonstrated earlier, when output
signal values are removed from the plot (by unchecking the Values checkbox), no
output values will be displayed. A red line representing the range of values of
the output signal will be visible.
In
this example, when the single output signal value is removed from the plot, the
red line is barely visible, since the "range" of the output signal is
limited to one single value.
Figure 209
: Range of output signal limited to one value
AtomicAnimate
Example of Coupled-DEVS: 4BitCounter
To run this
example, download the 4BitCounter project.
4BitCounter
is a coupled-DEVS model composed of multiple atomic-DEVS models that each
contain multiple output signals.
The
main functionality of the Atomic Animate visualization window described in the
previous example (FunctionEval) also applies for this example. However, while
the previous example (FunctionEval) illustrated the visualization of a single
atomic-DEVS model, this example (4BitCounter) illustrates the visualization of
(a coupled-DEVS model composed of) multiple atomic-DEVS models.
Using the same
procedure as in the previous example, in the Set and atomic animate dialogs,
open 4Counter.log.
Figure 210: Opening 4Counter.log
The models that
send/receive messages within 4Counter.log will be available for visualization.
The file 4Counter.log contains the messages sent/received by the top model,
which is composed of the following models: 4count@Process_4_Counter,
b1@Signal, b2@Signal, b3@Signal, b4@Signal, clock. Whereas the first four models are atomic-DEVS
models, the fifth model, clock, is a coupled-DEVS model composed of the
atomic-DEVS models: inv@Process_Inv, sig1@Signal. So, for this example, the following models/components
are available for visualization: clock, 4count, inv, b4, b3, top, b2, b1, sig1.
The following Atomic Animate visualization window
will be displayed.
Figure 211: Atomic Animate Visualization Window
By default, the
signals of the first model/component in the list - in this example, clock -
will be displayed.
Also by default
the visualization plot will display the range of output values of the selected
signals for the time interval spanning the entire simulation. In this example,
the time interval of [
Also
by default, the lower/upper bounds of the vertical Scale will initially
correspond to the minimum/maximum of the output value range. So, the vertical
scale for an output signal will automatically be set such that the entire range
of output values for the signal (for the initial time interval) will be visible
in the visualization plot. In this example, the in and out signals of clock
each initially have a vertical scale with bounds [0.0,1.1].
The differences
in the functions of the Atomic Animate visualization window, when used for
displaying multiple atomic-DEVS models, will be described:
-select the model/component to be
visualized
*availability of signals for the selected
model/component (explanation)
-select the (available) signals of the
selected model/component to be plotted
Note: The plot can be more clearly viewed by zooming out
(ie. pressing the “-“ Magnification button), and changing the time format
appropriately. The format of the time
(horizontal axis) values was changed to SSS, since the simulation ends at 00:00:00:400
(according to the last message time in the .log file).
Figure 212: Formatted output
Select the model/component
to be visualized
1) The models/components available for visualization
can be seen in the drop-down list.
To select a model/component to be visualized, first
left-click on the drop-down list.
Note: The order of the models/components in the
drop-down list is arbitrary.
Figure 213: Selecting a model component
2) From the
drop-down list, select or left-click the model/component to be visualized. The
signals of the selected model/component will be displayed.
Note: For each
component, the order of the available signals (in the column below the
drop-down list) is arbitrary.
Also for each
component, the colors of the available signals are automatically assigned based
on their order. The first available signal will be red, the second blue, the
third green, etc.
The order of the visible visualization plots will correspond to the order of available signals that are selected for visualization.
In this example, 4count is selected, and the signals
available are: q1 (green), q4 (brown), q3 (pinkn), and q2 (light blue). Since
all the available signals are checked, all the signals are plotted.
Figure 214: Viewing all signals
For the rest of the components in the drop-down list,
the available signals and range of output values for the entire simulation can
be seen in the following figures.
Figure 215: Available
signals and range of output values
When the top
component is selected, the signals available are: in, clk, d1, d2, d3, d4, bo1,
bo2, bo3, bo4.
Figure 216: Viewing all signals in one window
Note: When the top component is selected, since the time
interval is initially set to correspond with the entire simulation, all the
available signals of the top component will be checked. Due to the number of
available signals in the top component, the space required to display the Scale
fields of the signals exceeds the height of the Atomic Animate visualization
window. The Scale fields can be made visible if the height of the visualization
window is increased.
It may not always
be possible to increase the height of the visualization window to accomodate
the Scale fields. (Please see Appendix B - 4BitCounter for more details.)
The visualization plots of the checked signals also
exceed the height of the Atomic Animate visualization window. The vertical scrollbar
can be used to view the visualization plots that are located beyond the bottom
edge of the window.
Availability of signals for
the selected model/component
A selected component can have multiple
signals (usually called ports).
When a component is selected, the signal
associated with the component can be selected to be displayed as a plot in the
visualization.
Figure 217: Selecting a signal to be displayed
A component will be displayed in the drop-down list if values are being sent to at least one signal of the component. (ie. if at least one signal is available for the component)
The following behaviour still applies: For a selected
component, the order of the available signals is arbitrary. The colours of the
available signals are automatically assigned based on their order. The first
available signal will be red, the second blue, the third green, etc. The order of the
visible visualization plots will correspond to the order of available signals
that are selected for visualization.
The message
values sent/received via ports within a coupled model can be visualized using
the graph (.gcm file) of the coupled model.
The visualization displays the output values with the corresponding
output ports, superimposed on the coupled model's graph.
The steps
required for visualizing the message values sent/received via the ports of a
coupled model are as follows:
1) In the Animate
menu, left-click on CoupledAnimate. A coupled animate dialog box will be
displayed.
Figure 218:Choosing coupled animate
2) Specify the
Log file that contains the messages sent/received by the coupled-DEVS model to
be visualized (using the same procedure as for AtomicAnimate).
1)
Left-click on
the browse button for the Coupled Model Definition. A Set dialog will be
displayed. Select the .gcm file that corresponds to the coupled-DEVS model to
be visualized. After choosing the appropriate .gcm file, left-click on
Set.
Figure 219: Set dialog box
4) Type in the appropriate Delay between displays. The Delay value (milliseconds) will be
the amount of time the visualization waits between each update of the display.
(The speed of the visualization is determined by the Delay value.) By default,
the Delay is 1000 milliseconds (or 1 second).
If an invalid file type is chosen, the (blank)
visualization window will be displayed as follows:
Figure 220: Blank view for invalid file type
The following example demonstrates the functionality of the Coupled Animate
visualization window, using the coupled model 4BitCounter.
To run this example, download the 4BitCounter project
from: http://www.angelfire.com/sc3/schao2/projects/4BitCounter.zip
4BitCounter is a coupled-DEVS model
composed of multiple atomic-DEVS models that each contain multiple output
signals.
In the Set and coupled animate dialogs,
open 4Counter.log and 4counter.gcm as the Log File and Coupled Model
Definition, respectively.
Figure 221: Opening the coupled model files
The coupled-DEVS model that sends/receives messages
within 4Counter.log, and that is represented in graphical form in 4counter.gcm,
will be available for visualization.
The following Coupled Animate visualization window
will be displayed.
Figure 222: Coupled model visualization for 4bitcounter
The Coupled Animate visualization window has several
commands for the visualization, such as:
-start
the visualization (1)
-stop the
visualization (2)
-pause
the visualization (3)
-go to
the next display of the visualization (4)
-set the
delay between displays (5)
1) Left-click the Start button. The visualization
will start and continue updating the graphical display, along with the
corresponding display time (according to the message times of the .log file).
In this example, the visualization has been started,
and has the current display time of 00:00:00:070, with the output values
visible alongside their corresponding ports.
Figure 223: Viewing the current display time and output values of units
2) After the
visualization has started, it can be run to the end of the simulation time,
stopped, or paused.
- After the
visualization has started, if no other buttons are pressed, the visualization
will continue until it reaches the end of the simulation (ie. the last message
time in the .log file).
In this example,
after pressing the Start button, if no other buttons are pressed, the
visualization will continue until it reaches 00:00:00:400, which is when the
simulation ends in the .log file.
- The Stop and
Pause buttons are described in the following sections.
1) Left-click the Stop button. The visualization will
stop at the current display time. The output values occurring at the current
display time will remain visible on the graph.
In this example, the visualization has been stopped
at the current display time of 00:00:00:260, with the output values visible
alongside their corresponding ports.
Figure 224: Stopped visualization
2) After the visualization has stopped, it can be
restarted (at the beginning of the simulation).
- After the visualization has stopped, if the Start
button is pressed, the visualization will restart only at the beginning of the
simulation, ie. at
- The Start button is described in the preceding
section.
1) Left-click the Pause button. The visualization
will pause at the current display time. The output values occurring at the
current display time will remain visible on the graph.
In this example, the Pause button is pressed after
the current display time of 00:00:00:380, pausing the visualization at
00:00:00:390, with the output values visible alongside their corresponding
ports.
Figure 225: Pausing the visualization
2) After the visualization has paused, it can be
restarted (at the current display time), stopped, or incremented to the next
display.
- After the visualization has paused, if the Start
button is pressed, the visualization will restart at the current display time.
- The Start and Stop buttons are described in the
preceding sections. The Next button is described in the following section.
1) Left-click the
Next button. The visualization will increment to the next display, updating the
current display time and the output values visible on the graph.
This example
continues from the second graph in the previous section - 'Pause the
visualization'. In this example, with the visualization paused at 00:00:00:390,
the Next button has been pressed. The visualization is incremented to the next
display at 00:00:00:400, updating the current display time and the output
values displayed on the graph.
Figure 226: Resumed visualization
2) After the visualization has incremented to the
next display, it can be restarted (at the current display time), stopped, or
incremented again to the next display.
- After the visualization has incremented to the next
display, if the Start button is pressed, the visualization will restart at the
current display time.
- The Start and Stop buttons are described in the preceding
sections. The Next button is described in this section.
1) Type the appropriate delay length (milliseconds)
in the Elapse field. Press Set.
The delay can be set while the
visualization is running (ie. after the visualization has been started), after
the visualization has been stopped, or while the visualization is paused (ie.
after the visualization has been paused).
The steps required for visualizing the cell values of
an atomic cellular model are as follows:
1) In the Animate menu, left-click on Cell-DEVS
animation.
Figure 227: Cell-DEVS animation menu
The following Cell-DEVS animation visualization
window will be displayed.
Figure 228: Cell-DEVS Animation window
2) A model must first be loaded before it can be
visualized. The loading of models will be described in upcoming sections.
3) The appearance of the visualization can be
modified before the visualization starts.
(The appearance of the visualization can also be modified while the
visualization is running.) The options
available for changing the appearance of the visualization will be described in
upcoming sections.
4) The individual steps/displays in the visualization
can be navigated to directly or indirectly. Navigating through the
visualization will be described in upcoming sections.
Thus, steps 2, 3, and 4 are the main steps for
visualizing an atomic Cell-DEVS model.
Each of the steps can be further broken down, as shown in the following
figure and list.
The Cell-DEVS animation visualization window has
functions that can be grouped according to the step in which the function is
involved. (See Figure
229)
-loading models to be visualized
-modifying the appearance of the visualization
-running/navigating the visualization
For each of the main steps, there are several
functions.
For loading models to be visualized, functions
include:
-adding
models to be made available (1)
-selecting
available models to be loaded (2)
-loading
models to be visualized (3)
For modifying the appearance of the visualization,
functions include:
-modifying
the palette of the loaded models (4)
-selecting
the lattice type (5)
-toggle
between 2D and multidimensional display (6)
-showing
the cell values of the loaded models (7)
-showing
the names of the loaded models (8)
-toggle
the visibility of the grid of the lattice (9)
For running/navigating the visualization, functions
include:
-playing/starting
the visualization (10)
-stopping
the visualizaton (11)
-pausing
the visualization (12)
-set the
delay between steps of the visualization (13)
-go to
the previous/next step in the visualization (14,
15)
-go directly
to a particular step in the visualization (16)
-go
directly to a particular time in the visualization (17)
Figure 229: Options for
cell DEVS animation.
The following example demonstrates the functionality
of the Cell-DEVS animation visualization window, using the atomic Cell-DEVS
model Fire. Additional examples for a 3D atomic Cell-DEVS model
(SatelliteClouds) and a coupled-DEVS model (RiceField) follow.
Cell-DEVS animation
Example of Atomic Cell-DEVS: Fire
To run this example, download the Fire project.
Fire is a 2D (two-dimensional) atomic
Cell-DEVS model.
A model must first be loaded before it can be
visualized.
To load a model, the appropriate model must first be
added to the Available list. From the Available list, the appropriate model(s)
to be visualized must be selected (ie. to the Selected list). Once the models
to be visualized are in the Selected list, the models can then be loaded. These functions are described in the following
sections.
1) To add an atomic cellular model to the Available
list, left-click the Add Model button. The Choose a CD++ DRW or Model File
dialog will be displayed.
Figure 230: Adding an atomic cellular model
2) Two options are available: (a) choose a .ma file
and a .log file, or (b) choose only a .drw file.
(a) Choose the appropriate .ma file, and left-click
the Open button.
The Choose a CD++ LOG File dialog will be displayed.
Choose the appropriate .log file (corresponding
to the .ma file), and left-click the Open button.
In this example, FireMA.ma is chosen in conjunction
with FireLOG.log.
Figure 231: opening the Fire model
(b) Choose the appropriate .drw file, and left-click
the Open button.
In this example, Fire.drw is chosen.
Figure 232: Choosing the appropriate drw file
3) The atomic cellular model name will appear in the
Available list. The format of the model name (displayed in the Available list)
depends on the option chosen:
(a) <componentName>@<modelLog.log>
where:
-
<componentName> is an atomic cellular model
listed included in the .ma file
(ie.
components : ) *
-
<modelLog.log> is the actual file name of
the .log file
In this example, the format of the model name will be
forestfire@FireLOG.log.
Figure 233: forestfire@FireLOG.log
(b) <modelDrw.drw>
where:
-
<modelDrw.drw> is the actual file name of
the .drw file **
In this example, the format of the model name will be
Fire.drw.
Figure 234: Fire.drw
* Note: (a) If the model in the .ma file contains
multiple atomic cellular models in the components: parameter, each of the
atomic cellular models will appear in the Available list. All of these atomic
cellular models will use the same .log file. (See the RiceField example for
more details.)
** Note: (b) Each .drw file corresponds to only one
atomic cellular model. (This differs from option (a), where a single .ma file
may contain multiple atomic cellular models.)
4) To remove an atomic cellular model from the
Available list, left-click on the model name in the Available list, and press
Delete on the keyboard.
1) To select an atomic cellular model (ie. to the
Selected list), left double-click on the model name in the Available list.
In this example, the model name (a)
forestfire@FireLOG.log, and (b) Fire.drw, are selected.
2) The atomic cellular model name will appear in the
Selected list. The format of the model name displayed in the Selected list will
be the same as in the Available list.
(a)
In this example, the format of the model name remains
as forestfire@FireLOG.log.
(b)
In this example, the format of the model name remains
as Fire.drw.
Figure 235: selecting forestfire@FireLOG.log Figure 236: Selecting Fire.drw
Once an atomic
cellular model is in the Selected list, the Load Model button will be enabled.
(If the Selected list is empty, ie. does not contain any atomic cellular
models, the Load Model button will be disabled.)
3) To remove an
atomic cellular model from the Selected list, double left-click on the model
name in the Selected list. Alternatively, left-click on the model name in the
Selected list, and press Delete on the keyboard.
Note: All atomic
cellular models in the Selected list will be loaded (and visualized)
concurrently when the Load Model button is pressed.
Note: After a
cellular model is selected from the Available list, the model will be placed in
the Selected list. If the model name in
the Available list is deleted, the model in the Selected list will not be
affected (ie. the model in the Selected list can still be loaded and visualized
as usual).
For the following
section, this example will be considered, where forestfire@FireLOG.log and
Fire.drw have been added to the Available list, and Fire.drw has been selected
(ie. to the Selected list).
Figure 237:Selecting an from an available list
1) To load the atomic cellular models in the Selected
list, left-click the Load Model button.
In this example, only Fire.drw is in the Selected
list, so only Fire.drw will be loaded.
Figure 238: Loading an atomic cellular model
Note: After
pressing the Load Model button, please wait until all selected models have been
loaded to the visualization cell display area. The number of models in the
Selected list corresponds to the number of models to be loaded and visualized.
In general, the waiting time required to load the models will increase with the
number of models in the Selected list.
2) The atomic
cellular models in the Selected list will be loaded into the visualization cell
display area.
In
this example, after Fire.drw is loaded, the cell values of the Fire model are
displayed, as seen below.
Figure 239:Displayed cell values for fire.drw
The size of the
Cell-DEVS animation visualization window can be changed to fit the dimensions
of the visualization cell display area.
Some of the
options for modifying the appearance of the visualization are automatically set
by default.
If
a palette (.pal) file exists with the same name as the first model in the
Selected list, then the .pal file will automatically be applied to the
visualization. In this example, Fire.pal is automatically used for the
visualization of Fire.drw. Also, by
default: a square lattice is selected; only two dimensions are shown; the cell
values are shown; the names of the loaded models are not shown; and the grid is
visible.
Modifications to
the appearance of the visualization will be described in the following
sections.
After the appropriate atomic cellular models have
been loaded, the appearance of the visualization can be modified before the
visualization starts. (The appearance of the visualization can also be modified
while the visualization is running.)
Several options are available for changing the appearance of the
visualization:
The
palette (or colour scheme) of the loaded model(s) can be modified.
The
lattice type can be selected as square, hexagonal, or triangular.
The
display of the loaded model(s) can be multi-dimensional or restricted to two
dimensions.
The cell
values of the loaded model(s) can be shown.
The names
of the loaded model(s) can be shown.
The grid
of the lattice can be removed/added.
These options are described in the following
sections.
A palette file contains preset colour settings for
the visualization of a model. Each setting contains a colour that corresponds
to a range of values. When a cell value falls within the range of values of a
setting, the colour of the setting will be applied to the cell.
1) Left-click the Modify Palette button. The Modify
Palette dialog will be displayed.
Figure 240: modifying the palette
For modifying the settings of the palette (.pal) file
used for the visualization, functions include:
-selecting
a colour (1)
-previewing
the selected colour (2)
-changing
the ranges for the current settings (3)
-adding a
setting (4)
-removing
a setting (5)
-setting
the colour of a setting (6)
-setting
the texture of a setting (7)
-selecting
the texture to be set (8)
-saving
the current settings in a .pal file (9)
-loading
settings from an existing .pal file (10)
-accepting
the current settings for the visualization (11)
-cancelling
the modify palette operation (12)
Select
and preview a colour
1) On the upper-right panel, left-click on one of the
three tabs: Swatches, HSB, RGB.
Figure 241: Previewing color
2) From one of the three tab panels, select a colour.
The selected colour will be displayed in the lower-right Preview panel.
Load settings from an existing .pal file
1) To load settings from an existing .pal file, first
left-click on the Load button. The Open dialog will be displayed.
Figure 242: Loading settings from an existing file
2) Choose the appropriate .pal file, and left-click
the Open button. The settings from the chosen .pal file will be displayed in
the left panel, in the table of current settings.
In this example, Fire.pal is chosen for the
visualization of Fire.drw. The settings range from -100 to 180.
Figure 243: Exisiting palette
Add a setting
1) To add a new setting to the table of current
settings, first left-click the Add button.
A new setting will appear at
the bottom of the table of current settings.
By default, the new setting has a range [0,0], with
white set as the colour corresponding to the range.
In this example, a new setting is added to the bottom
of the table of settings loaded from Fire.pal. Figure 244:Adding a new setting
Change the range of a setting
1) To change the range of values for a particular
setting, left-click on the From/To field.
2) Type in the appropriate value(s).
In this example, for the most recently added setting,
the From field has been changed to 180, while the To field is being changed to
200.
Figure
245: Changing the range of values
Set or change the colour of a setting
1) To set or change the colour of a particular
setting, first select the appropriate colour from one of the three right tab
panels. The selected colour will be placed in the Recent colours list.
In this example, the colour (204,255,255) is selected
from the Swatches tab, as seen in the figure below.
Figure 246: Setting or changing the color of a setting
2) Left-click on the particular setting.
3) Left-click on the Set color button.
The selected color will be displayed in the setting,
alongside the range of values.
In this example, for the most recently added setting,
the colour (204,255,255) has been set to correspond with the range [180,200].
Figure 247:Setting the color
Set the texture of a setting
1) To set the texture of a particular setting, first
left-click the browse button beside the Texture field.
The Open dialog will be displayed.
2) Select the file containing the appropriate
texture. Left-click Open. The selected file name will be displayed in the
Texture field.
3) Left-click on the particular setting.
4) Left-click the Set texture button.
The selected file name will be displayed in the
setting, alongside the range of values.
Remove a setting
1) To remove a particular setting from the table of
current settings, first left-click on the particular setting.
2) Left-click the Remove button.
The selected setting will be removed from the table
of current settings.
In this example, for the most recently added setting,
with range [180,200] and colour (204,255,255), was removed from the table of
current settings.
Figure 248: Removing a setting
Save the current settings in a .pal file
1) To save the current settings (displayed in the
table in the left panel) in a .pal file, first left-click the Save button. The
Save dialog will be displayed.
Figure 249: Saving the current settings in a .pal file
2) Specify the appropriate existing or new .pal file
name, and left-click the Save button. The current settings will be saved to the
specified .pal file. (The specified .pal file can be loaded using the same
procedure as any existing .pal file.)
The current (saved) settings will remain displayed in the left panel, in
the table of current settings.
In this example, the current settings will be saved
in FireAnimate.pal.
Accept the current settings for the visualization
1) To accept and apply the current settings
(displayed in the table in the left panel) to the visualization, left-click the
Accept button. The Modify Palette dialog will close, and the current settings
will be applied to the visualization of the loaded model(s).
In this example, the settings for FireAnimate.pal are
accepted and applied to the visualization of Fire.drw.
Cancel the modify palette operation
1) To cancel the modify palette operation, left-click
on the Cancel Button. The Modify Palette dialog will close, and no changes will
be applied to the visualization of the loaded model(s).
Three lattice types are available: Square,
Triangular, and Hexagonal.
By default, a Square lattice is selected.
1) Left-click the lattice drop-down list.
2) Select the appropriate lattice type, depending on
the lattice type of the loaded model(s).
For example, if Fire.drw is visualized with a
Triangle lattice type, the cells are displayed as follows.
If Fire.drw is visualized with a Hexagonal lattice
type, the cells are displayed as follows.
For this example, Fire.drw should be visualized with
a Square lattice type.
Note: If the selected lattice type does not match the
lattice type of the loaded model(s) (eg. if a hexagonal or triangular lattice
is used for a square-latticed model), the results will not be visualized as
intended.
- For visualization of 1D
or 2D models, this option is ignored.
- For visualization of 3D models, if Show 2D Only is
checked, only cells with the coordinates (x,y,0) are displayed (ie. only cells
in the first plane). If Show 2D Only is not checked, the cells in the planes
are displayed from left to right, with the sequence: (x,y,0), (x,y,1), (x,y,2),
etc.
- For visualization of multi-dimensional models, if
Show 2D Only is checked, only cells in the first plane are displayed, ie. cells
with coordinates (x,y,0,0,...,0). If Show 2D
Only is not checked, the cells in the planes are displayed from left to right,
with the sequence: (x,y,0,0,...,0), (x,y,1,0,...,0), ..., (x,y,D2,0,...,0),
(x,y,0,1,...,0), ..., (x,y,D2,D3,...,DN).
By default, Show 2D Only is checked.
1) To restrict the visualization of the loaded
model(s) to only two dimensions, check Show 2D only.
2) To show all the dimensions of the loaded model(s)
in the visualization, uncheck Show 2D Only.
In this example, Fire.drw represents a
two-dimensional model, so the Show 2D Only option is ignored. (See the example
for a 3D atomic Cell-DEVS model, SatelliteClouds, for more details about the
Show 2D Only option.)
By default, Show Values is checked.
1) To show the cell values of the loaded model(s) in
the visualization, check Show Values.
2) To remove the cell values of the loaded model(s)
in the visualization, uncheck Show Values.
In this example, if Show Values is unchecked for the
visualization of Fire.drw, the cells are displayed as follows:
For models of the form <componentName>@<modelLog.log> , this option is ignored.
This option is only available for models of the form <modelDrw.drw>.
By default, Show Names is not checked.
1) To show the names of the loaded model(s) in the
visualization, check Show Names.
2) To remove the names of the loaded model(s) in the
visualization, uncheck Show Names.
In this example, if Show Names is checked for the
visualization of Fire.drw, the name 'Fire.drw' is displayed in the upper-left
corner of the display, as follows:
Note: If Show Names is checked for a model of the
form <componentName>@<modelLog.log>, the name of the model will not
be displayed.
By default, the grid of the lattice is visible.
1) To remove the grid of the lattice from the
visualization, left-click Remove Grid. The Remove Grid button will be replaced
by the Add Grid button.
2) To add the grid of the lattice to the
visualization, left-click Add Grid. The Add Grid button will be replaced by the
Remove Grid button.
In this example, if Remove Grid is pressed, the
visualization for Fire.drw will be displayed as follows:
Once the appearance of the visualization has been
modified as desired, the visualization can be run/navigated. The individual
steps in the visualization can be navigated to directly or indirectly.
Navigating indirectly involves playing/starting,
stopping, and pausing the visualization.
Navigating directly includes going to the
previous/next step in the visualization, and going directly to a particular
step or time in the visualization.
Running the visualization also requires setting the
delay between the steps of the visualization.
These functions are described in the following
sections.
In general, the larger the delay value,
the longer the amount of time between each step during the visualization. By
default, the delay is set at 10. (units?)
1) Type the appropriate delay length in the Delay
field. Left-click Apply.
In this example, the delay has been set to 250.
The delay can be set while the visualization is
running (ie. after the visualization has been started), after the visualization
has been stopped, or while the visualization is paused (ie. after the
visualization has been paused).
1) To start the visualization, left-click the start
button. The visualization will start at the beginning of the simulation (ie.
the beginning of the .log file).
The graphical results will be updated and displayed
sequentially, along with the corresponding display step and time (according to
the message times of the .log file).
In this example, the visualization of Fire.drw has
been started, and has the current display time of 00:04:47:892 and current step
of 6, with the corresponding cell values visible in the display area.
Figure 250: Play/Start Visualization
** Note: While the visualization is running (ie. After
the visualization has been started), the following appearance options cannot be
changed: Modify Palette, Select lattice type, Show 2D Only, Remove/Add Grid.
Also, models cannot be added/loaded while the visualization is running.
Note: In general, to allow the visualization to update the cell
display area more quickly, uncheck Show Values.
2) After the
visualization has started, it can be run to the end of the simulation time,
stopped, or paused.
1)
After the
visualization has started, if no other buttons are pressed, the visualization
will continue until it reaches the end of the simulation (ie. The last message
time in the .log file).
Note: Once the
end of the simulation has been reached, in order to replay the visualization,
the stop button must be pressed.
In this example,
after pressing the Start button, if no other buttons are pressed, the
visualization will continue until it reaches 01:59:40:578 (ie. Step 386), which
is when the simulation ends in the .log file.
1)
The stop and
pause buttons are described in the following sections.
1)
To
stop the visualization, left-click the stop button. The visualization will stop
at the current display time.
The cell values occurring at the current
display time will not be visible; instead, the cell values occurring at the
beginning of the simulation will be visible.
In this example, the visualization of
Fire.drw is about to be stopped at the current step of 7 and current display
time of 00:05:22:995. The cell values visible in the display area correspond to
the current display time.
Figure
251: Visualization Stopped
In the following figure, the
visualization has been stopped. The display time and step, as well as the cell
values visible in the display area, correspond to the beginning of the
simulation (ie. at
Figure 252: Values displayed on stopped visualization
2)
After the visualization has stopped, it can be restarted (at the beginning of
the simulation).
-
After the visualization has stopped, if the start button is pressed, the
visualization will restart only at the beginning of the simulation, ie. at
- The start button is described in the
preceding section.
1) To pause the visualization, left-click
the pause button. The visualization will pause at the current display time. The
cell values occurring at the current display time will remain visible on the
graph.
In this example, the visualization of Fire.drw has been paused at the current step of 16 and current display time of 00:08:57:147. The cell values visible in the display area correspond to the current display time.
Figure 253: : Cell values corresponding to the current display
time
2) After the visualization has paused, it
can be restarted (at the current display time), stopped, or
decremented/incremented to the previous/next step.
- After the visualization has paused, if
the start button is pressed, the visualization will restart at the current
display time.
- The start and stop buttons are
described in the preceding sections.
- The previous and next step buttons are
described in the following sections.
This function is not valid while the
visualization is running.
1) To go directly to a particular time of
the visualization, type the particular time in the Time (current display time)
field. Ensure the format of the time corresponds to ##:##:##:### . Press
Enter (on the keyboard).
The visualization will display the
particular time, corresponding step, and corresponding cell values in the
display area.
Note: If a particular time does not occur
in the .log file, then the results (Time, step, and cell values) corresponding
to the next smaller time in the .log file will be displayed.
This function is not valid while the visualization is
running.
1) To go directly to a particular step of the
visualization, type the particular step number in the current step field. Press
Enter (on the keyboard).
The visualization will display the particular step,
corresponding time, and corresponding cell values in the display area.
In this example, step 25 of the Fire.drw
visualization has been accessed directly, with corresponding display time
00:11:22:860.
Figure 254: Going directly to particular step
Note: If a step number is larger than the current
step and larger than the largest step of the visualization, then the
results (Time, step, and cell values) corresponding to the current step will
remain displayed.
This function is not valid while the visualization is
running.
1) To go to the previous step in the visualization,
left-click the previous button.
The visualization will decrement to the previous
step, updating the display time (according to the .log file) and the cell
values in the display area.
This example continues from the previous section -
'Go directly to a particular step'. In this example, step 24 (the previous step
in the visualization of Fire.drw) has been accessed directly. The visualization
is decremented to the previous display time of 00:11:21:093.
Figure 255: Visualization at 00:11:21:093
Note: If the visualization has reached the smallest
step/time of the simulation, then the visualization will not decrement.
2) To go to the next step in the visualization,
left-click the next button.
The visualization will increment to the next step,
updating the display time (according to the .log file) and the cell values in
the display area.
This example continues from the previous section -
'Go directly to a particular step'. In this example, step 26 (the next step in
the visualization of Fire.drw) has been accessed directly. The visualization is
incremented to the next display time of 00:11:30:766.
Figure 256: Visualization at 00:11:30:766
Note: If the visualization has reached the largest
step/time of the simulation, then the visualization will not increment.
3) After the visualization has
decremented/incremented to the previous/next display, it can be restarted (at
the current display time), stopped, or decremented/incremented again to the
previous/next display.
- After the visualization has decremented/incremented
to the previous/next display, if the Start button is pressed, the visualization
will restart at the current display time.
- The Start and Stop buttons are described in the
preceding sections.
- The previous/next buttons are described in this
section.
To run this example, download the Fire and
SatelliteClouds projects.
Fire is a 2D (two-dimensional) atomic
Cell-DEVS model.
SatelliteClouds is a 3D
(three-dimensional) atomic Cell-DEVS model.
In this example, SatelliteClouds will be
used as a 2D atomic Cell-DEVS model.
(SatelliteClouds will be used as a 3D
model in the next Cell-DEVS animation example.)
The main functionality of the Cell-DEVS
animation visualization window described in the previous example (Fire) also
applies for this example. However, while the previous example (Fire)
illustrated the visualization of a single atomic Cell-DEVS model, this example
(Fire & SatelliteClouds) illustrates the visualization of multiple
(unrelated) atomic Cell-DEVS models.
The differences in the functions of the
Cell-DEVS animation visualization window when used for displaying multiple
atomic Cell-DEVS model will be described.
For
loading multiple models to be visualized:
-adding
models to the Available list
-selecting
multiple available models to be loaded
-loading
selected models to be visualized
For
running/navigating the visualization:
-play/start
the visualization
The multiple (unrelated) atomic models must first be
loaded before being visualized.
The appropriate atomic models must first be added to
the Available list. From the Available list, the models to be visualized must
be selected (ie. to the Selected list). Once the atomic models to be visualized
are in the Selected list, the models can then be loaded.
Using the same procedure as for the previous example
(Fire), add the appropriate models to the Available list.
For the following sections, this example will be
considered, where satelliteclouds.drw and Fire.drw have been added to the
Available list.
Figure 257: Adding models to available list
Using the same procedure as for the previous example
(Fire), from the Available list, select the models to be visualized.
Continuing this example, Fire.drw and
satelliteclouds.drw have been selected from the Available list (ie. to the
Selected list).
Figure 258:Selecting multiple available models
Note: When loaded, the order of the models in the
Selected list influences the appearance of the visualization.
Using the same procedure as for the previous example
(Fire), load the models in the Selected list.
In this example, Fire.drw and satelliteclouds.drw
will be loaded (and visualized) concurrently.
Reminder: Please wait until all selected models have
been loaded to the visualization cell display area. Since multiple models are
being loaded, the waiting time required to load the models will be greater than
if a single model was being loaded.
Figure 259: Loading models
The cell values of the Fire model and SatelliteClouds
model will be displayed in the visualization cell display area, as seen below.
Figure 260: Visualizing loaded models
Reminder: The size of the Cell-DEVS animation
visualization window can be increased/decreased to fit the multiple models in
the visualization cell display area.
When multiple atomic models are loaded and
visualized, the order of the models in the Selected list influences the
appearance of the visualization.
- By default, the order of the models in the
visualization cell display area corresponds to the order of the models in the
Selected list. The first model in the Selected list will be displayed at the
top of the cell display area. Each consecutive model in the Selected list will
be displayed consecutively below the previous model in the list. (Check Show
Names to display the names of the loaded models.)
- By default, if the first model in the Selected list
has a palette (.pal) file with the same name as the model (ie. .drw file), then
the .pal file will automatically be applied to all models in the visualization.
In this example, since Fire.drw is the first model in the Selected list,
Fire.pal is automatically used for the visualization of both Fire.drw and
satelliteclouds.drw. (Note: If the first model in the Selected list does not
have a .pal file of the same name, then the .pal file of the previously-loaded
visualization is used.) Thus, each
loaded model in the visualization must use the same .pal file (ie. the .pal
file of the first model in the Selected list).
From the previous figure, the order of the Selected
list is: Fire.drw, satelliteclouds.drw.
Since Fire.drw is first in the Selected list, by
default:
- Fire is located at the top of the cell display
area, while SatelliteClouds is located directly below.
- Fire.pal is used for both loaded models.
Conversely, consider when the Selected list order is
reversed: satelliteclouds.drw, Fire.drw.
Figure 261: Visualization with list order reversed
Since satelliteclouds.drw is first in the Selected
list, by default:
- SatelliteClouds is located at the top of the cell
display area, while Fire is located directly below.
- satelliteclouds.pal is used for both loaded models.
Once the appearance of the visualization has been
modified as desired, the visualization of the multiple models can be
run/navigated.
Using the same procedure as for the Fire example, the
visualization can be started.
The visualization will start at the earliest message
time (of the .log files) of all loaded models.
After the visualization has started, if no other
buttons are pressed, the visualization will continue until it reaches the last
message time (of the .log files) of all loaded models.
(ie. If the loaded models have different simulation
times, the visualization will continue until the end of the longer simulation
time.)
Also, if the loaded models have overlapping
simulation times (ie. occur during the same time range), the individual
visualizations of the loaded models will run concurrently.
If the loaded models do not have overlapping
simulation times, the model of shorter simulation time will remain visible in
the cell display area while the visualization of the model of longer simulation
time runs.
For the .drw files used in this example:
The simulation of the SatelliteClouds model starts at
The simulation of the Fire model starts at
00:01:11:973, and ends at 01:59:40:578.
If the SatelliteClouds model was visualized
individually, it would start at
Figure 262: Model displayed with .pal applied
If the Fire model was visualized individually, it would start at 00:01:11:973
(ie. step 1) and end at 01:59:40:578 (ie. step 386).
Figure 263: Fire model viewed individually
In this example with both the SatelliteClouds and
Fire models loaded, after pressing the Start button, if no other buttons are
pressed:
A)- The visualization will start with the
SatelliteClouds model, which will run starting at
Figure 264: Starting visualization of SatelliteClouds model
B)- Since the message times of the SatelliteClouds
and Fire models do not overlap, the visualization of SatelliteClouds will be
complete before the visualization of the Fire model starts. After the
SatelliteClouds visualization has completed (ie. after step 30), the cell
values occurring at step 30 will remain visible (in the SatelliteClouds cell
display area) until the end of the entire visualization.
Figure 265: Viewing cell values (step 30)
C)- The visualization of the Fire model will run,
starting at 00:01:11:973 (ie. step 31) until 01:59:40:578 (ie. step 416).
Figure 266: Visualization of fire model (step 31)
D)- The entire visualization will end upon reaching
the last message time (ie. at step 416) of the Fire model.
Figure 267: Visualization of Fire model (Step 416)
Cell-DEVS animation
Example of 3D Atomic Cell-DEVS: SatelliteClouds
To run this example, download the SatelliteClouds
project.
SatelliteClouds is a 3D
(three-dimensional) atomic Cell-DEVS model.
The main functionality of the Cell-DEVS
animation visualization window described in a previous example (Fire) also
applies for this example. However, instead of illustrating the visualization of
a 2D atomic Cell-DEVS model (as in Fire), this example (SatelliteClouds)
illustrates the visualization of a 3D atomic Cell-DEVS model.
The differences in the functions of the
Cell-DEVS animation visualization window when used for displaying a 3D atomic
Cell-DEVS model will be described:
For
modifying the appearance of the visualization:
-showing
multiple dimensions of the loaded models
- For visualization of 3D
models, if Show 2D Only is checked, only cells with the coordinates (x,y,0) are
displayed (ie. only cells in the first plane). If Show 2D Only is not checked,
the cells in the planes are displayed from left to right, with the sequence:
(x,y,0), (x,y,1), (x,y,2).
- For visualization of multi-dimensional models, if
Show 2D Only is checked, only cells in the first plane are displayed, ie. cells
with coordinates (x,y,0,0,...,0). If Show 2D
Only is not checked, the cells in the planes are displayed from left to right,
with the sequence: (x,y,0,0,...,0), (x,y,1,0,...,0), ..., (x,y,D2,0,...,0),
(x,y,0,1,...,0), ..., (x,y,D2,D3,...,DN).
By default, Show 2D Only is checked.
In this example, the 3D atomic model
SatelliteClouds is displayed as a 2D model when loaded. (In the accompanying
figure, the SatelliteClouds model is displayed with Show Values unchecked.)
Only plane (x,y,0) of SatelliteClouds is
visible in the cell display area.
Figure 268: 3D model displayed as 2D model
After unchecking Show 2D Only, SatelliteClouds is
displayed as a 3D model.
From left to right, the 3 planes of the
SatelliteClouds model are visible: (x,y,0), (x,y,1), (x,y,2).
Figure 269: Displayed as 3D Model
To run this
example, download the RiceField project.
RiceField is a
coupled-DEVS model composed of multiple atomic Cell-DEVS models.
The two component
atomic Cell-DEVS models of RiceField are: diffusion, field.
The
main functionality of the Cell-DEVS animation visualization window described in
a previous example (Fire & SatelliteClouds) also applies for this example.
However, instead of illustrating the visualization of multiple unrelated atomic
Cell-DEVS models (as in Fire & SatelliteClouds), this example (RiceField)
illustrates the visualization of multiple related atomic Cell-DEVS models.
The
differences in the functions of the Cell-DEVS animation visualization window
when used for displaying multiple related atomic Cell-DEVS model will be
described:
For loading multiple models to be
visualized:
-adding a coupled model to the
Available list
-loading selected models to be visualized
For modifying the appearance of the
visualization:
-modify the palette of the loaded
models: load settings from an existing .pal file
(Running/Navigating
the visualization will also be described.)
The components of a coupled model must first be
loaded before being visualized.
The appropriate coupled model must first be added to
the Available list. From the Available list, the component models to be
visualized must be selected (ie. to the Selected list). Once the component
models to be visualized are in the Selected list, the component models can then
be loaded.
To add a coupled models (consisting of multiple
atomic cellular models) to the Available list, the same procedure as for the
Fire & SatelliteClouds example is used.
As described in the Fire example, two options are
available: (a) choose a .ma file and a .log file, or (b) choose .drw files.
(a) Choosing a coupled model's .ma file (and corresponding
.log file) will add all the component models (of the coupled model, as
specified in the component: parameter of the .ma file) to the Available list.
All the component (ie. atomic cellular) models will use the same .log file.
Thus, all atomic cellular models of a coupled model
can be made available by specifying an .ma/.log file (corresponding to the
coupled model).
In this example, for the coupled model RiceField,
rice.ma is chosen in conjunction with rice.log.
Figure 270: Choosing the rice model
Since the RiceField model consists of two components
(ie. diffusion and field), both component models will appear in the Available
list with the same .log file.
Figure 271: rice.log appears in the list
(b) Choosing a
.drw file will add one component model (of the coupled model) to the Available
list. (ie. Each .drw file corresponds to one atomic cellular model.) When using
.drw files, each component's .drw file must be individually added to the Available
list.
Thus,
only one atomic cellular model can be made available my specifying a .drw file
(corresponding to one component of the coupled model).
In this example,
for the diffusion component of the RiceField model, rice-diffusion.drw is
chosen, and appears in the Available list.
Figure 272: Choosing the diffusion component of the rice model
Also, for the field component of the RiceField model,
rice-field.drw is chosen, and appears in the Available list after rice-diffusion.drw.
Figure 273: Choosing the field component of the rice model
For the following sections, this example will be
considered, where rice-diffusion.drw and rice-field.drw have been added to the
Available list.
The same procedure as for the Fire &
SatelliteClouds example can be used for selecting multiple available models to
be loaded.
Continuing this example, both rice-diffusion.drw and
rice-field.drw have been selected from the Available list (ie. to the Selected
list).
Reminder: When loaded, the order of the models in the
Selected list influences the appearance of the visualization.
Continuing this example, rice-diffusion.drw and
rice-field.drw will be loaded (and visualized) concurrently.
Reminder: Please wait until all selected models have
been loaded to the visualization cell display area. Since multiple models are
being loaded, the waiting time required to load the models will be greater than
if a single model was being loaded.
Figure 274:Loading files
The cell values of the selected component models (ie.
diffusion and field) of the RiceField model will be displayed in the
visualization cell display area, as seen below.
Figure 275: Cell Values displayed concurrently
Reminder: The size of the Cell-DEVS animation
visualization window can be increased/decreased to fit the multiple models in
the visualization cell display area.
Reminder: By default, if a palette (.pal) file exists
with the same name as the first model in the Selected list, then the .pal file
will automatically be applied to all models in the visualization.
From the previous figure, since rice-diffusion.drw is
first in the Selected list, rice-diffusion.pal would be used by default.
However, since rice-diffusion.pal does not exist, no palette is applied by
default.
Conversely, consider when the Selected list order is
reversed: rice-field.drw, rice-diffusion.drw.
Figure 276: Concurrent display with reversed list order
From the previous figure, since rice-field.drw is
first in the Selected list, field.pal would be used by default. So, field.pal
is applied to both the field and diffusion components in the visualization.
The appearance of the visualization for a coupled
model can be modified using standard procedures, as described in previous
examples.
For the RiceField model, the .pal corresponding to
the diffusion component is named ditch.pal.
Load settings from an existing .pal
file
Continuing with the example where the order of the
Selected list is: rice-diffusion.drw, rice-field.drw.
In the Modify Palette dialog, the settings from
ditch.pal can be loaded and accepted.
Figure 277: Modifying palettes of the loaded models
The settings of ditch.pal will be applied to both the
diffusion and field components in the visualization.
Figure 278: Settings applied to both loaded visualizations
Running/Navigating the visualization
The visualization of a coupled model can be
run/navigated using standard procedures, as described in previous examples.
Continuing with this example, using the palette (ie.
ditch.pal) for the diffusion component of the RiceField model, the cell display
area at the end of the visualization appears as follows:
Figure 279: Using ditch.pal for the diffusion component
With Show Values unchecked, Show Names checked, and
the Grid removed, the start and end of the visualization appear as follows:
Figure 280: Display for a specific set of options
Note: When trying to view the results for a
particular component of a coupled model, use the palette corresponding to the
component.
Consider when the palette (ie. field.pal) for the
field component of the RiceField coupled model is used. The cell display area
at the start and end of the visualization will appear as follows:
Figure 281: Cell display at start and end
With Show Values unchecked, Show Names checked, and
the Grid removed, the start and end of the visualization appear as follows:
Figure 282: Start and end of visualization with a specific set
of settings
ther tools (using the Execute menu commands)
This section describes the commands in the Execute
menu, which are used for simulating DEVS models. (These commands seem similar to the tools in
the CD++ Builder plugin for Eclipse.)
From the main menubar,
left-click on Execute. The following menu will be displayed. Select the
appropriate command, depending on the tool to be used for simulation.
Figure 283: Execute Menu
The following sections
describe the commands of the Execute menu for the newest stand-alone version of
CD++ Modeler (as of Dec.1/2004), not the version included in the CD++ Builder
plugin for Eclipse.
After selecting Local CDD
(ie. left-click Local CDD from the Execute menu), the Run Simulator window
appears:
Figure 284: The Run Simulator Window
To simulate the specified
Model File (using the specified Events File), press the Simulate button. The
results will be output to the specified Output File and Log File.
To stop the simulation of
the specified model at any time, press the Stop button.
To clear the dialog fields,
press the Reset button.
To close the Run Simulator
window, press the Close button.
For this example, the
SatelliteClouds model was simulated, with the dialog fields filled as follows:
Figure 285: Specifying existing files
Note: The simulation for the
SatelliteClouds model using Local CDD consumed more time than using the Simu!
command in the CD++ Builder plugin. It is recommended that Local CDD is not
used for simple models.
When the simulation of
SatelliteClouds was stopped (before the simulation had completed), the console
appeared as follows:
Figure 286:Console view after Simulation Stopped
Note: Local CDD appears to
be a tool for parallel simulation. When testing the SatelliteClouds model,
numerous log files (of the form *.log#, where # = {1,..., >100} ) were
generated.
(Please see Appendix D.)
Note: More
testing is required for this tool.
After selecting Remote CDD,
a Run Simulator window appears which is identical to the Run Simulator window
for Local CDD.
After selecting Text Editor,
the following window appears:
After this window is
resized:
Note: Text Editor appears to
be non-functional.
(Please see Appendix D.)
After selecting Drawlog, the
Run Drawlog window appears:
Figure 287: The Drawlog Window
To drawlog the chosen
Coupled Cell Name of the specified Model File, press the Run button. The
results will be output to the specified Log File and Output File (.drw).
To stop drawlog-ing the
specified model at any time, press the Stop button.
To clear the dialog fields,
press the Reset button.
To close the Run Drawlog
window, press the Close button.
For this example, the
SatelliteClouds model was drawlog-ed, with the dialog fields filled as follows:
Figure 288: Entering Parameters in the Drawlog window
During the drawlog of
SatelliteClouds, the console appeared as follows:
Figure 289: Console View While running Drawlog
When the drawlog of
SatelliteClouds had completed, the console appeared as follows:
Figure 290:Console view after process has finished
This was also how the
console appeared when the drawlog of SatelliteClouds was stopped before the drawlog
had completed.
(Please see Appendix D.)
The following are known bugs
found in CD++Modeler. Suggestions for fixing these bugs are included for each
bug.
Note: "Resource
panel" refers to the top lateral panel of the CD++ Modeler design space.
SCENARIO: Importing .cpp files.
CURRENT BEHAVIOUR: After
importing a .cpp file of an atomic model, the atomic model does not appear in
the Resource panel.
SUGGESTED BEHAVIOUR: After
importing a .cpp file of an atomic model, the atomic model could appear in the
Resource panel, in the Atomic folder.
CURRENT SOLUTION: Import the register.cpp file in which the atomic
model is registered. The atomic model
will appear in the Resource panel, in the Atomic folder.
ADDENDA: The current
solution also has some functionality issues...
SCENARIO: Adding ports to resource models (imported via
register.cpp).
CURRENT BEHAVIOUR: After
importing a register.cpp file, the atomic models (registered in the
register.cpp file) appear in the resource panel. After creating a unit of the atomic model,
ports cannot be added to the unit within the Modelling panel.
CURRENT SOLUTION: Before
creating a unit of the atomic model, right-click on the atomic model in the
Resource panel. In the popup menu, to
add a port to the atomic model, left-click Add Port, and type in the
appropriate parameters in the dialog box.
Once all ports have been added to the atomic model in the Resource
panel, a unit of the atomic model can be created. The newly-created unit does not require (and
does not allow) ports to be added.
SUGGESTION: The Resource
panel could also display the ports available for each imported model.
ADDENDA: Once ports
are added to a model, and units of the model are created, the ports of the
units must be linked...
SCENARIO: Linking ports between units of models.
CURRENT BEHAVIOUR: A port
cannot be accessed individually before a link is created involving the
port.
CURRENT SOLUTION: To create a
link between two ports, first create a link between the two units that contain
the ports. Right-click on the link. In the popup menu, left-click Properties. Select the ports of the two units that are to
be linked.
SCENARIO: Importing resources for an exploded model.
CURRENT BEHAVIOUR: After
exploding a new coupled model, there are no resources in the Resource
panel. The resources available in the
"parent" editor are not automically available for the exploded
model. The exploded model must import
all resources it requires.
SUGGESTED BEHAVIOUR: After
exploding a new coupled model, the resources available in the
"parent" editor could be automically made available for the exploded
model. So, the exploded model will not
need to re-import the resources that the "parent" editor uses.
SCENARIO: CD++ Modeler frozen after period of time not
in use.
AtomicAnimate: Suggestions & Bugs
UNKNOWN: units of
values in From/To fields
ADDENDA: For the
FunctionEval example only, the units for the From/To fields appear to
correspond to milliseconds (since FunctionEval is a single atomic model, whose
.log file messages occur at millisecond intervals).
SCENARIO: Showing the
values of the output signal on the plot.
CURRENT BEHAVIOUR: For a given time interval, the Values checkbox is
unchecked. The values are no longer visible on the plot. After the
Previous/Next/Jump button is pressed (ie. the interval is changed), the Values
checkbox is still unchecked. However, the values are visible on the plot of the
current interval. When the Values checkbox is re-checked, the values are no
longer visible on the plot of the current interval.
SUGGESTED BEHAVIOUR: For a given time interval, the Values checkbox is
unchecked. The values are no longer visible on the plot. After the
Previous/Next/Jump button is pressed (ie. the interval is changed), the Values
checkbox is still unchecked. The values should not be visible on the plot of
the current interval. When the Values checkbox is re-checked, the values should
become visible on the plot of the current interval.
INITIAL BEHAVIOUR (DEFAULT)
-----------------------------------------------
- The available signals for the first
component in the drop-down list will be displayed.
* Note: 'interval'
refers to the values in the From and To fields.
'time'
refers to an absolute value of time.
'instance'
refers to a step in the simulation.
- For example, from the 4BitCounter
example:
the
start time =
the
end time = 00:00:00:400 the
end instance = 662
- If the number of steps in the
visualization is less than 1000:
-
the From field will contain the start instance/step (corresponding to the first
message time in the simulation's .log
file, usually 0);
-
the To field will contain the end instance/step (corresponding to the last
message time in the simulation's
.log file).
-
The initial interval spans the entire simulation. For example, from the
4BitCounter example, the initial
interval is [0,662].
- If the number of steps in the
visualization is greater than 1000:
-
the From field will contain the start instance/step (corresponding to the first
message time in the simulation's .log
file, usually 0);
-
the To field will contain the value 1000.
-
This indicates an initial interval of [0,1000].
-----------------------------------------------
Note: The refresh button refreshes the
display of the plots in the visualization window.
SCENARIO: Available output signals (for
particular component) exceed space in left column.
CURRENT BEHAVIOUR: For example, for an interval spanning
the entire simulation, after selecting the top component from the drop-down
list, the fields (for setting the vertical scale) below the signal names are
not entirely visible. There is not enough space in the left column to display
the fields, and so it is not possible to set the vertical scales.
SUGGESTION 1: Horizontal scrollbar for left column.
Would increase visibility of signal names and fields in left column. Could
reduce the need to continually resize the visualization window.
SUGGESTION 2: Instead of displaying Set button and
fields (for setting the vertical scale), could have a pop-up menu that appears
when the signal name is right-clicked. In the pop-up menu, could have a 'Set
vertical scale' command, in which a 'Set vertical scale' dialog (with a Set
button and fields) could appear. The pop-up menu could also have other
commands. Would reduce amount of space required for displaying signal names in
left column.
SCENARIO: After changing interval,
selected component not in drop-down list.
Refer to:
AtomicAnimate
Example of Coupled-DEVS: 4BitCounter >
Availability of signals for the selected
model/component
CURRENT BEHAVIOUR: For a given interval, a particular
component is selected. If the interval is changed, and the currently selected
component does not have any available signals for the current interval, the
component will remain selected (even though it is not in the drop-down list).
The available signals displayed will correspond to the first component in the
drop-down list, not the currently selected component. (Also, if another
component is selected from the drop-down list, then it is not possible to
re-select the originally selected component, until the interval is changed - in
which the originally selected component has signals available.)
SUGGESTION: Visually indicate that the currently
selected component does not have any available signals.
SUGGESTION 1: Do not display any signals, since none
are available for the currently selected component.
SUGGESTION 2: Change the colour or disable the
currently selected component.
SUGGESTION 3: As part of the visualization window,
display a list of all components/models and their signals, ie. in a tree
structure where left-clicking on a component name will expand a branch for
corresponding signal names. For a given time interval, if a component has
signals that are available, highlight/emphasize the component(s) and
corresponding signal names. Could also have a pop-up menu when a signal name is
right-clicked. In the pop-up menu, could have option for setting the colour of
the signal's plot (and display a small colour box beside the signal name to
indicate what colour is currently set for the signal's plot).
ADDENDA: Would help to clarify which signals correspond to which
components.
SCENARIO: Colours of available signals.
CURRENT BEHAVIOUR: Colours of available signals
automatically assigned based on order of signals in left column.
SUGGESTION: Allow user to associate particular colour
with particular signal of particular component.
SCENARIO: Display of available signals
for single component.
CURRENT BEHAVIOUR: The available signals of only one
component can be displayed in the visualization window.
SUGGESTION: Allow available signals of multiple
component to be displayed in the visualization window.
BUG SCENARIO: In the initial interval
spanning the entire simulation, the out signal is unchecked.
So for any interval of the visualization,
the plot of the out signal should not be displayed (until the out signal is
rechecked).
CURRENT BEHAVIOUR: For any interval, since only the in
signal is checked, only the plot of the in signal can be displayed.
- However, in some intervals, where (1)
only the out signal is available, (2) the out signal is appropriately in the
left column, but (3) the
out signal is checked and displayed:
THIS IS A BUG!
THIS IS A BUG!
SUGGESTED BEHAVIOUR: The out signal should not be checked, and should not be
displayed.
- In other intervals, where
(1) both the in signal and out signals are available, (2) both signals are
appropriately in the left column, and (3) the in signal is properly displayed
and the out signal is properly unchecked:
THIS BEHAVIOUR IS CORRECT.
- In other intervals, where (1) only the
in signal is available (and the out signal is unavailable), (2) the in signal
is appropriately in the left column (and the out signal is appropriately not in
the left column), and (3) the in signal is properly displayed:
THIS BEHAVIOUR IS CORRECT.
Cell-DEVS animation: Suggestions & Bugs
UNKNOWN: functionality
of horizontal scrollbar
UNKNOWN: units of
value in Delay field
ADDENDA: assume units of milliseconds, but not verified
during testing
Note 1: When adding a coupled model using
an .ma file and a .log file, all cellular components of the coupled model will
be added to the Available list.
Note 2: When adding a model using a .drw
file, only the model specific to the .drw file (ie. one specific model/component)
is added to the Available list.
SCENARIO: Organization
of visualization window commands.
SUGGESTION: Organize components of visualization
window according to command type, ie. for (1)loading model, (2) modifying
appearance of visualization, (3) running/navigating visualization.
SCENARIO: Single palette file applied.
CURRENT BEHAVIOUR: Each loaded model (in the Selected
list) uses the same .pal file.
SUGGESTION: Allow each loaded model (in the
Selected list) to use different .pal files
SCENARIO: Loading both time-supported
('regular' .drw files, with border) and non-time-supported (.drw files created
using the -f option in Drawlog) models.
Refer to the excerpt (on the following
page) from the original manual.
CURRENT BEHAVIOUR: If both time-supported and
non-time-supported models are in the Selected List when the Load Model button
is pressed, an error dialog will appear.
- The display sequence of
selected models is in the order of their names in selected list. At any time
after you have made changes to the selected list, press load model button to
re-display the new selected models. In case of the selected list is empty, the
load model button is automatically disabled.
- When all selected models
have been loaded, CDModeler tries to load PAL file according to the name of the
first entry in selected list as following. If such pal file does not exist or
values are not defined in PAL file, CDModel now use white (previous use BLACK)
as default.
Model name |
Searched PAL file |
<modelname> |
<modelname>.pal |
<modelname>@<log_filename> |
<log_filename>.pal |
- Currently, CDModeler does
not allow loading both time-unsupported and time-supported models at same time.
An error message is generated when that happens.
Model Type |
Model Generated from |
Time-unsupported model |
Drawlog with –f argument |
Time-supported model |
Drawlog without –f
argument |
Load directly from log
file |
4. Multiple Models from
DRW Files and Log Files
- This can be used to
validate the newly-added functionality.
Step 1. Load
segment1a.drw file.
Step 2. Load
traffic.ma, traffic.log files.
Step 4. Choose
segement1a, crossing1a, segment1a@traffic and crossing1a@traffic models by
double-clicking on them. Load the models by clicking on the Load Model button.
Figure 291.
Traffic Models: from DRW and LOG Files
- Here, we can clearly see
the bug of drawlog program: at this time, the (0,0) cell of both segment1a and
crossing1a models send value 2 and 1 out through in_space port, but these
values are considered as value of (0, 0) cells. The lower two models loaded
from log file are displayed correctly.
Notes:
- Appears to be a tool for
parallel simulation.
- Takes up a lot of
processing time (ie. can't use other running applications while waiting for
Local CDD simulation to finish).
- Not recommended for simple
models.
- Can't copy from console.
Notes:
- Non-functional, empty
dialog.
- No menus/commands.
- Cannot input/edit text.
FIX: spelling in
console output messages
SCENARIO: Console
output for stopping drawlog prior to completion is the same as console output
for drawlog completed in entirety.
CURRENT BEHAVIOUR:
(1) After the Run button is
pressed, when the drawlog of a model is complete, the console outputs the
messages: > Writing output to file.
> Process Finished. > Writing output to file finished.
(2) If, after the Run button
is pressed, before the drawlog of the model is complete, the Stop button is
pressed, the console will output the same messages as (1).
SUGGESTION: For case (2), different messages should be output,
indicating the drawlog was stopped by the user prior to completion. The same
messages should not be output for both (1) and (2).
SCENARIO:
"Invalid parameter" warning generated in resulting .drw file.
CURRENT BEHAVIOUR: After the drawlog of SatelliteClouds was complete,
in the generated CDMEx-satelliteclouds.drw file, there is a warning at the top
of the file:
Warning... invalid
parameter >CDMEx-satelliteclouds.drw!
When the name specified for
the Output File (.drw) was changed to satellitecloudsDRW.drw, the warning was
still generated:
Warning... invalid
parameter >satellitecloudsDRW.drw!
ADDENDA: Not sure what format the name of the Output File
(.drw) should take so that a warning is not generated.
SCENARIO: Results in
.drw file end prematurely.
CURRENT BEHAVIOUR: In the CDMEx-satelliteclouds.drw file (as well as
the satellitecloudsDRW.drw file), the results at end the beginning of
SUGGESTED BEHAVIOUR: The results should
end after
[MSOffice1]JDK 1.5.0
[MSOffice2]JDK 1.5.0
[MSOffice3]JDK 1.5.0
[MSOffice4]Can be omitted
How to get the [MSOffice5]far-left picture?
[MSOffice6]In my case it is displayed as “top”
[MSOffice7]In my case it is displayed as “top1”
[MSOffice8]“top1”
[MSOffice9]for “Log File” field
[MSOffice10]or the file is blank!