loco/train does not randomise routes Topic is solved

Post Reply
applor
Posts: 50
Joined: 10.06.2016, 00:30

loco/train does not randomise routes

Post by applor » 18.01.2019, 06:44

Hello,

I am fine tuning the flow through my main station and have found that a loco/train will always select the first route in a list of possible routes that are identical. This leads to no randomisation.

Back story (skip if you like):

I have an intercity loco (VT 8.5) in block 35. It has a choice of two routes: 35 to 24, or 35 to 74 (crossing 24). It has permission to use both routes and all blocks involved have the same Types selected (including Intercity).
The only difference is the route to block 24 would make the VT8.5 - however I disabled wait in block 24 and it made no difference.
My understanding is that given a choice of two routes with equal permissions/details, the VT8.5 should randomly choose one or the other.
However by starting the loco in auto mode and performing a soft reset of auto mode after it chooses a destination, I have found the VT8.5 always chooses 75 as the destination and never 24.
I have then tested with the E44 (regional) train travelling in the opposite direction (in block 44) to but also presented with a choice of two routes (25, or 36 crossing 25) and it too always chooses the route with a crossing block.
I then changed the routes so it had permissions to choose between two (25 or 23), neither with a crossing block, and the E44 always chose 23 as the destination.

In summary:

If a loco/train has a choice of multiple identically weighted routes it always chooses the first in the list, rather than randomising or performing a round-robin selection.

I imagine this is a case of 'working as intended' but then is there a way I can alter the plan so that the loco/train will randomise between routes?

Thanks!
You do not have the required permissions to view the files attached to this post.

smitt48
Moderator
Posts: 6112
Joined: 04.04.2014, 01:07
Location: Kralendijk, Bonaire - Dutch Caribbean

Re: loco/train does not randomise routes

Post by smitt48 » 18.01.2019, 14:10

Hi Eric,

Have you tried the Random Rate feature?
https://wiki.rocrail.net/doku.php?id=bl ... andom_rate

Here is also another example (in German) with classes.
https://wiki.rocrail.net/doku.php?id=bl ... domrate-de

Tom

applor
Posts: 50
Joined: 10.06.2016, 00:30

Re: loco/train does not randomise routes

Post by applor » 19.01.2019, 05:04

Thanks!

That was what I was after - and I just needed to enable the global flag in Rocrail Properties.

applor
Posts: 50
Joined: 10.06.2016, 00:30

Re: loco/train does not randomise routes

Post by applor » 22.01.2019, 02:56

Hello,

I enabled Random Rate in Rocrail properties and all my blocks are set with default Random Rate of 10 but after simulated testing I have found my locos are still choosing the same route over and over.

Is there something else I am missing?

peter&basti
Moderator
Posts: 6766
Joined: 09.01.2012, 22:09
Location: Vienna, Austria

Re: loco/train does not randomise routes

Post by peter&basti » 22.01.2019, 07:32

Hi Eric,

Rocrail is choosing target Blocks randomly (not routes) in Automatic Mode.

Unfortunately no trace is added to your plan, so i can read only your plan and .ini.
I have an intercity loco (VT 8.5) in block 35. It has a choice of two routes: 35 to 24, or 35 to 74 (crossing 24). It has permission to use both routes and all blocks involved have the same Types selected (including Intercity).
Block 24: length = 2267
Block 74: length = 320
VT 08.5: length = 865

Therefore VT 08.5 will never target Block 74 because the block is too short.

Beside of this fact, another option may restrict random block selection: selectshortestblock="true"
You have chosen this option too.

hermannk
Moderator
Posts: 1148
Joined: 06.07.2014, 12:32
Location: Kiel Germany

Re: loco/train does not randomise routes

Post by hermannk » 22.01.2019, 17:01

Hi Eric (applor),
with some modifications of the plan file and the Rocrail properties your problem is solved:
- set route "35-22" / route permission = YES Intercity
- Rocrail Properties / Automatic / Routing / Select shortest Block = NO

The details:
My sequence of modifying your Rocrail plan:
- put all non relevant block out of order;
- test circle are blocks: 9 -> 33 -> 35 -> 24 or 22 -> 75 -> 9
a) block 24 = Put out of order
-> block 22 is not not usable:
-- reason: route "35-22" / route permission = NO Intercity
Modification:
- set route "35-22" / route permission = YES Intercity

b) Modification of:
- Rocrail Properties / Automatic / Routing / Select shortest Block = NO

c) Modification of (not of any importance):
- wait time of blocks 9, 35, 22, and 24 reduced to 3 seconds (to make testing faster)

