Chapter 2
ViSiDiA functionalities

2.1 Graphical User Interface

2.1.1 Global view

When ViSiDiA starts, the main window appears (figure 2.1). The Graphical User Interface (GUI) consists in four parts:

 
The contents of toolbars change depending on ViSiDiA running mode. Either you are editing a graph, or you are visualizing a simulation. So you have access either to edition or to simulation functionalities. And you always have access to view functionalities.


PIC

Figure 2.1: ViSiDiA main window

2.1.2 Left menu and top toolbar

Toolbar management

Toolbar position cannot be changed in ViSiDiA window. However, toolbars can be detached (floated) or attached (docked) to the window. To detach a toolbar from the window, just drag it outsine the window. To attach a toolbar, use the close button in the floating toolabr window.

Edition

You can create an empty new graph, load a graph from a file or save a graph to a file. Graph files are in GML format. When loading a graph, the file selection dialog contains a checkbox to display or hide the selected graph (default is to display the graph).
You can undo/redo graph operations: vertex/edge creation, suppression, movement, merge.
From the edition menu, you can remove or duplicate selected items, complete the graph or select all elements. If using sensors, you can randomly place sensors on support graph.

Simulation

From the simulation menu, you can specify the number of simulations (see section 2.6.3). You can either define rewriting rules or select an algorithm/agent from a file. If using agents, you can randomly place some agent one the graph.
From the simulation toolbar, you can start/pause/stop the simulation, and adjust its speed.

View

In the view menu and toolbar, you can display graph properties (general information, or information about selection). If a single graph element (vertex or edge) is selected (either in edition or simulation tabs), you can manage its properties (set, add, remove), such as label, weight, orientation, and so on.
Zoom functionalities are also available.
The menu contains a checkbox to display or hide the current graph. If the graph is hidden, the graph panel displays some graph properties in edition mode.

ViSiDiA menu

From the ViSiDiA menu, you can adjust preferences, replay a previously recorded simulation (see section 2.6.4) and quit the application.

2.1.3 Graph panel

In the edition tab, left click to add a new vertex. Drag with left button pressed to add an edge.
Right click on vertices and edges to select/unselect them. Drag with right button pressed to select all items in a rectangular area.
Drag with middle button pressed to move graph elements. If first click in on a selected element, all selected elements move. If first click is on an unselected vertex, this vertex moves. If first is not on a graph element, the whole graph will move. Note that moving a vertex implies moving its incident edges.
If you move a vertex on another vertex, the vertices will be merged, and their incident edges are recomputed.
You can remove selected items with either DELETE or BACKSPACE key.

In a simulation tab, you can right click on vertices and edges to select/unselect them.

2.1.4 Secondary toolbar

The secondary toolbar in edition tab lets you both define the simulation mode and create a new simulation tab.
There are eight simulation modes, based on a combination of three choices:

 
When you have created a graph, select the simulation mode and click the "New simulation" button. If you use fixed processes, a new simulation tab appears.

For the particular case of mobile processes (sensors), you must first define a support graph for sensors and click the "Set support graph" button to validate, then place sensors on this support graph, and finally click the "New simulation" button. If you click the "Set support graph" without defining a graph, ViSiDiA suggests using a regular grid as a support graph.

2.2 Message passing simulation

2.2.1 Run the simulation

Suppose a graph as illustrated in figure 2.2, and start a new message-passing simulation with fixed processes and local network.


PIC

Figure 2.2: A graph created with ViSiDiA

From the "Simulation" menu, select an algorithm using the proposed file dialog. An algorithm is a compiled Java class. The file dialog contains a short description of each algorithm (figure 2.3). Open the "Spanning_Tree_RDV" algorithm. The algorithm will be copied to each vertex.


PIC

Figure 2.3: Algorithm selection

Right-click on a vertex to select it. Click the "Graph properties" button in view toolbar or menu. Change the vertex label to "A". Start the simulation (figure 2.4). On the left side of the window, you can choose the kind of messages to be displayed.


PIC

Figure 2.4: Message-passing simulation

