brummfondel's path rule

pwjohnson

Member
I'm trying to experiment with brummfondel's Path Control rule. I tried a test, and (just like with Mutton's rule) found that the starter semaphore lights change but the arm remains at danger. So I tried to put an invisible signal just before the semaphore as the starter, but this time got an error:
path control_lib Thread Exception ER_NullReference, line 614 file path.gse.

Now I've read somewhere in the forum (can't remember where) that brummfondel's path rule will only work in TS2010 (which I'm using, build 44088) if you "replace any gse files with the original gs source file". I've downloaded his source (trf.rar), and sure enough there are various .gs files as well as .gse (and .gsl) files there. The .gs files are text files, which can be read with a simple text editor, and contain C-like code (presumably script), but the .gse files cannot be opened like this (are they a compressed version?).

Anyway, I went through the commands in turn, and for those which had .gse files I copied them to a backup folder, replaced them with the .gs files from the unpacked source rar, and committed. This seemed to be OK for Autodrive, but when I got to Path Control Library, the commit threw up 7 errors, all in pathcontrol_lib.gs, between lines 626 and 662.

The errors were "function not declared" (hasYellowFeature; setSignalState; signalStateMsg), and "return type mismatch, expecting bool".

Am I doing this .gse replacement incorrectly? Or is this a lost cause for TS2010? Any help greatly appreciated!

Peter
 
Hi Peter

I have been using brummfondels Path rule successfully in 2010 for a couple of months now with the ECML and Midshire Mainline routes. I read that it has problems when used with the Quickdrive rule in the same session so I remove the Quickdrive rule when I use the Pathset rule. I haven't tried it with semaphore signals however so I don't know if there are any issues with them but it seems to work fine with bloodnoks colour light ones.

Regards

Brian
 
I'm trying to experiment with brummfondel's Path Control rule. I tried a test, and (just like with Mutton's rule) found that the starter semaphore lights change but the arm remains at danger. So I tried to put an invisible signal just before the semaphore as the starter, but this time got an error:
path control_lib Thread Exception ER_NullReference, line 614 file path.gse.

Now I've read somewhere in the forum (can't remember where) that brummfondel's path rule will only work in TS2010 (which I'm using, build 44088) if you "replace any gse files with the original gs source file". I've downloaded his source (trf.rar), and sure enough there are various .gs files as well as .gse (and .gsl) files there. The .gs files are text files, which can be read with a simple text editor, and contain C-like code (presumably script), but the .gse files cannot be opened like this (are they a compressed version?).

Anyway, I went through the commands in turn, and for those which had .gse files I copied them to a backup folder, replaced them with the .gs files from the unpacked source rar, and committed. This seemed to be OK for Autodrive, but when I got to Path Control Library, the commit threw up 7 errors, all in pathcontrol_lib.gs, between lines 626 and 662.

The errors were "function not declared" (hasYellowFeature; setSignalState; signalStateMsg), and "return type mismatch, expecting bool".

Am I doing this .gse replacement incorrectly? Or is this a lost cause for TS2010? Any help greatly appreciated!

Peter

Peter,

this rule works in TRS2004, 2006 and all TC (1&2, 3).

Path Control library also needed: [FONT=Verdana, Arial]KUID2:[/FONT] [FONT=Verdana, Arial]192081:51:3

Both are made for TRS2004.

I hope that I can help.


regards

Wolfgang
[/FONT]
 
Thanks Brian and Wolfgang for your very rapid replies!

Brian: I don't use QuickDrive, having also read that it can cause trouble. I wasn't expecting semaphore arms to work (only the lights) since I'd had the same thing with Mutton's rule, and there are other posts discussing this problem of the excellent LQ semaphores. Though actually when I got the exception, I was referencing the invisible signal not the semaphore signal! But it's interesting that you've had no problems with brummfondel's rule (and presumably haven't done this gse to gs thing).

Wolfgang: I did have the path control library with the kuid you reference. Please note that I'm using TS2010 which you didn't mention?

I wish I could find the forum entry that said gse files should be replaced - I noted that it was in a "Protection of Diamond Crossings" thread but a search didn't show it - odd. Do threads go missing??
 
Hi again Peter

I'll try it with one of the SnC scenarios this evening and see if there are any issues with the semaphore signals on there. I haven't made any changes to the rule at all in 2010.

Regards

Brian
 
Hi again

I've just tried a quick test with the SnC Craven District session and the semaphore signals work as they should. Are you using the scripted signals that require targets placing on the tracks to operate junction signals correctly or are you using some of the older models?

I'll try some more involved testing now and see if there are any issues.

Regards

Brian
 
Hi Brian,

