This is a
DRAFT user manual for the new facilities of CD++Builder. For comments or errors
found, send an email to email@example.com
and we will update the manual with the necessary changes.
If you have trouble using CD + + Builder 2.0, check the bug tracker if you have resolved the problem or to load new faults. Bug
Table of Contents
a Project in Eclipse. 1
Coupled models. 4
a port. 7
internal coupled models. 9
internal coupled models. 9
atomic models (Built-in). 11
the simulation. 16
an animation. 17
an atomic model using DEVS Graphs. 18
a port. 20
External Transitions. 22
Internal transitions. 24
the simulation. 26
an animation. 27
an atomic model using C++ (CPP files). 27
the sample projects. 28
Go to File | New | Project ...
In the category DEVS choose CD++ Builder Project Wizard and
4. Insert the author's name and a name for the project (in these
examples, we will use TestingProject)
5. Click on Finish.
This generates an Eclipse project that will be available in the
Project Explorer panel.
The following example (found in
the distribution of CD++Builder) shows how to define a queuing model that
transmits the values stored in a queue. The values in the queue are transmitted
1 time per second.
Right click on the project TestProject , new | Other to
open the wizard (also from File | New | Other)
In the category DEVS, choose DEVS Coupled Model Diagram and
Give it a model name and click Finish (in our case we will
The result of this step is an empty coupled model ready to be
5. Editor areas:
Some General Tips:
Using Ctrl + mouse scroll wheel you can zoom in / out.
Also, using the buttons on the Palette of Modeling
In the Properties tab, one can be make visible any object by right
clicking on it, and selecting Properties
You can choose the preferred code editor view with the flaps found
below the Editor window
We will define 2 ports: 1 input and one output
Click on the icon palette Input Port and click anywhere on the editor (you get a “+ at the arrow).
You will get a square representing the port. To give a name to the
port, type the name (in this case, we put In). You can also change the name from the Properties tab
Repeat steps 1 and 2, but using the icon Output Port and
put the name Out.
All items can be moved to either side of the editor, selecting and
dragging them. For instance, we can move the port In to the left, and
the port Out to the right.
Save the file.
NOTE: you can save your file using ctrl +
S, using the Eclipse Save button or the menu File | Save
In order to verify the
contents, you can select the .ma
option in the editor tabs (in this case, choose AutomaticQueue.ma to see the text definition of the model)
Select the icon palette Coupled Model , and click on the Editor panel.
This will create an empty Coupled Model. We will name it QueueContainer
To edit the model QueueContainer, double click on the figure.
This opens a new editor (similar to one discussed above)
In the contained model (with a similar name as the parent coupled
model) model we will add 3 ports as shown below: 2 input (In and Done)
and 1 Output (Out; remember to change the port types in the properties
Save everything from the main model (automaticQueue.ma) and
verify that it was written well (reading the corresponding textual .ma file).
NOTE: the tab to read of .ma files is only available on the coupled models (internal models
do not have their own files, but they are a part of a higher level .ma file).
Note that the ports in the main model are displayed automatically.
If you change the ports of the content model, changes are kept (including
4. Go to the model editor QueueContainer, choose from the
palette Queue and click on the Editor pane. This will define a new atomic model
of type Queue.
NOTE: The models shown as Built-in are registered in register.cpp
(in this case, the internal version of register.cpp). If you change the
register.cpp, the models changed will be displayed there. The ports and
parameters are read from the .cpp files that define the models.
Do the same, but in the model TOPadding a Generator
We must define the parameters for models GeneratorInstance and QueueInstance, which can be
done using the Properties tab. For the generator will use the
For the queue:
Save, using the button .
All you would need now is to link the ports.
1. Select the icon palette Link
2. Click and hold on the source port
or release the button on the destination port. (Note that the cursor changes
from warning status according to the link’s – i.e., if it is valid or not -).
a. Define the following links in the top model:
From In to ln@QueueContainer
From out@QueueContainer to Out
b. Define the following links in the model QueueContainer:
From In to ln@QueueInstance
From Done to Donate@QueueInstance
From Out@QueueInstance to Out
3. Save the changes.
To run the simulation is needed to file events.
1. Defining a automaticQueue.ev within the project (File |
New | File)
2. Copy this code:
00:00:00:00 in 1
00:00:00:01 in 2
00:00:00:01 in 3
00:00:00:01 in 4
00:00:00:01 in 5
00:00:00:01 in 6
00:00:00:01 in 8
00:00:00:01 in 9
00:00:00:01 in 10
00:00:00:01 in 11
00:00:00:01 in 12