Elvas Tower: AI train does not want to restart after station stop - Elvas Tower

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

AI train does not want to restart after station stop Rate Topic: -----

#1 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,000
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 06 May 2014 - 02:41 AM

I have a case in route SUD-ITALIA_01 where an AI train stops at a small station (Favazzina) and does not restart. It continously changes status from STA to ACC to BRK(I believe they are these three), but stays there. Signal is cleared. Path ends before next station.
Here a screenshot (it is train 34):
Attached Image: Open Rails 2014-05-05 10-42-38.jpg
Here the chectrain file:
Attached File  checktrain_Favazzina.zip (42.74K)
Number of downloads: 202
Here the logfile:
Attached File  OpenRailsLog_Favazzina.zip (3.38K)
Number of downloads: 189
Here some route files just in case:
Attached File  SUD-ITALIA_01.zip (766.74K)
Number of downloads: 195
Here the path file:
Attached File  ORAP_Reg12654.zip (883bytes)
Number of downloads: 186

#2 User is offline   roeter 

  • Vice President
  • Group: Status: Elite Member
  • Posts: 2,424
  • Joined: 25-October 11
  • Gender:Male
  • Country:

Posted 06 May 2014 - 08:12 AM

Well, the train certainly wants to restart but somehow finds itself back at the station again. For some strange reason, the stop is not removed from the list after the train departed.
I noticed there is a waiting point earlier in the path. Could you please remove that waiting point and test if the problem still occurs?
Waiting points for AI trains are processed as station stops, but perhaps the existance of a waiting point somehow corrupts the station stop list.

Regards,
Rob Roeterdink

#3 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,000
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 07 May 2014 - 12:36 PM

I made some tests.
If I remove the end point, therefore lengthening the path, the train stops for the correct time and restarts (even leaving the WP, that is two stations before). Here the working path:
Attached File  ORAP_Reg12654_endless.zip (1.97K)
Number of downloads: 183
If I instead replace the waiting point with a station stop, and leave the path ending at the original point, the train does not restart from Favazzina. Here the non-working path without WP:
Attached File  ORAP_Reg12654_noWP.zip (865bytes)
Number of downloads: 191
Looking at other paths, I only slightly increased the length of the path to the next signal section, and this path works correctly:
Attached File  ORAP_Reg12654_aftersignal.zip (878bytes)
Number of downloads: 197

So it seems that it is what is after Favazzina that causes the problem at the station stop.

#4 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,000
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 08 May 2014 - 12:40 AM

I provide also the checktrain file for the last path above (working), so that a comparison can be done with the original checktrain file (nonworking). It is a path without WP, but as verified above the problem does not lay there.
Attached File  checktrain_Favazzina_OK.zip (53.37K)
Number of downloads: 184

#5 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,000
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 08 May 2014 - 01:07 AM

What I have noticed is that immediately after the end of the station platform there is an end of speed reduction post immediately followed by another speed reduction post. No signal between end of platform and this couple of speedposts.

#6 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,000
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 19 May 2014 - 08:07 AM

I write also here what I found in my debugging.
The problem is due to the fact that the if at line 1664 of AITrain.cs, that is
if ((PresentPosition[0].RouteListIndex == (ValidRoute[0].Count - 1)) ||
                    (NextSignalObject[0] != null &&
                     NextSignalObject[0].TCReference == ValidRoute[0][ValidRoute[0].Count - 1].TCSectionIndex) ||
                    (NextSignalObject[0] != null &&
                     NextSignalObject[0].TCNextTC == ValidRoute[0][ValidRoute[0].Count - 1].TCSectionIndex))

gives a positive result because the last clause is true.
So removeStation is set to false because ProcessEndOfPath should have removed the station from the list.
Unfortunately ProcessEndOfPath decides that it is not at the end of the route, and so the station is not removed from the list.

If the path is extended beyond the signal in front of it, the above clause is false and so removeStation remains true and causes the removal of station from the list at line 1747.

After further investigation it seems to me that ProcessEndOfPath decides that we aren't yet at the end of the path because there is still a signal between train and end of path (check is in line 4650 of UpdateRouteActions)
                    if (!intermediateJunction && !intermediateSignal)  // no more junctions and no more signal - reverse subpath
                    {
                        endOfRoute = true;
                    }

So there is a contradiction: ProcessEndOfPath is called even if there is an intermediate signal, but then refuses to act because there is the intermediate signal.

So it seems that either the last part of the above if clause of line 1664 or the last part of the above if clause of line 4650 should be removed ??? Or is it more complicated?

#7 User is offline   roeter 

  • Vice President
  • Group: Status: Elite Member
  • Posts: 2,424
  • Joined: 25-October 11
  • Gender:Male
  • Country:

Posted 19 May 2014 - 11:20 AM

Yes, it is more complicated.
Having two clauses (the pre-clause in station stop and the ProcessEndOfPath method) can always lead to problems.
Best way out is to alter ProcessEndOfPath to do all the work, and return two states : end of path, and train still exists.
Obviously requires changing all calls to this method.
Is now on my list of 'things to do' - will probably be completed next week.

Regards,
Rob Roeterdink

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users