d) New (just to show the results):
- some counter variables introduced ("varCount_22, "varCount_22", "varCount_35");
- some text fields introduced to show the counter values ("txbk_22", "txbk_24", "txbk_35");
- an XML script "ac_countBlockInit.xml" introduced to initialise the counters;
- an XML script "ac_countBlock.xml" introduced for incrementing a counter;
- one output "co2" (Push Button) introduced to reset the counters and text fields.

Test:
- Rocrail Properties / Automatic / Loco / Reserve second next block = YES
- Rocrail Properties / Automatic / Routing / Select shortest Block = NO
- Automatic=ON, start loco "VT 08.5" virtual.
Result:
bk 35 = 25 entries
bk 24 = 13 entries
bk 22 = 12 entries
That looks good to me.

Attention:
- use my files on your own risk!
- make backups of your data before using my files!!!

Kind regards
Hermann

PS find enclosed file "loco_train does not randomise routes_HK.zip" containing:
ac_countBlock.xml
ac_countBlockInit.xml
plan.xml
rocrail.ini
You do not have the required permissions to view the files attached to this post.

applor
Posts: 50
Joined: 10.06.2016, 00:30

Re: loco/train does not randomise routes

Post by applor » 23.01.2019, 03:42

Hello again and thanks for your replies.

First I think I must check - to rapidly test block destination, I turn on power/auto mode and start the train. After it selects a destination I select 'soft reset locomotive auto mode' and then repeat the process.
Should this process provide a different result when checking random rate for block destination?

Now to respond to your replies:

Peter: I accidentally typed block 74, I was meant to type block 75. There is no length specified for block 75, so there is no restriction.

Hermann: As per my OP, block 22 is not meant to be a destination for the VT8.5 as an Intercity - The VT8.5 has 2 destination: block 24 or block 75.
Intercity trains use only Blocks 24 or 25 (depending on direction) but have the option of either stopping (block 24) or travelling non-stop to block 75 (pass through 24). Blocks 24 and 75 have identical permissions/details with BRR of 10.

I have also placed E52 in block 44 as a Local train to provide another example. As a Local train in block 44, the E52 has suitable destinations of block 36 [route 44-36 (25)] or block 23 [route 44-23].
However it always selects block 23 as the destination. I attached trace file issue.002.trc for this example.

Now I see it was mentioned my use of 'use shortest block' and yes this would seem to be the cause. However I have disabled this feature, yet my trains still do not randomly select the destination, so it is not the cause.
Frustratingly I need to use that feature for my Mainline Staging yards 1 and 2 due to the varying block length to avoid deadlocked trains.
I realise however that with my use of permissions that I no longer need to specify block lengths in the main station, so these have been removed. This allows me to retain 'use shortest block' but only lengths are entered for Mainline Staging.


Now onto the issue. I followed the proper 'issue' process and I have attached the required zip.

I have been looking at the log and it states Block [75] is a best suited block (35-75 [24]):

20190123.121915.011 r2020a VT 08.5 OModel 6907 Found a BEST suited block [75] for loco [VT 08.5].

Though it then evaluates Block [75] but with route (35-75 [22]) which does not allow ICE:

20190123.121915.017 r9999a VT 08.5 ORoute 1658 Loc [VT 08.5] has no permission to use route [35-75 (22)]; cargo does not fit. (goods,regional!=ice)
20190123.121915.017 r2025a VT 08.5 OModel 6987 Block [75] for loco [VT 08.5] is in the wrong direction.

Perhaps because both have the same Block[75] as the destination, the second route checked is overriding the result?

20190123.121915.018 r9999a VT 08.5 OBlock 1821 Block [22] is free []
20190123.121915.018 r9999a VT 08.5 OBlock 1821 Block [23] is free []
20190123.121915.018 r2028a VT 08.5 OModel 7059 Block [24] is the shortest, the rest length is [0], of the blocks for [VT 08.5]
20190123.121915.019 r9999a VT 08.5 OBlock 4590 block [35] signal [S2-2] enterside=- state=red
20190123.121915.019 r9999a VT 08.5 OLoc 0781 loco VT 08.5: signal=[red]
20190123.121915.020 r4211a 00001EE4 OLcDrive 0145 Setting state for "VT 08.5" from LC_FINDDEST to LC_INITDEST.

It says Block [24] is the shortest but all Blocks are the same length (0)
You do not have the required permissions to view the files attached to this post.

applor
Posts: 50
Joined: 10.06.2016, 00:30

Re: loco/train does not randomise routes

Post by applor » 23.01.2019, 03:57

OK I have done more testing and found the problem!

Testing has shown it working correctly with 'select shortest block' disabled. However if I enable 'select shortest block' and all the blocks are the same length, then auto mode always selects the first route instead of random rate.

What I expect to happen:

If 'select shortest block' is enabled as well as 'use random rate' then auto mode should randomly select the destination block in compliance with random rate if all the block destinations are the same length (in this case set to 0, disabled)

hermannk
Moderator
Posts: 1148
Joined: 06.07.2014, 12:32
Location: Kiel Germany

Re: loco/train does not randomise routes

Post by hermannk » 23.01.2019, 14:08

Hi Eric,
the Rocrail wiki says: https://wiki.rocrail.net/doku.php?id=ro ... test_block
"... Select shortest block
If train and block length are set this option will choose the shortest block available for that train.
This option will decrease the random variation. In some cases it may be, that ever the same block will be the target. ..."
So Rocrail works as designed.
Have fun.
Kind regards
Hermann

applor
Posts: 50
Joined: 10.06.2016, 00:30

Re: loco/train does not randomise routes

Post by applor » 24.01.2019, 23:35

Hi Hermann,

Yes I see your point and that it is working as per the documentation, though disappointing as I am forced to choose between correct stop locations in my staging yards or randomization through my main station.

I can work around the issue at least, I have configured my staging yard with individual inclusion permissions which works almost as well and allows me to use randomization.

Thanks

Post Reply

Return to “Automatic mode”