2. First Steps

Basic Elements of the VS-pCoq Spy? – These are definitely points and lines, as you are using in any drawing program. Without lines, the VS-pCoq Spy wouldn't have any idea what to simulate. Therefore the lines are the basic elements – and of course the points, because every line needs two delimiting points. All lines connect points, either for enabling vehicles to drive on them or for transmitting a message. The points themselves can show various useful behaviors during a simulation run.

2.1 Lines and Points

You may draw a single point on the drawing area: choose the item "Points" from the "Drawing"-Pulldown menu, watch your mouse becoming a hair cross, and click somewhere on the drawing area. A point will appear as a neat gray circle. Should you move the mouse before releasing the left button, the newly generated element follows you around on the drawing area. This is possible for all newly generated elements.

A lonely point on the drawing area is not useful at all.

Therefore you can choose out of four different types of lines for giving its adjacent points a reason for existence:

plain lines,
streets,
message ways and
control paths.

Two lines may share one common point and, depending on the type of the lines, a point can be shared by more than two lines: that's the way to connect lines, and the lines will remain connected when you move the shared point around.

For drawing a line, select the appropriate item in the "Drawing"-Pulldown menu. The mouse cursor turns again into a cross shape, and when you click somewhere on the drawing area, a point will appear with a line of the chosen type connected to it. This is the starting point of the line. If you had clicked on an existing point (and this point were allowed to share its connected lines with your new line), this point would have been used as starting point of your line instead of the new point. The mouse cursor became connected to the end of the new line, not showing a point yet. You should look and click for the position of an ending point now, which again might exist already.

You will discover, after having clicked an ending point to the line, that the mouse will be connected to the ending point of another line, whose starting point is the point you just clicked on. If you want to stop drawing the contiguous line, double-click the last point or hit Escape or Delete or choose the appropriate item "stop" from the right-button Popup menu (click the right mouse button first and then select the Popup menu item with the left mouse button).

Points, shared by multiple lines, change their shape (and sometimes also their color) according to their feelings in between the lines:

lonely circle: only one line uses the point, or even no line at all;
holding hands square: two lines share the point;
important dot (filled circle): three lines share the point;
stressed box (filled square): more than three lines share the point.

2.1.1 Plain Lines

Plain lines (we call them just "lines") are purely graphic lines. You can connect them among each other however you want, there aren't any restrictions about this, unless you try to connect them to a line of another type or to a point of any simulation-relevant element. This is forbidden. Plain lines appear plain white on the drawing area, and the delimiting points, too.

2.1.2 Streets

We need streets for our vehicles to drive around on them. As a main point of difference to plain lines, streets are directed: they are vectors (though you can configure a street as bi-directional, if you want to). In one single point, you can connect at most three streets, and the point shared by three lines can become a bifurcationBifurcations. Streets can be connected to all points except for points used by plain lines and except for pink points. A street is shown as a plain line in gray, and so are the delimiting points. If the street is directed, a small arrow in the middle of the street points towards the end of the street.

If a point has the function of a bifurcation, it proudly changes to yellow color and indicates the actual position of the switch by coloring the route also yellow. Bifurcations will be explained later in more detail.

2.1.3 Message Ways

We need some elements for sending messages around in the simulated system (as there are detector signals or traffic light commands). Commands are broadcast with no time delay on message ways. Like streets, also message ways are directed.

Message ways are also shown as gray lines, but the line is dotted and not plain like streets. You may connect as many message ways in one point as you like to. You can also connect a message way to a point shared by streets, or even already shared by another message way with the streets. Points, used by at least one message way, turn blue to indicate this fact to you.

There are pink points, too, but you cannot generate them through message ways. Pink points are always generated by simulation-relevant elements (as you will see when we will come to more complex elements), and they are restricted to the use by message ways only.

2.1.4 Control Paths

Maybe it is a bit early to talk about control paths now, but in brief: a control path can force a message to propagate backwards through it because its justification to pass the ending point of the control path has to be checked. This element is only to be used for giving a controller its needed power. A control path is dotted in yellow and red. Its graphical behavior on the drawing area is exactly like the behavior of an ordinary message way.

2.2 Buttons (I)

Let's take a short break: we would like to simulate now something on the drawing area. Buttons are a bit complicated elements, so let's simply introduce the fact of the existence of buttons here. Prepare a simple simulation by defining a contiguous street (with intermediate points, if you like). Define now a button somewhere on the drawing area (hope you know by now how to select it in the "Drawing"-Pulldown menu). A button is a gray square, and on one corner there is a pink round point. (You see? – Here we find the first pink point!) Connect the pink point by a message way to the beginning of the street. In this way, the ending point of the message way becomes a traffic source point, generating cars according to your mouse inputs on the button. This is how your drawing area should now look like:

Steps, model 1

Steps, model 1

Shall we try a simulation run? Ok, let's go for it!

2.2.1 The First Cars Appear!

Look for the gray radio-button with a red square in the middle at the right side of the menu bar (at the left of the words "simulating default"). Press this radio-button, and the simulation starts. This will be indicated through both, the shape of the mouse, which is now a little dot, and a green lamp inside the simulation button. Please click now on the button on the drawing area you defined just before, and see: where the message way meets the street, each time you click the button, there is a little dot generated, which moves forward on the street until it falls out of the system at the sink.

