A few things first
You can download the above program for Mac OSX or for Windows as .zip files. To the best of my knowledge there are no viruses or malware in these files.
The executable programs were made with LiveCode using a Mac running 10.6.8, from a unique code version. The only run-time difference is in the use of the checkmark character "•" in the OSX version against "x" in Windows version. This is checked in a single line of LiveCode:
if "NT" is in the systemversion then put "x" into gTick else put "•" into gTick
LiveCode thinks in terms of "stacks" of "cards", each stack shows in its own window. In this program there is only one stack but it has a different card for each layout you might try. I will use the terminology of cards and stacks in this page.
At the start
When you launch the program you will see a single window (Rail Layouts) and three menus (File, Edit, Help). The window can be resized.
On the window are:
- a table of switch descriptions, with a maximum of 16 lines. In it you can type the switch notations. There are two given in the above example.
- a field with a name for the layout. In the example "Oval with a diagonal" is used. The name has no function but is a useful reminder.
- two buttons "<" and ">" to allow you to navigate to other cards containing info of other layouts.
- a button "Compute" which will compute the APR property from the definitions typed into the switches table.
- a diagnostic field where the answer will be displayed, it is "Some segments are unreachable". The number of times the matrix needed to be "multiplied" before a stable configuration appeared is also given (2 iterations).
- a square table that corresponds to the layout and shows which points are reachable and which not. The first filling of this table from the switches table ticks a few cells only, their tick marks are in red. The marks that were obtained by "multiplying" are in black. You can grab the matrix and move it within its square if the result is too large for the window.
- an image of the layout. This image may be pasted onto the card from a screenshot of a drawing. The image fulfills no function but is a useful reminder.
The File Menu
The File menu has:
- New: for creation of a new, blank card for computing a new layout.
- Delete: for removing a card from the stack
- Save: to save all cards into a file containing for each card: the switch table, the name and the image.
- Open: to load a set of layout cards from a file previously saved.
The Edit Menu
The Edit menu has:
- Paste: for pasting an image from the clipboard. Only one image can be pasted on a card, pasting a second one removes the first.
- Clear: for removing the image.
- the other menu items are inactive.
The Help Menu
The Help menu is inactive at this time (2011-12-11)
Limitations
Since I rely on naming the segments with a single letter, I'm limited to 26 segments. But the number of switches is always even and the number of segments is always three times the number of pairs of switches. Hence the maximum number of switches is (26 div 3)*2 = 16. This also limits the segments to 3*16/2=24. But a layout with 16 switches is already quite complex and the whole point is to experiment with computing the APR of some layouts, not use the program for arbitrary layouts.