2.2.2 View statistics

Click the "Statistics" button in the left side of simulation window to visualize the number of sent messages.
The number of messages is displayed for each simulation (figure 2.5), in case of multiple (repeated) simulation (see section 2.6.3). Note that if the selected algorithm has no termination detection, statistics will be useless since the number of messages will grow up indefinitely. In the previous example, the "Spanning_Tree_RDV" algorithm has no termination detection. An appropriate algorithm is "Spanning_Tree_ID_With_Termination".


PIC

Figure 2.5: Statistics in message passing simulation

2.3 Mobile agent simulation

Suppose the same graph as illustrated in figure 2.2, and start a new mobile agent simulation with fixed processes and local network.
Select one or more vertices. From the "Simulation" menu, select an agent using the proposed file dialog. An agent is a compiled Java class.
Repeat for other agents or vertices in the same graph if needed, then start the simulation (figure 2.6).


PIC

Figure 2.6: Mobile agent simulation

Using the buttons on the bottom-left side while the simulation is running, you can:

You can display statistics about the mobile agent simulaiton, using the "Statistics" button in the left side of simulation window.


PIC

Figure 2.7: Statistics in mobile agent simulation

2.4 Mobile sensors

Message-passing and mobile agent simulation is available using mobile processes (sensors). First define a support graph (either loading an existing graph or using a regular grid), then place sensors on this support graph (figure 2.8).


PIC

Figure 2.8: Sensors are placed on a support graph (here a regular grid)

Select an algorithm or agents as described in the previous sections, then start the simulation. The sensors start moving. If two sensors are close enough, they are linked by an edge and can exchange messages or agents (figure 2.9). The sensor communication distance can be set in the ViSiDiA/Preferences menu.


PIC

Figure 2.9: Message passing simulation using sensors

2.5 Rewriting rules

Rewriting rules can be defined thanks to the graphical interface, enabling the user to draw an algorithm only with the mouse. Rules execution can be visualized with agents or message passing. This depends on the simulation mode you chose in the graph editor.

A dialog appears when clicking the command Define rewriting rules in the Simulation menu.
From this dialog, you can create a new set of rules, or load a previously saved rewriting rule system.
To create a new set of rules:


PIC

Figure 2.10: Example of rewriting rules

On figure 2.10, one of the three rules used to create a spanning tree with termination detection is presented. This rule means :

If u is a node of label "A" with a neighbor of label "A" with a marked edge between them, and u has no neighbor of label "N" with an unmarked edge ("Context 1"), then u can take the label "F". In fact, there is another forbidden context hidden under the "Context 2" tab.

2.6 Specific settings

2.6.1 Preferences

From Visidia menu, you can adjust preferences relative to graph (figure 2.11), colorpalette (figure 2.12) or sensors (figure 2.13).


PIC

Figure 2.11: Adjusting graph preferences


PIC

Figure 2.12: Adjusting color palette preferences


PIC

Figure 2.13: Adjusting sensor preferences

2.6.2 Set properties

Vertices, edges and agents have specific properties, such as labels, weights, etc. You can adjust these predefined properties and add new ones by selecting one item (vertex, egde or agent) then clicking the Info button in top toolbar. Different types of properties are available : Boolean, String, Double, Integer. Each new property can be displayable, which means that it can be visualized on the graph.
 
Figure 2.14 gives an example of setting an edge properties. Three properties are specific to edges and cannot be removed (oriented, label, weight). The user has added two other properties (comment, nbTransfers) which are both displayable, but only nbTransfers is displayed on the graph.


PIC

Figure 2.14: Setting properties of an edge

2.6.3 Repat simulations

You can decide to run a same simulation several times in a raw. You must specify the number of simulations from the corresponding entry in Simulation menu before clicking the Start button for the first time.


PIC

Figure 2.15: Setting the number of simulations

2.6.4 Recording a simulation

You can save a simulation to a file in order to replay it at a later time. You must click the Record button in left toolbar to choose a record file before clicking the Start button for the first time.

2.7 Remote network

To be written.