Thank you very much for taking the time to investigate this. The signals I use are all the lower quadrant semaphores by chrisaw (Chris Whiting), which are apparently based on bloodnok's scripts. The one I used in the test was
Sig BR(W) Home 15ft 3'arm <kuid2:218467:24524:1>

Regards, Peter
 
Thanks Brian and Wolfgang for your very rapid replies!

Brian: I don't use QuickDrive, having also read that it can cause trouble. I wasn't expecting semaphore arms to work (only the lights) since I'd had the same thing with Mutton's rule, and there are other posts discussing this problem of the excellent LQ semaphores. Though actually when I got the exception, I was referencing the invisible signal not the semaphore signal! But it's interesting that you've had no problems with brummfondel's rule (and presumably haven't done this gse to gs thing).

Wolfgang: I did have the path control library with the kuid you reference. Please note that I'm using TS2010 which you didn't mention?

I wish I could find the forum entry that said gse files should be replaced - I noted that it was in a "Protection of Diamond Crossings" thread but a search didn't show it - odd. Do threads go missing??


Peter,

I also use TS2010, after the installation I got some errors, which i have fixed.

regards

Wolfgang
 
Hi Peter

I've just built a small fully signalled test layout including the signal that you mentioned and everything works as it should when the path is set up and the session runs.

Are you setting all the signals to green when you initially set up the path? I do this and have had no problems.

While experimenting I changed them back to red in the path and when I ran the session the signal animated to clear but the train saw it as red and stopped. I am using the same 2010 build as you so, if you are setting up the paths correctly, I am at a loss to explain your problem with this. I use the rule on both my desktop and laptop without any problems.

Is the route that you are using the signal on one that you are building or is it downloaded or built in? If either of the latter I will try the signal and rule on the route and try to replicate your problem.

It is well worth persevering with the rule as once you have the path library set up it is quite easy to combine it with the Schedule Library to create complex paths. The AI no longer stops and thinks about where it is going which makes running to a timetable much easier.

Regards

Brian
 
Hi Brian,

Are you setting all the signals to green when you initially set up the path? I do this and have had no problems.

Not sure I understand. The signal was red to start with (no train approaching).

Is the route that you are using the signal on one that you are building or is it downloaded or built in? If either of the latter I will try the signal and rule on the route and try to replicate your problem.

It's a simple little baseboard with a four-junction layout specifically for testing this. It would be a lot simpler if I could send you the route and session - would you be willing to take a look?? Could I attach the cdps to a PM? As it stands, for me it produces the big red button and thread exception, but before it did that it was behaving as I described in the first para of my first post.

Thanks again, Brian.

Regards, Peter
 
Hi Peter

I would be pleased to take a look at your test route although it will be tomorrow evening before I get the chance to have a look at it.

With regards to setting the signals. When you enter the path into the library you save it after giving it a name. The signals will be at red. If you click on them they will change to first yellow and then green. I always set them to green.

I don't know if you have had a look at the instructions for the path rule but if not then have a look at this site

http://www.js-home.org/trainz/pathcontrol/index.php

Regards

Brian
 
Hi Brian,

Many thanks for offering to take a look at my test route/session, but I don't know how to send it to you - I can't see how to attach anything to a pm.

With regards to the signals, yes I do set it to green in the ruls.

Thanks again, Peter
 
I'm re-opening this thread to post the results of testing Brummfondel's path rule with lower quadrant semaphore signals. Brian (Kennilworth) has helped me enormously with his time and ideas, and I'm very grateful to him - without him I'd have given up or gone down some wild-goose chase.

I'm not presenting this as the definitive way to do these things, only as a way which we've found to work. There may well be people out there who do things differently; I just want to describe what we've found in the hope that it may save someone else spending as much time as we have over this.



Uploaded with ImageShack.us

I built a test layout, modelled very, very loosely on Shrewsbury (UK). It's a double junction, so trains can leave to and arrive from two directions (Crewe and Chester) in the north, and two (Telford and Hereford) in the south.
A train approaching from Crewe proceeds either to Platform 1 or Platform 3, depending on whether it's bound for Telford or Hereford. The right branch semaphore S1 shows which route it's taking.

For most of the testing there were only two approach paths in use: one from Crewe and one from Chester, both converging to use Platform 3 en route for Hereford.
The semaphores in use were
Sig GWR Home R branch <kuid2:218467:24630:1>
Sig GWR Home L branch <kuid2:218467:24631:1>
Sig BR(W) Combined 20ft <kuid2:218467:24544:1>

Problem 1: Semaphores could not be used as path starters.
When the branch semaphore (or even a simple home semaphore) was used as the path starter signal, the trains worked (apart from problems mentioned below), but when under path control the arms did not animate (although the lights changed). Visually of course this is unacceptable.
This problem was solved by putting an invisible signal <kuid2:45324:24010:2> (marked as IS in the diagram) just ahead of each semaphore. This was specified as the path starter (set to green in the path definition), and the semaphore was set to automatic in the definition. It was found that the distance between the invisible signal and the semaphore had to be no more than 5m, or a train could get "stuck" forever between them.

Problem 2: Trains go the wrong way.
(This problem is nothing to do with semaphores; it occurs with colour light signals as well.)
At times, when there was contention, a train from Crewe which should have been going to Hereford instead went straight on to Telford! What happened was that after a previous train from Crewe had correctly passed through to platform 3, a train from Chester arrived, and grabbed the path to platform 3. While this still held the path, another train from Crewe arrived, and (correctly) failed to get the path. However, because we were using the no-wait (aka queued) option on the getpath command, and the default position for junction J1 was straight on (as it was for further junctions down platform 1) the semaphore S1 was clear for the straight-on direction, and the train carried merrily on past platform 1 to Telford! This also caused later trains from Chester to queue up indefinitely, because the path request for this second Crewe train was still queued up (although the train itself had now gone), and when the path request could be satisfied it enabled the *third* Crewe train to proceed correctly. So the n'th Crewe train was always using the (n-1)'th train's path request!
The problem is that the path starter signal is only under path control when a path has been set. At other times it reverts to automatic, and hence can be clear if the default path beyond it is clear. This must not be allowed to happen. It could have been prevented by setting the default position for junction J1 to the right, but as I want to use Andi's junctions it's not prototypical to see a crossover set in this way, so I added an invisible trailing junction (in blue - marked ITJ1), which had a default position of right. So the path starter was never clear unless it was set to be so by path control.

Problem 3: platform starter signal shows clear then danger.
(Again, this problem occurs with colour light signals as well as semaphores.)
Each train gets two paths: the approach path to get it to the correct platform (no-wait option for this one), and then a second path (with wait) when it is ready to leave the platform, to route it towards its destination. Consider a train approaching platform 3 en route for Hereford. It has not yet issued the getpath command for the leaving path, so the leaving path starter signal (LS1) is not yet under path control. So if the route ahead to Hereford is clear LS1 will be clear. However, if a train now approached from Telford, and gets the path to take it platform 4, when the Hereford train tries to get its leaving path it will fail, and LS1 will now go to danger. This is not prototypical (signalman don't usually changed their minds!), so again the solution is to add an invisible trailing junction (ITJ2) with default direction right, so that LS1 is always at danger unless a successful getpath command from a train at platform 3 has been issued.

With these changes in place for all of the 8 possible paths through the station (as in the diagram) I ran a test generating trains every 2 minutes from each of the four remote places, with alternate trains either running straight on through Shrewsbury or using the crossover to go to the diagonally-opposite destination. Although queues did gradually build up - Shrewsbury station couldn't cope with this volume - all trains were still passing through correctly after 1.5 hours.

In summary, the two rules which worked, at least for this scenario, were
1. Never let a path starter go to clear when not under path control. Ensure there is no default path beyond it.
2. Don't use a semaphore for a path starter. Instead, have an invisible signal no more than 5m in front of it, and use that as the path starter.

I hope somebody finds this useful!

Peter
 
Further to my last post, I've noticed that there is an option on the path definition (in the path rule) which looks like a traffic light with no lights on. This can be changed to show red. If this is done, the path starter is kept at red at all times unless a path has been successfully set. I think this will cause problems 2 and 3 to go away for colour light signals, without the need for the invisible trailing junctions.

It's not good with semaphores, though. The (invisible) path starter is indeed kept at red, which does solve problem 2, but the branch semaphore immediately following the path starter goes up and down like a fiddler's elbow each time an attempt is made to get the path (when one route beyond the signal is clear), which of course is visually unacceptable.

Peter
 
I don't know whether there's anyone out there interested in all this, but just in case, there's one other thing I've noticed. It only arose doing a stress test, and is much less likely to occur with a realistic timetable, but still just might happen.
Code:
                                     PS
-------trainB->--------trainA->-----------\------------path A
                                           \_________path B
If you have trainA wanting to go along pathA, and train B wanting to go along path B, both waiting at the same path starter signal PS, and both trains having already done their appropriate getpath, then it appears that the code will try to get *both* paths. If it happens that path B is obtained first, the path starter signal will clear, and train A will proceed along path B!

The solution is clearly not to allow a following train to issue its getpath until the preceding train has passed the path starter signal. e.g.

Code:
      S      T                     PS
--------->--------------------------------\------------path A
                                           \_________path B
where T is a trigger which causes a train passing over it to do its getpath, and S is a home (stop) signal. So if the first train is waiting at PS, the second one can't pass S and therefore can't do its getpath.
NB (a trap I fell into) don't have S and T too close together - remember the trigger radius!
 
Back
Top