-bugs
+allegedly fixed, but untested
if train was abutting section boundary and is told to go,
maxinto is not updated properly, so if it is then
told to stop it stops owning the segment it may have
and nothing else. command speed 1 then speed 0
should now own X12 too but does not
+bugs
on decel done, should replan train location to release future
segments no longer required
to reproduce: put shinkansen nose car at A6 (home location)
double vnow, vtarg;
SpeedInfo try;
const SpeedRange *regime;
+ Distance oldmaxinto;
DPRINTF(speed,core, "request %s%s step %d\n",
tra->backwards?"-":"",tra->pname,
vnow= current_speed(tra,tnow);
vtarg= tra->speedcurve[step];
+ oldmaxinto= tra->maxinto;
DPRINTF(speed,core, " request vnow=%f vtarg=%f\n", vnow,vtarg);
try.max_speed_estimate);
try.stopping= !step;
+ if (!try.stopping) {
+ Segment *fdet= tra->foredetect;
+ tra->maxinto= fdet->i->poscombs[fdet->movposcomb].dist;
+ assert(tra->maxinto >= oldmaxinto);
+ tra->uncertainty += tra->maxinto - oldmaxinto;
+ }
+
ec= predict(tra,tnow,
step <= tra->speed.step ? PREDF_OLDPLAN : 0,
0,0, &try, ppc,ppcu);
if (ec) {
+ tra->uncertainty -= tra->maxinto - oldmaxinto;
+ tra->maxinto= oldmaxinto;
ec2= predict(tra,tnow, PREDF_OLDPLAN,0,0, 0,
0,(char*)"abandoned acceleration");
assert(!ec2);
tra->speed.decel.duration= regime->ts;
toev_start(&tra->speed.decel);
}
+ report_train_position(tra);
xmit(tra);
return 0;
}