CS452 - Real-Time Programming - Fall 2009

Lecture 23 - Trains



1. Tracking & Route Finding

What you are expected to do

2. Avoiding

What you are expected to do


1. Train style

Give trains roles and objectives. For example,

Another example,

2. Game style

The track is a graph.

Many games are played on graphs

Train Properties

A locomotive travels on the track at a given speed following the path created by directions of turn outs.

Things can go wrong, such as

The mapping between speed controls and train velocity is complex

In general the speed of a locomotive may be a function of many variables

  1. which locomotive you have
  2. which speed you set
  3. time since the last speed change
  4. the speed it was travelling at before the last speed change
  5. where it is on the track
  6. how long since the track was cleaned
  7. how long since the locomotive was lubricated

The Essence of Calibration

  1. You measure the time interval between two adjacent sensor reports.
  2. You calculate the velocity of the train
  3. After many measurements you build a table

The Problems You Have to Solve

  1. The table is too big.
  2. The values you measure vary.

Return to:

Return to: