|
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 PointsYou 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:
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:
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 StreetsWe 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 WaysWe 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 PathsMaybe 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 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 ElementNow 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.;:
For changing from one mode to the other, you can choose one of three different ways:
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 MovingIf 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 ConfiguringMost 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:
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 DeletingA 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 CuttingA 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):
A selected element can be copied (saved in the copy buffer for pasting it later):
A previously cut or copied element can be pasted as often as you want to:
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):
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 FeaturesWhen 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 ElementsWhen 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:
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 RedoSometimes 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 ElementsAll 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:
The values of the default elements are saved together with the topology (what you have drawn on the screen). 2.7 Models and FilesSaved? 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:
Here are the names and locations of the different files in the project directory:
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 MaintenanceBecause the VS-pCoq Spy organizes the project structure a bit tricky, you can use two project maintenance menu items:
|
|
|