Switch the simulation off again by pushing the radio-button. Back to work!

2.3 Modifying a Single Element

Now that you have drawn some elements, try to modify them. Ok, this section will be a bit boring after a while, but try beating it up to the section "Moving". Then you might jump forward to "Models and Files". But make sure to read the left out parts later!

As the cursor still has a hair-cross shape, every mouse-click will produce a new point or some lines, or even a button depending on the element you were generating last. Therefore: change the input mode please. There are two different select modes.iInput Modes:changing.;:

selecting everything which is close to the mouse ("select all types"), and
selecting only a specific type of elements, according to your choice in the "Drawing"-Pulldown menu.
(The third input mode is the defining mode, where we used to be all the time before.)

For changing from one mode to the other, you can choose one of three different ways:

For Pulldown-Lovers: go to the "Drawing"-Pulldown menu and choose the appropriate item at the bottom of the Pulldown menu ("modify all types" or "modify one type" for example).
For One-Hand-Workers: click the right mouse button, where you will find the same items in a Popup menu.
For Right-Click-Haters: push the Shift-key for a short moment, and the mode will switch between "define element" and "select all types"; push the Ctrl-key for a short moment, and the mode will switch between "define element" and "select specific type".

That you are in select mode now is shown to you by the arrow shape of the mouse. So, let's go. Point with the mouse to a line and click, and the line will be green as an indication for you that the line is selected now. Click to a point, and the point will be green, leaving the previously selected line with its true, unselected color. Select a line now.

2.3.1 Moving

If you leave the mouse cursor pressed on the line and you move it, the line will follow your movements over the drawing area, including the two ending points. When you release the mouse button, the line will not follow the cursor any more, but it will remain selected. If you do the same operation with a point, the point will follow under the mouse arrow and pull all lines with it, which use the point as a delimiter.

2.3.2 Configuring

Most elements have parameters, as their color for example. To edit the parameters of an element, there are again three different possibilities for having the configuration panel of the selected element displayed:

double-click (with the left mouse button) on the element,
hit the F2-key after having selected the element with a left mouse click, or
click the right mouse button on the element and select the item "Parameters" from the Popup menu.

Make your changes and leave the panel with "ok" or "cancel". Let's now have a look at some other useful operations with an element.

2.3.3 Deleting

A selected element can be deleted. Delete the element by hitting the "Del"- or "Back"-key or by selecting the item "Delete" in the "Edit"-Pulldown menu, or equally by selecting the item "Delete" in the right mouse button Popup menu.

If you delete a point, all lines using this point as a delimiter are deleted as well. A line cannot live without two delimiting points, so when one of the points is deleted, the line has to be deleted, too. If you delete a line, nothing happens with the points (except that they might adapt their shape to the new situation).

2.3.4 Cutting

A selected element can be cut out by one of the following three operations (cutting is deleting and saving the element in the copy buffer for pasting it afterwards):

select the item "Cut" in the "Edit"-Pulldown menu, or
select the item "Cut" in the right mouse button Popup menu, or
hit the key "alt-X".

2.3.5 Copying

A selected element can be copied (saved in the copy buffer for pasting it later):

• select the item "Copy" in the "Edit"-Pulldown menu, or
• select the item "Copy" in the right mouse button Popup menu, or
• hit the key "alt-C".

2.3.6 Pasting

A previously cut or copied element can be pasted as often as you want to:

select the item "Paste" in the "Edit"-Pulldown menu, or
select the item "Paste" in the right mouse button Popup menu, or
hit the key "alt-V".

2.3.7 Duplicating

And finally, a selected element can be duplicated by one of the following three operations (duplicating is the sequence of copying and pasting with a fixed distance to the copied element):

select the item "Duplicate" in the "Edit"-Pulldown menu, or
select the item "Duplicate" in the right mouse button Popup menu, or
hit the key "alt-D".

If you duplicate a line (as well as copy and paste it), of course the two delimiting points are duplicated as well. Duplication modifies the copy buffer.

2.3.8 More Features

When popping up the right mouse button menu, there might be additional features available, according to the selected element and its state. So for "holding hands"-points (between exactly two lines), the point can be taken out, or the line can be equalized (i.e. the point remains between the lines, but the two lines are stretched).

For lines there are also different alignments possible. Please play a bit with the Popup menu items and follow the instructions for alignment, given by the message panel!

By the way: if you want to add a point on an existing line (the reverse operation of taking a point out), choose the mode "define points" and click with the mouse on the desired line. You will see that the point will stick to the line instead of becoming a lonely point on the drawing area.

2.4 Modifying a Group of Elements

When you click (in a "select"-state) with the mouse on an element of the drawing area, the element becomes selected. When you click on the next element, the old element is deselected before the new element is selected. Maybe sometimes you might wish to select several elements together, in order to move or to delete them.

If you knew how to select them, so that they remained selected all together, you could apply everything explained just before to a group of elements – except for editing parameters: parameters can only be changed for a single element.

