CS452 - Real-Time Programming - Spring 2011
Lecture 19 - Projects
Pubilic Service Announcement
- Exam
- Broken trains
Milestones
1. Tracking & Route Finding
What you are expected to do
- One locomotive on the track:
- Give the locomotive a destination & speed at the terminal.
- `Destination' means `x cm past switch/sensor y, travelling in
direction z'
- The part of the train from which measurements are made is the
track contact, which is attached to one of the trucks. (The
original definition of a truck is a unit consisting of several
wheels, which supports part of a vehicle. Each locomotive
locomotive has two four wheel trucks; an eighteen wheel
semi-trailer has three trucks, a two wheel truck at the front of
the tractor, an eight wheel truck at the back of the tractor, and
a second eight wheel truck at the back of the trailer.)
- Your application knows where the train is at all times.
- `Where the train is' means destination, as defined above,
plus
- direction and velocity of the train.
- Important terminology
- The velocity of a train is the rate at which it
moves along the track, measured in centimetres/second.
Velocity is normally signed, and the easiest way of doing the
math is to make track segments directed
- The speed of a train is the number written to the
train controller when you change how fast the train is
going.
- The most important part of the first milestone is creating
the ability to give a train a particular velocity by altering
its speed. This is called having a calibration of
the train.
- Train finds the shortest route to the destination and travels to
it.
- This should be robust against malfunctioning sensors and switches
- To do this you need
- Calibration. Calibration is the primary goal of the
first milestone.
- Route creation. To get good performance in your complete project it
is essential that your route-finding should include routes in which
the train changes direction.
- It is possible to complete this assignment without achieving what you
project needs simply by running the trains very slowly. We expect you to
have the trains running fairly quickly -- speed 8 to 12 -- during the
milestone demo.
2. Avoiding
What you are expected to do
- Two or three locomotives on the track:
- Give each locomotive a destination & speed at the terminal.
- They find non-conflicting routes to their destinations and travel
to them.
- Your application knows where the trains are at all times.
- This should be robust against malfunctioning sensors and switches
- Locomotives should not collide
- Locomotives should not fuse into one when they get too close
together
- To do this you need
- Adaptive route finding
- A track reservation system
Projects
1. Train style
Give trains roles and objectives. For example,
- Passenger train travels on a repetitive route meeting a schedule.
- Freight train travels to random destinations as fast as possible.
- Objective is to deliver as much freight as possible while keeping a
passenger train on time.
Another example,
- Trains are taxis.
- When a load appears they race to see if they can get it.
Another example,
- Trains are buses, which travel long routes from one place on the track
to another.
- At the end of the route is a scheduled trip to a different
location.
- When a bus is late arriving, the dispatcher must find another, unused
bus to leave at the scheduled leaving time.
2. Game style: AI
The track is a graph.
- Several different ways to choose vertices and edges
Many games are played on graphs
- Checkers, snakes & ladders, maze games, etc.
- Implement a graph game played on the track graph.
For example, watchmen and bandit.
- One train is the bandit, which tries to move from one hide-out to
another.
- The other trains are watchmen, who try to prevent the bandit from
getting to a hide-out once he is out in the open.
Another example, PAC man
- One train tries to cover as much track as possible.
- Other trains try to trap him so that he can't get reservations that
would allow him to keep moving.
3. Game style: interactive
In the games you play for pleasure, the user normally controls one or more
of the game entities.
- the bandit
- the trapping trains
Students often want to make an interactive project. It has been done
successfully in the past, but constructing a usable interface is a real
challenge
Return to: