Multi Train Operating System
  • Home
  • Blog
  • Project Description
  • Documents
  • About

EarlY Proof-of-concepts

The early prototypes of server logic are included here. Some of the initiatives of these experiments were to show how trains could navigate track resources, and how they can do so in a "safe" manner. The results of these experiments were adapted into the final Server component of the project.

Experiment 2

STATUS: COMPLETE (26 February)
Goals of Experiment 2:
  • Represent data structures and logic to allow both clockwise and counterclockwise direction.
  • Allow the ability for turnouts to be changed.
  • Modify code so that trains move in unison, and not by taking turns.
  • Represent a queue to prevent racing conditions on tracks and turnouts.
​THE STRUCTURES
Picture
Picture
Picture
​RESOURCES
experiment2.cpp
File Size: 11 kb
File Type: cpp
Download File

queue.h
File Size: 4 kb
File Type: h
Download File

MOVING IN UNISON TEST
Starting conditions:
  • Train 1 started at "Section 2".
  • Train 2 started at "Section 0"
  • All turnouts were set to straight.
Train 1 was expected to make its way through the sections in the order: 2, 3, 7 (HALT), while Train 2 moved: 0, 8, 2, 3, (HALT). Train 1 was expected to halt because of a turnout faced away from it, while Train 2 would stop because of Train 1 occupying the section in front of it. Looking at the output, both trains successfully navigated the track in tandem, as they both change positions in each iteration of the output.

​TWO DIRECTIONS TEST
  • Train 1 started at "Section 2"
  • Train 2 started at "Section 8"
  • Train 1 was set to clockwise.
  • Train 2 was set to counterclockwise.
  • All turnouts were set to straight.
Train 1 was expected to make the following track progression: 2, 3, 7 (HALT). Train 2 was expected to progress in the order: 0, 4 (HALT). Both trains were expected to stop because of a turnout that was not facing in their direction. Looking at the output, both trains successfully navigated in different directions

TURNOUT SWITCH TEST
  • Train 1 started at "Section 2"
  • Train 2 started at "Section 8"
  • Train 1 was set to clockwise.
  • Train 2 was set to counterclockwise.
  • All turnouts were set to straight.
Train 1 was expected to make the following track progression: 2, 3, 7 (HALT). Train 2 was expected to progress in the order: 0, 4 (HALT). Once both trains had come to a stop, "Turnout 5" was to be switched to curved, which would allow Train 1 to continue on to "Section 5". Looking at the output, the trains both came to a halt at their expected stops, "Turnout 5" was switched, and Train 1 continued on to "Section 5".

QUEUE TEST
  • Train 1 started at "Section 3"
  • Train 2 started at "Section 6"
  • Train 1 was set to counterclockwise.
  • Train 2 was set to clockwise.
  • All turnouts were set to straight, except "Turnout 1", which was set to curved.
Train 1 was expected to make the following track progression: 3, 2, 8 (HALT). Train 2 was expected to progress in the order: 6, 5 (HALT). Once both trains had come to a stop, both "Turnout 0" and "Turnout 1" were to be switched to their opposites (curved and straight, respectively). At this point, both trains would be available to move into "Section 0", but the queue on that section would allow Train 2 to enter as that one arrived there first. Looking at the output, the trains both came to a halt at their expected stops, turnouts 0 and 5 were switched, and Train 2 continued on to "Section 0". The queue successfully allowed the trains to resolve racing conditions on the track.
OUTPUT
Moving in unison:
Picture

​OUTPUT
Two directions navigation:
Picture

​OUTPUT
Turnout switching:
Picture

​OUTPUT
Queueing for resources:
Picture

Experiment 1

STATUS: COMPLETE (19 February)
Goals of Experiment 1:
  • Represent a track through data structures.
  • Represent a train's current location through data structures.
  • Represent logic for a train to navigate through turnouts to the next track section
  • Represent logic for two trains to navigate the track without occupying the same track.
As of the last status update, all but the last objective has been demonstrated.
​THE STRUCTURES
Picture
Picture
Picture
RESOURCES:
experiment1.cpp
File Size: 7 kb
File Type: cpp
Download File

SINGLE TRAIN TEST
Starting conditions:
  • The train started at "Section 0".
  • All turnouts were set to straight.
​The expected progression of the track was: 0, 8, 2, 3, 7 (HALT). Looking at the output, this is exactly what the train did. The train halted because "Turnout 5" was set to straight, and from "Section 7", the only connection it has is to "Section 5" through "Turnout 5" with a curved state.

DOUBLE TRAIN TEST
Starting conditions:
  • Train 1 started at "Section 0"
  • Train 2 started at "Section 2"
  • All turnouts were set to straight.
Only Train 1 will move in this test. It's expected progression was 0, 8 (HALT). This is exactly what the train did, as "Section 3" was occupied by Train 2. Even though logically the track would allow the train to continue, the data structure that checks for train positions prevented Train 1 from entering Train 2's track.
​OUTPUT
Single train navigation:
Picture

​OUTPUT
Double train navigation:
Picture
Create a free web site with Weebly
  • Home
  • Blog
  • Project Description
  • Documents
  • About