As you might expect already, there are some tricky ways for selecting (and deselecting) multiple elements:

Push the left mouse button somewhere on the drawing area where no element thinks that you want to select it. Leave the left mouse button pressed and move the mouse around: Ooops! Yes, there appears a green, dashed rectangle under your mouse, and as soon as you release the left mouse button, every element which is in contact with the rectangle's borders (or is completely inside the rectangle) will be selected.
Sometimes you'd like to select all elements which are inside a given rectangular area. How? Push the right mouse button – but not so quickly: the right mouse button is reserved for the Popup menu, so first push the left mouse button, then at the same time the right mouse button, and then you might release the left button or continue with both buttons pressed. A bit tricky, sorry! If the "select inside" mode is active, the rectangle's color is red instead of green. As soon as you release the right mouse button (release the left button before!), all elements laying completely inside the rectangular area are selected.
If you wish to add more elements to the elements already selected, push the Shift-key while selecting the next element (a single element or several elements through a rectangular area). The same can be done for deselecting elements from a selected group. You can also change the select mode ("select all types" or "select specific type") between the selecting operations.

If you want to move a group of selected elements, click to one of the selected elements without holding the shift key down, leave the mouse button pressed and move the elements over the drawing area. All other operations (as deleting, copying or so) don't involve mouse operations.

For deselecting all selected elements, simply click somewhere on the drawing area where there is no element (selectable in the current select-mode).

2.5 Undo and Redo

Sometimes you might make mistakes. You might delete the wrong element or change the wrong parameter. To "roll you back" to the desired state, you can use the "Undo"-function (through the item "Undo" of the "Edit"-Pulldown menu). While you were working, all changes were written into a protocol, so theoretically you can Undo every change you have made since the beginning of your work.

Some people even make mistakes when undoing a mistake, which turned out not to be a mistake actually; in such a case you can use the Redo-function (also found in the "Edit"-Pulldown menu). Redo is of course only active after one or several Undos and is not available any more when you proceed with some new changes on the drawing area.

2.6 Default Elements

All elements, which you define on the drawing area, copy their parameters from a so called "default element". So, a street copies the color and the maximum speed of the vehicles, and the information whether the street is directed or not, from the default street. Sometimes you might like to change these standard values. In order to change the standard parameters of a street, for example, do the following operations with the VS-pCoq Spy:

  1. Bring the program in the "Define Streets"- or "Select Streets "-mode.
  2. Click the right mouse button. A Popup menu will appear.
  3. Choose the item "Edit Default Street", and the configuration panel will appear. Change the parameters and leave the panel with "ok".

The values of the default elements are saved together with the topology (what you have drawn on the screen). –

2.7 Models and Files

Saved? Yes, let's talk a bit about the filing environment, accessible through the "File"-Pulldown menu.

Before, in any way, loading or saving of a file is possible, a project name must be assigned to the present session. When you click now the "File"-Pulldown menu, choose the item "Assign Project": a panel will appear in which on the left hand list you can change the directory (double-click on the name), and on the right hand list choose an existing project name (single click on the name and "ok"-button, or double click on the name, which leaves the panel directly). If your favorite project name does not exist yet, use the input line on the top of the project name window for writing your own name, followed by the standard extension ".TCP", and press the "create" button instead of "open":

As soon as the VS-pCoq Spy recognizes the name, the name appears in brackets behind the program title on top of the menu bar. This is how the VS-pCoq Spy organizes its files:

A project can consist of sub-projects, which we could also call "models", but models can differ remarkably from each other.
A model can consist of sub-models. We call them experiments. Experiments all use the basic configuration given by their model and are only allowed to change some parameters as traffic sources, control strategies or such. Don't worry, the VS-pCoq Spy checks whether you are allowed to consider a file an experiment of a given model or not.
Note that we wrote "can" and not "must". You can also simply work with a project without any models, or with a model without any experiments.

Here are the names and locations of the different files in the project directory:

Default: the project itself, a work file. Do everything with this file.
Model (as 1.0 or 2.0 and so on, these numbers show up at the very right edge of the menu bar): the simulation model, numbered from 1 upwards.
Experiment (as 1.1 or 1.2): an experiment (basing both on model 1). Experiments always have a model assigned.

When you choose "Save File as" or "Load File", the hierarchy of the defined models and experiments is displayed in the panel, and you can choose the model or experiment you want to work with by simply double-clicking on the shown number or name. You can also click once on the number, then the number will be shown as "actual choice", and you can push the "ok"-button for accepting the choice.

For adding new models or new experiments use the buttons "New Model" and "New Experiment" when saving a file. Don't forget to select the reference model or experiment before pushing one of these two buttons.

When you open an existing project and the project contains a default file, this file will automatically be loaded for you and displayed in the drawing area.

2.7.1 Project Maintenance

Because the VS-pCoq Spy organizes the project structure a bit tricky, you can use two project maintenance menu items:

Delete File: lets you delete an experiment, a model or the whole project.
Duplicate: lets you duplicate a single experiment or a model with all its experiments.
 

© Verkehrs-Systeme AG
updated 26.07.02

[ VS-PLUS ]