It seems that my proposal for the new FCFS system is not as easy to understand as i thought. Yesterday, I've spent more than half an hour to explain it to Regiovogel.
Put into pseudo-C-code, it could work like this:
Code: Select all
// Don't try to compile this, unless you use my patented yet nonexistent AndiKompiler
class shared_orders { // This is the "big picture", all trains on the route have in common
[...] // what we've got already & declaration stuff
Time GlobalTTStart;
Time CurrentHeadway;
Time NextTrainStartTime; // Global variables to save global stuff: TT start, Headway and the next time a train should start
}
class train_timetable {
[...] // should just look like it already is
}
void shared_orders::SetHeadway(Time NewHeadway) {
CurrentHeadway = NewHeadway; // self explaining, I think ^^
}
void shared_orders::SetTTStart(Time NewStartTime) {
GlobalTTStart = NextTrainStartTime = NewTrainStartTime; // ditto
}
void shared_orders::OnTrainArrival(CTrain *ArrivingTrain) { // When a new train arrives...
ArrivingTrain->TTStartTime = NextTrainStartTime; // ... set its new starting time to the saved value...
NextTrainStartTime += CurrentHeadway; // ... and increase the next starting time by the amount of CurrentHeadway
}
Trains have their own timetable just like now. It just gets updated to new headway and starting times only on arrival in the first station. Thus, when you change the global timetable (new starting time or headway), trains already running complete their cycle and fit into the new timetable nicely and smoothly.
This works regardless of the trains' order on the route or where the trains come from (i.e. the depot) - who arrives first, leaves first.
One more suggestion:
Could you put some kind of marker in the train list for trains with Autofill on? I've had some problems finding my autofilling train when there were about 24 others looking just the same.
Pfiatseich,
Andi
(Who will now dissassemble his Petromax lamp in hope of finding all the holes that shouldn't be there)