Coming soon: multi-start timetables and seeding

You are here: Home > Forum > Simulations > Timetables > Coming soon: multi-start timetables and seeding

Page 1 of 2

Coming soon: multi-start timetables and seeding 29/06/2019 at 16:47 #119145
GeoffM
Avatar
4660 posts
Previously, a timetable could only have one seed time - at timetable start. Recently TT authors have bundled multiple timetables which were fundamentally the same except there were alternative start times. Any correction to a train had to be made to each of the multiple timetables.

Coming soon is an upgrade such that a TT will have a default seed time of timetable start (thus retaining backward compatibility), but that you can also add custom start times - eg a default midnight start, an 04:45 start, and a 14:00 start. Each seeded train can be linked to zero (default) or one seed time. When the user starts a simulation, a drop-down selection box allows the user to choose one of these seeding times, or a couple of other options including a custom time, and default start time with/without seeding.

That was the easy(ish!) part, and this will probably be released before the following.

Now we need your help. How would you see this affect rules and decisions? For example, should rules have an option to be fulfilled (or not) depending on the seed time? Your thoughts appreciated.

SimSig Boss
Last edited: 29/06/2019 at 16:47 by GeoffM
Reason: None given

Log in to reply
The following user said thank you: ajax103
Coming soon: multi-start timetables and seeding 29/06/2019 at 17:36 #119149
postal
Avatar
3897 posts
This is likely to be a long and complex post so I apologise in advance if it does not read well or only serves to confuse.

The starting point is that this is a great innovation which will make it much easier for TT writers to edit and maintain a single TT rather than having to manually update a set of TTs with all the opportunities that brings for error. I've been lucky enough to have a test-drive to see how it works and would make the following comments and ask some questions.

To assist in the conversation. firstly an idea of how it works. When you are creating a current TT you create seed trains which enter when the sim starts. There is no change to that process. However, you can now add additional seeding groups for a time of your choosing. When you open a sim and select a TT with more than one seeding group you are given the option of selecting your start time after which the sim opens at the time selected and seeds the trains in that seeding group. That means you will have duplicate TTs in the timetable for all the trains in sim at the nominated seeding group time. For example if you have a TT with 00:00 and 04:45 starts and there is a train which enters at 04:30 and runs through to departure at 05:30 you will need two train TTs. One will be the full TT with the 04:30 entry and another seed TT entering the train at the location it will have reached by 04:45 and then picking up the schedule. You also need to remember that if have a train that seeds as an overnight berthing train with a morning departure after 04:45 you need to seed the train twice at 00:00 and 04:45. Although that sounds a bit messy it is not difficult to do in practice and is easier than creating 2 complete TTs with 00:00 and 04:45 start times.

Now for the complications and the things that need to be resolved. I'll use the 00:00/04:45 times as examples but the problems are generic rather than specific to those times.

1) Trains entering which are governed by rule.

Suppose that the 00:00 start TT has Train A that leaves the sim at 04:30. Train B which is TT'd to enter at 05:00 has a rule that it must not enter until 30 minutes after train A leaves the area. If you select the 04:45 start TT, Train B will never enter as it is waiting for 30 minutes after the exit of Train A which has never run. If you delete the rule then in times of perturbation using the 00:00 start TT Train B may enter before Train A has left the area.

2) Trains which have alternatives (by rule or by decision).

Taking the situation above a stage further, suppose that the 00:00 start TT has a choice of two trains to run and the lucky candidate is selected either by a rule like "are alternatives" or " mutually exclusive" or by a decision. The two trains both exit before 04:45 and then both of the parent trains spawn a child train that is due to enter after 04:45. For example Train A goes into an off-sim yard at 04:30 and forms Train X due to re-enter at 05:00 while Train B (the alternative to Train A) goes into the yard and forms Train Y due to re-enter at 05:00. These child trains will traditionally be controlled by a rule that Train X must enter Z minutes after Train A leaves the area and Train Y must enter Z minutes after Train B leaves the area giving us the same problem as above. If you take out the timing rules and add a rule that Trains X and Y are alternatives then run the 00:00 start TT you will only a one in four chance that one of Train X or Train Y will enter.

You can get round that by using a decision rather than a rule to decide which of Trains A or B enters and then using the same decision to govern the entry of Trains X or Y. However, it would still leave the situation about the rules governing the timing of the re-entry hanging in the air.

Another downside is that using a decision rather than a rule would break a number of existing TTs if they were edited to have more than one start time but is the extra work in turning over from rules to decisions a price worth paying to move from the multiple TT scenario to the single piece of work?

Casting around for answers and with no knowledge of how difficult it might be in coding terms, one idea that might work would be to tag rules to the seeding groups. No seeding group tagged and the rule is always applied. With a defined seeding group the rule is only applied to that group.

Bar the simplistic suggestion above, I've no idea to how to answer the questions raised but I hope that someone can come up with workable ideas or suggestions as the whole concept is too good an idea to let pass.

"No question is too stupid, there are just some stupid answers" - Dr. Michael Reece, 12/08/1927 - 03/06/2019. Electrical engineer and inventor
Last edited: 29/06/2019 at 18:47 by postal
Reason: None given

Log in to reply
Coming soon: multi-start timetables and seeding 29/06/2019 at 19:05 #119155
Meld
Avatar
619 posts
Having converted a couple of timetables to this new format, the process of duplicating the services to make the seed for another time, copies the decision as well.

On starting with the new start time, with the seeds enabled, any service that seeds with a decision will still choose one of the choices. There is no need for any new decisions.

Hopefully by midweek I will have a copy of the Sheffield 2019 TT converted to this format for trying out.

Log in to reply
Coming soon: multi-start timetables and seeding 29/06/2019 at 19:16 #119156
Meld
Avatar
619 posts
In reply to one of Postals comments

Quote:
1) Trains entering which are governed by rule.

Suppose that the 00:00 start TT has Train A that leaves the sim at 04:30. Train B which is TT'd to enter at 05:00 has a rule that it must not enter until 30 minutes after train A leaves the area. If you select the 04:45 start TT, Train B will never enter as it is waiting for 30 minutes after the exit of Train A which has never run. If you delete the rule then in times of perturbation using the 00:00 start TT Train B may enter before Train A has left the area.
Maybe we need a new rule type to cover this situation using a time field.

So instead of Train B must enter 30 mins after Train A leaves the area, you could have Train A (which was train B in the earlier start) must enter 15 mins after 04:45.

Alternately the simplest fix would be to just remove the governing rule from the 04:45 start (in this case) and give the service an entry time

Last edited: 29/06/2019 at 19:20 by Meld
Reason: None given

Log in to reply
Coming soon: multi-start timetables and seeding 29/06/2019 at 20:05 #119157
postal
Avatar
3897 posts
Meld in post 119156 said:
Maybe we need a new rule type to cover this situation using a time field.

So instead of Train B must enter 30 mins after Train A leaves the area, you could have Train A (which was train B in the earlier start) must enter 15 mins after 04:45.

Alternately the simplest fix would be to just remove the governing rule from the 04:45 start (in this case) and give the service an entry time
I think that is where the problem lies. If you set a rule that Train B must enter 15 minutes after 04:45, that would cover the 04:45 seeding but what about the 00:00 start. If you leave in the rule about Train B entering 30 minutes after Train A leaves the area then Train B can't enter in the 04:45 start as Train A has not run so can't have left the area. On the other hand if you take out the 30-minute rule to make the 04:45 start work, leave in the must enter at 05:00 rule then run an 00:00 start where Train A is delayed and has not left the sim by 05:00 you would have Train B entering before Train A has left. The answer is to find some way of making some rules only applicable under certain circumstances. That is one for those who understand the core code to answer.

"No question is too stupid, there are just some stupid answers" - Dr. Michael Reece, 12/08/1927 - 03/06/2019. Electrical engineer and inventor
Log in to reply
Coming soon: multi-start timetables and seeding 29/06/2019 at 20:15 #119158
postal
Avatar
3897 posts
Meld in post 119155 said:
Having converted a couple of timetables to this new format, the process of duplicating the services to make the seed for another time, copies the decision as well.

On starting with the new start time, with the seeds enabled, any service that seeds with a decision will still choose one of the choices. There is no need for any new decisions.

Hopefully by midweek I will have a copy of the Sheffield 2019 TT converted to this format for trying out.
Absolutely. But the problem isn't in duplicating the TT for Train A or Train B, it is further downstream. If you have a situation where a decision forces Train A or Train B to enter; they both leave the sim before the notional 04:45 and they form second workings Train X and Train Y which enter after 04:45 you would normally govern the entry of Train X or Train Y by having rules that Train X must enter after the exit of Train A and Train Y after the exit of Train B.

If you run the 04:45 start using those rules then neither Train X nor Train Y will enter as neither Train A nor Train B has entered. If you try and sort that by having a new Train X/Train Y decision and then run the 00:00 start you have the problem that the first decision may call Train A but if the second decision calls Train Y it will not enter as it is ruled not to enter until Train B has left the area. You can get round that by adding the same Train A/Train B decision into the TTs of Train X and Train Y. Train X has the choice Train A and Train Y has the choice Train B. That would sort the 04:45 start problem and make no difference when running the 00:00 start.

"No question is too stupid, there are just some stupid answers" - Dr. Michael Reece, 12/08/1927 - 03/06/2019. Electrical engineer and inventor
Last edited: 29/06/2019 at 20:18 by postal
Reason: None given

Log in to reply
Coming soon: multi-start timetables and seeding 29/06/2019 at 20:30 #119159
Meld
Avatar
619 posts
Sorry John lost my train of thought a little was thinking separate copies of TT not Multiseed (been a long day).

Maybe a new rule along the lines of Train A must not enter until x mins after [Seed Group] where you select the seed group time - in this case being 04:45.

As the original train B hasnt run in the 04:45 the original rule could be made to be ignored.

Alternately adding the seed group to each existing rule type could be used, where by rules in TT Start seed group would apply and by duplicating the rules that apply after the 04:45 would be read for that startup (see mantis 25697)

Log in to reply
Coming soon: multi-start timetables and seeding 29/06/2019 at 20:38 #119160
postal
Avatar
3897 posts
Meld in post 119159 said:
Sorry John lost my train of thought a little was thinking separate copies of TT not Multiseed (been a long day).

Maybe a new rule along the lines of Train A must not enter until x mins after [Seed Group] where you select the seed group time - in this case being 04:45.

As the original train B hasnt run in the 04:45 the original rule could be made to be ignored.

Alternately adding the seed group to each existing rule type could be used, where by rules in TT Start seed group would apply and by duplicating the rules that apply after the 04:45 would be read for that startup (see mantis 25697)
Or you have rules with no group that are always applied (which would be the great majority of the rules in the TT) then some rules which are only applied if the TT start seed group is called and others which are only applied in fhe 04:45 group is used. Added that to Mantis.

You wouldn't need a rule about entering x minutes after seed group. If you had a rule that Train B must enter 30 minutes after Train A has left the area which was tagged to the sim start seed group then the rule wouldn't apply for the 04:45 start and the Train B would enter at due TT time (subject to any delays/early running called by the scenario being used).

"No question is too stupid, there are just some stupid answers" - Dr. Michael Reece, 12/08/1927 - 03/06/2019. Electrical engineer and inventor
Last edited: 29/06/2019 at 20:42 by postal
Reason: None given

Log in to reply
Coming soon: multi-start timetables and seeding 30/06/2019 at 08:50 #119163
kbarber
Avatar
1436 posts
postal in post 119158 said:
Meld in post 119155 said:
Having converted a couple of timetables to this new format, the process of duplicating the services to make the seed for another time, copies the decision as well.

On starting with the new start time, with the seeds enabled, any service that seeds with a decision will still choose one of the choices. There is no need for any new decisions.

Hopefully by midweek I will have a copy of the Sheffield 2019 TT converted to this format for trying out.
Absolutely. But the problem isn't in duplicating the TT for Train A or Train B, it is further downstream. If you have a situation where a decision forces Train A or Train B to enter; they both leave the sim before the notional 04:45 and they form second workings Train X and Train Y which enter after 04:45 you would normally govern the entry of Train X or Train Y by having rules that Train X must enter after the exit of Train A and Train Y after the exit of Train B.

If you run the 04:45 start using those rules then neither Train X nor Train Y will enter as neither Train A nor Train B has entered. If you try and sort that by having a new Train X/Train Y decision and then run the 00:00 start you have the problem that the first decision may call Train A but if the second decision calls Train Y it will not enter as it is ruled not to enter until Train B has left the area. You can get round that by adding the same Train A/Train B decision into the TTs of Train X and Train Y. Train X has the choice Train A and Train Y has the choice Train B. That would sort the 04:45 start problem and make no difference when running the 00:00 start.
But with the 04:45 start, it doesn't matter whether A or B is supposed to have run, because it's history outside the range of the timetable we're running. So the idea of tagging a X or Y decision to the 04:45 timetable should solve it completely - if you run 00:00, X or Y will govern A or B, but if you run 04:45 the appearance of A or B is governed by the decision (and tells you, if you are interested, whether X or Y is supposed to have run). (Or is it a bit too early in the morning for my brain to get itself round such complications?)

Log in to reply
Coming soon: multi-start timetables and seeding 30/06/2019 at 09:15 #119164
postal
Avatar
3897 posts
kbarber in post 119163 said:
So the idea of tagging a X or Y decision to the 04:45 timetable should solve it completely - if you run 00:00, X or Y will govern A or B, but if you run 04:45 the appearance of A or B is governed by the decision (and tells you, if you are interested, whether X or Y is supposed to have run).
Correct but adding a new dimension to the situation. Previously John (Meld) and I had got as far as suggesting that it would be good if rules could be tagged to starting times. What you are asking now is for decisions to be tagged as well. The original suggestion would work if only rules could be tagged while yours is more aesthetically pleasing if decisions can be tagged as well.

"No question is too stupid, there are just some stupid answers" - Dr. Michael Reece, 12/08/1927 - 03/06/2019. Electrical engineer and inventor
Log in to reply
Coming soon: multi-start timetables and seeding 30/06/2019 at 10:28 #119167
TimTamToe
Avatar
576 posts
I agree that something needs to be included to deal with the rules, so that selecting a differing starting and seeding time doesn't prevent other trains from entering due to the rules of trains that will not / have not entered due to the time selected by the user. It also needs to be relatively straight forward to do especially if tt writers would be "encouraged" to update previous versions to the new format.

I don't know which is the best way of solving it and leave it to those with more knowledge.

In the mean time with numerous tt's on the verge (size of verge unknown so still no timescale) of release, I'll probably still for the moment release 00:00 start and 04:45 start tt's

Gareth

Log in to reply
Coming soon: multi-start timetables and seeding 30/06/2019 at 21:10 #119181
bill_gensheet
Avatar
350 posts
postal in post 119157 said:

If you set a rule that Train B must enter 15 minutes after 04:45, that would cover the 04:45 seeding but what about the 00:00 start. If you leave in the rule about Train B entering 30 minutes after Train A leaves the area then Train B can't enter in the 04:45 start as Train A has not run so can't have left the area. On the other hand if you take out the 30-minute rule to make the 04:45 start work, leave in the must enter at 05:00 rule then run an 00:00 start where Train A is delayed and has not left the sim by 05:00 you would have Train B entering before Train A has left. The answer is to find some way of making some rules only applicable under certain circumstances. That is one for those who understand the core code to answer.
Could this be fixed transparently in the mechanics behind the rule, so leaving timetables alone ?

Scenario:
Say Train A should exit 0350, Train B enter 0500 but with rule of 40 minutes
Train A 60 minutes late.

At present the sim records 'train A exited sim at 0450' and the rule prevents train B entering until (ExitA + WaitB) = 0530

If instead the sim recorded 'train A should have left at 0350 but was 60 minutes late'.
Then the rule on train B prevents entry until (EntryB - ExitA + delayA + waitB) = 0500-0350+60+40 = 0530

That way any late start sim run would simply have delayA=0 by default.

Bill

Log in to reply
The following user said thank you: postal
Coming soon: multi-start timetables and seeding 30/06/2019 at 21:41 #119182
postal
Avatar
3897 posts
So if that suggestion can be made to work, no need to tag entry rules to a seed group. The change in the code would presumably require it to look back to the TT for the governing train to establish an exit time. How would it establish and remember how late a train was in exiting (particularly if the sim has been closed then re-opened so there is no current memory of the time)? Would that require each rule timed against a train leaving the area would need to log the exit time to be used when the rule is applied?

First thought is that if the suggestion is feasible there would be no need to change any rules or decisions in existing TTs if a new seed group was added. Of course first thoughts may change once I've had time for my brain to do its best work while I am asleep!

I've got lots of questions but no answers.

"No question is too stupid, there are just some stupid answers" - Dr. Michael Reece, 12/08/1927 - 03/06/2019. Electrical engineer and inventor
Last edited: 30/06/2019 at 21:42 by postal
Reason: None given

Log in to reply
Coming soon: multi-start timetables and seeding 01/07/2019 at 07:05 #119189
9pN1SEAp
Avatar
267 posts
Online
I think this can easily be rationalised. Any rules for “Train X must enter” should surely be irrelevant, and ignored, if the planned entry time is later than the seed, in all cases as normally we’d assume RT running in the default seed case and thus by extension to all seeds.

What would be nice is if the seed point was slightly variable to introduce inherent delay. Even better if it could be done automatically (ARS sims might be better at this!)

Thanks
Jamie

Jamie S (JAMS)
Log in to reply
Coming soon: multi-start timetables and seeding 01/07/2019 at 09:13 #119190
postal
Avatar
3897 posts
9pN1SEAp in post 119189 said:
I think this can easily be rationalised. Any rules for “Train X must enter” should surely be irrelevant, and ignored, if the planned entry time is later than the seed, in all cases as normally we’d assume RT running in the default seed case and thus by extension to all seeds.

What would be nice is if the seed point was slightly variable to introduce inherent delay. Even better if it could be done automatically (ARS sims might be better at this!)

Thanks
Jamie
Not quite as simple as that. If you have trains due to enter which are parts of chains, the origin of which is a rule like "are alternatives" or "mutually exclusive" or a decision then just ignoring the "Train X must enter" rules would mean that all trains chained down from all of the parents would enter although only one should, tied back to whichever the rule or decision decided to enter before the seed time of the current run. If the parent trains had their entry governed by decision it is trivial to solve as you enter the same decision to the child trains as well. However, if the parent trains entered as a result of a rule you either have to go back and turn over all such trains to enter by decision rather than rule or you have to have some mechanism to tie a rule to a seed group so that the "Train X must enter" rule does not apply only if the relevant seed time has been selected and the code looks back to the rule governing the parent train to decide whether the child should run..

"No question is too stupid, there are just some stupid answers" - Dr. Michael Reece, 12/08/1927 - 03/06/2019. Electrical engineer and inventor
Last edited: 01/07/2019 at 09:15 by postal
Reason: None given

Log in to reply
Coming soon: multi-start timetables and seeding 01/07/2019 at 09:36 #119191
Meld
Avatar
619 posts
[quote=9pN1SEAp;post=119189
What would be nice is if the seed point was slightly variable to introduce inherent delay. Even better if it could be done automatically (ARS sims might be better at this!)
[/quote]

You can do this now, just duplicate the schedule a couple of times with different UIDs with a choice decision and seed at different locations.


Note to self - now theres food for thought :evil grin

Log in to reply
Coming soon: multi-start timetables and seeding 01/07/2019 at 14:52 #119195
9pN1SEAp
Avatar
267 posts
Online
postal in post 119190 said:

Not quite as simple as that. If you have trains due to enter which are parts of chains, the origin of which is a rule like "are alternatives" or "mutually exclusive" or a decision then just ignoring the "Train X must enter" rules would mean that all trains chained down from all of the parents would enter although only one should, tied back to whichever the rule or decision decided to enter before the seed time of the current run. If the parent trains had their entry governed by decision it is trivial to solve as you enter the same decision to the child trains as well. However, if the parent trains entered as a result of a rule you either have to go back and turn over all such trains to enter by decision rather than rule or you have to have some mechanism to tie a rule to a seed group so that the "Train X must enter" rule does not apply only if the relevant seed time has been selected and the code looks back to the rule governing the parent train to decide whether the child should run..
I'm not 100% convinced. For "normal" timetables, there are a set of alternatives/MutEx's that you would have in place. If you view an alternate seed time as just another timetable, there would be a set that applied just there. If the second seed were to depend on actions prior to seed point, the same (by reductio ad absurdem) would be true of the "normals". A rule depends either on something which hasn't yet happened (in which case, no change), or something which did (and then rules can be constructed as though the timetable just started at seed2). Provided that seeding can cope with alternative/mutex cases for new trains, I think all is well.

Thanks
Jamie

Jamie S (JAMS)
Log in to reply
Coming soon: multi-start timetables and seeding 01/07/2019 at 14:57 #119196
9pN1SEAp
Avatar
267 posts
Online
Meld in post 119191 said:
[quote=9pN1SEAp;post=119189
What would be nice is if the seed point was slightly variable to introduce inherent delay. Even better if it could be done automatically (ARS sims might be better at this!)
You can do this now, just duplicate the schedule a couple of times with different UIDs with a choice decision and seed at different locations.
[/quote]

And once we get weighted alternatives, we can really ruin a person's day!

Jamie S (JAMS)
Log in to reply
Coming soon: multi-start timetables and seeding 01/07/2019 at 18:08 #119200
postal
Avatar
3897 posts
9pN1SEAp in post 119195 said:
I'm not 100% convinced. For "normal" timetables, there are a set of alternatives/MutEx's that you would have in place. If you view an alternate seed time as just another timetable, there would be a set that applied just there. If the second seed were to depend on actions prior to seed point, the same (by reductio ad absurdem) would be true of the "normals". A rule depends either on something which hasn't yet happened (in which case, no change), or something which did (and then rules can be constructed as though the timetable just started at seed2). Provided that seeding can cope with alternative/mutex cases for new trains, I think all is well.

Thanks
Jamie
Clearly I haven't explained the point well enough. In the situation I am postulating there are say two later trains due to enter of which one will appear. In the full TT, which of the two appears is governed by which of the two parent trains entered. Whichever of the two enters has its entry time constrained by a must enter x minutes after the parent train leaves the area rule. That enables the integrity of the chain, ensuring that Train X enters if Train A runs and Train Y enters if Train B runs. If the seed time occurs after the putative exit of the parent train, the second train cannot enter because the must enter x minutes after can never be satisfied. Let us now consider the situation if we add additional alternative/mutex rules for the two dependent trains. That solves the problem if the sim starts to run at a time after the parent trains leave the sim. However, let's look at what would happen if the full TT is run. The situation should be that if Train A runs then leaves then Train X enters x minutes after and if Train B runs then leaves, Train Y enters x minutes after. We'll leave to one side the issue of whether or how the timing rules will work and just consider the alternatives/mutes situation.

First let us consider the original two trains. Only one will enter because of the rules in place. What happens after that? I think the choices are:

1) Train A enters by rule. Train X is due to enter after Train A leaves the area. However, Train X and Train Y are ruled as alternatives so there is only a 50% chance the Train X will run. Train Y cannot run as Train B has not left the area.
2) Train B enters by rule. Train Y is due to enter after Train B leaves the area. As before Trains X and Y are alternatives so ultimately you have a 50% chance of Train Y entering.

So unless there is a way to tag rules to seed times, making both parent and child trains have are alternative rules means that there is a 50% chance that no child train will run when the full TT is selected.

"No question is too stupid, there are just some stupid answers" - Dr. Michael Reece, 12/08/1927 - 03/06/2019. Electrical engineer and inventor
Last edited: 01/07/2019 at 18:48 by postal
Reason: None given

Log in to reply
Coming soon: multi-start timetables and seeding 01/07/2019 at 20:46 #119205
9pN1SEAp
Avatar
267 posts
Online
postal in post 119200 said:
1) Train A enters by rule. Train X is due to enter after Train A leaves the area. However, Train X and Train Y are ruled as alternatives so there is only a 50% chance the Train X will run. Train Y cannot run as Train B has not left the area.
2) Train B enters by rule. Train Y is due to enter after Train B leaves the area. As before Trains X and Y are alternatives so ultimately you have a 50% chance of Train Y entering.

So unless there is a way to tag rules to seed times, making both parent and child trains have are alternative rules means that there is a 50% chance that no child train will run when the full TT is selected.
Ah! I see what you're saying.

At "Normal" seed, A & B are alternatives, and the X/Y "must enter after" work correctly. X & Y can't be alternatives else they would break existing functionality.
At "Later" seed, we *would* need X & Y to be alternatives. The "must enter after" would need to be ignored because (a) the standard entry time is after "Later" seed, and (b) the A & B trains were never in play.

So X & Y should have an "Alternatives" but be activated ONLY if A & B aren't seen.

In theory the code *could* look at all rules related to each train, and say that:
(a) IF a "must enter after" exists for A-X, AND the normal appearance time of X is after seed time, AND (A is seeded at seed time OR A appears after seed time) AND A actually appears, USE this rule to make X appear.
(b) If an "alternatives" rule exist for X/Y, AND X/Y are seeded or appear after seed, AND "must enter after" exists for targets A-X/B-Y, BUT A/B are NOT seeded AND A/B do NOT appear after seed [they are never seen in game], the "alternatives" is used to select X or Y at the right time.
(c) If an "alternatives" rule exist for X/Y, AND X/Y are seeded or appear after seed, AND there is NO "must enter after" rule, the "alternatives" is used to select X or Y at the right time.
(d) IF an "alternatives" rule exist for X/Y, BUT rules (b) and (c) weren't satisfied, the "alternatives" is ignored. Proceed to rule (e).
(e) If no rules at all, or conditions (a)-(c) didn't influence the train's appearance, it's a normal train to make appear or be seeded, IF seeded at seed time OR appears after seed time. "Must enter after" is ignored because rule (a) didn't use it.

The above logic should be valid for ANY seed time chosen, default or later. In the example you quoted:
Normal Seed:
A/B:
Rule (a) doesn't apply, no "must enter" rules for this
Rule (b) doesn't apply, no "must enter" rules for this
Rule (c) does apply, there's no "must enter" rules. A & B are alternatives and one is selected.
A train appears.
X/Y:
Rule (a) applies because an A/B choice was made. X or Y appears after whichever was chosen from A or B. The "X/Y alternative" is not needed in this case so not used.
The right train appears.

Later Seed:
A/B:
Rule (a) doesn't apply, A/B not seeded/appearing at "later seed".
Rule (b) doesn't apply, A/B not seeded/appearing at "later seed".
Rule (c) doesn't apply, A/B not seeded/appearing at "later seed".
Rule (d) ignores the A/B alternatives.
Rule (e) doesn't apply, because A/B would appear before the "later seed".
The train does not appear.
X/Y:
Rule (a) doesn't apply, because A/B would appear before the "later seed".
Rule (b) does apply, there ARE "must enter" rules for A-X/B-Y, BUT A/B would appear before "later seed" (aren't in play). X & Y are alternatives and one is selected.
A train appears.

Maybe someone could double-check the logic but I think this solves John's specific case and general cases as well without any special action on the TT writer's part.

Thanks
Jamie

Jamie S (JAMS)
Last edited: 01/07/2019 at 20:48 by 9pN1SEAp
Reason: Tyop

Log in to reply
Coming soon: multi-start timetables and seeding 01/07/2019 at 21:07 #119208
postal
Avatar
3897 posts
@Jamie

Good analysis (although I haven't checked the line by line logic yet)! In reality a lot of that can be simplified by using decisions rather than rules, although the root problem still remains. Essentially the problem hinges on the core code having the ability to tag some rules to a specific seed time.

John Mills (Meld) has just come up with an idea that might enable us to work round the problem which both of us are trying to refine and get into a workable proposition. It's a bit of a fudge until the core code catches up but would enable TT writers to proceed with a small number of duplicated trains rather than having to maintain separate TT with a manual update for all variants each time a single change is made.

If we can get it to work, details will follow.

"No question is too stupid, there are just some stupid answers" - Dr. Michael Reece, 12/08/1927 - 03/06/2019. Electrical engineer and inventor
Last edited: 01/07/2019 at 21:08 by postal
Reason: None given

Log in to reply
Coming soon: multi-start timetables and seeding 01/07/2019 at 21:12 #119209
MarkC
Avatar
888 posts
Online
If I have read what you put correctly If Train A runs then Train X is its return journey, and if Train B runs then Train Y is its return.

Instead of using alternatives or mutually exclusive why not use decisions all you need is is 1 decision and 2 choices for this.

For Choice 1 you would apply to both Train A and X.
For Choice 2 you would apply to both Train B and Y.

This would ensure that the correct return journey comes back. The same decision would work regardless of which seed time is chosen.

The only issue to contend with then is then re-entry time for the different seed/start times times.

It's not my fault! I was left unsupervised.
Last edited: 01/07/2019 at 21:14 by MarkC
Reason: None given

Log in to reply
Coming soon: multi-start timetables and seeding 02/07/2019 at 19:32 #119215
postal
Avatar
3897 posts
Thanks to a piece of genius from Meld, we have now worked out a fudge that solves the "x minutes after" problem when a seed time occurs in the gap between one train leaving and the other entering. The fudge can be extended to work when there are alternative trains which again generate new workings after a seed time. The fudge involves creating two timetables for a single train. There may be better or more effective ways of solving the problem so if anyone finds a way please let us all have the details.

For the single train situation where we have Train A leaving the sim, a seed time in the TT then Train B entering n minutes after Train A has left the sim (and using the 0000 / 0445 seed times) you need to do the following.

1) Create two variants of Train B, one tagged to each TT start time. For this discussion we'll call them Train B 0000 and Train B 0445.
2) Create a Train B decision which has two choices; Train B 0000 with weight 0 and Train B 0445 with weight 1.
3) In the TT for Train B 0445 add the Train B decision and Train B 0445 choice. Do not add a decision to the TT for Train B 0000.
4) Create a rule that Train B 0445 must not run if Train A runs.
5) Create a rule that Train B 0000 enters n minutes after Train A leaves the area.

Then at the Train B entry time, Train B 0000 will enter if the 00:00 seed time was chosen, while Train B 0445 will enter if the 04:45 seed time was used.

If you have two alternative trains entering before a seed time, spawning two other trains to enter after the seed (Train A > Train X and Train B > Train Y) you need to do the following.

1) Create two variants each of Train X and Train Y as you did for Train B above.
2) Create a Train X/Train Y decision with the choices as:
a) Train X 0000; weight 0. Choice not applied to any TT
b) Train X 0445; weight 1. Choice applied to TT for Train X 0445
c) Train Y 0000; weight 0. Choice not applied to any TT
d) Train Y 0445; weight 1. Choice applied to TT for Train Y 0445.
3) Create rules as:
a) Train X 0000 enters x minutes after Train A leaves the area.
b) Train Y 0000 enters x minutes after Train B leaves the area
c) Train X 0445 must not run if Train A runs.
d) Train X 0445 must not run if Train B runs.
e) Train Y 0445 must not run if Train A runs.
f) Train Y 0445 must not run it Train B runs.

Both single and alternative train scenarios have been tested and have worked as expected in the tests conducted so far.

That leaves one outstanding issue and there is a fudge to get round that as well. Suppose that Train X runs off sim and Train Z enters n minutes after Train X has left. As there are two Train X TTs you can't use a simple rule If Train Z is ruled to enter n minutes after Train X 0000 leaves the area and n minutes after Train X 0445 leaves the area, Train Z will never enter as one or other of Train X 0000/0445 has not left the area. In that situation you need to terminate the TTs for both Train X 0000 and Train X 0445 at some intermediate point before leaving the area. For each TT add an activity at the terminating point of next train Train X. Then create a TT for Train X from the intermediate point to leave the area. You can then rule Train Z to enter n minutes after Train X has left the area. The intermediate point does not need to be a stopping location as the core code will change TTs on the fly at full line speed.

As a final note, if the loader eventually allows rules to be tagged to seed times which would take away the need for these fudges then it would not be a mega amount of work to edit the TT to take out the fudges. However, even if the fudges are left in place the TT will not be broken which is good news.

Sorry if that all seems long and over-complicated as well as being written in advanced gobbledygook but the fudges do work and will enable TT writers of complex TTs to take advantage of the new loader capabilities. Apologies in advance for any typos as well; there is every possibility of that given the length and complexity of the piece.

Update: 2 small TTs for Cathcart with 00:00 and 00:10 seed times attached so people can see how things work.

Post has attachments. Log in to view them.
"No question is too stupid, there are just some stupid answers" - Dr. Michael Reece, 12/08/1927 - 03/06/2019. Electrical engineer and inventor
Last edited: 02/07/2019 at 20:11 by postal
Reason: None given

Log in to reply
The following user said thank you: Meld
Coming soon: multi-start timetables and seeding 02/07/2019 at 22:19 #119225
postal
Avatar
3897 posts
And already some simplification as the process above is over-specified.

For the single train scenario you can omit some stages and only do:
1) Create two variants of Train B, one tagged to each TT start time. For this discussion we'll call them Train B 0000 and Train B 0445.
2) Create a rule that Train B 0445 must not run if Train A runs.
3) Create a rule that Train B 0000 enters n minutes after Train A leaves the area.

For the alternative train scenario (and assuming you have already created a decision to decide between Train A and Train B):

1) Create two variants each of Train X and Train Y as you did for Train B above.
2) Add the choices from the Train A/Train B decision to trains X and Y as:
a) Train X 0000; no decision added
b) Train X 0445; Train A/Train B decision, choice Train A
c) Train Y 0000; no decision added
d) Train Y 0445; Train A/Train B decision, choice Train B
3) Create rules as:
a) Train X 0000 enters x minutes after Train A leaves the area.
b) Train Y 0000 enters x minutes after Train B leaves the area
c) Train X 0445 must not run if Train A runs.
d) Train X 0445 must not run if Train B runs.
e) Train Y 0445 must not run if Train A runs.
f) Train Y 0445 must not run it Train B runs.

Still a fudge but simpler. Updated Cathcart TTs attached for use when the updated loader is released.

Post has attachments. Log in to view them.
"No question is too stupid, there are just some stupid answers" - Dr. Michael Reece, 12/08/1927 - 03/06/2019. Electrical engineer and inventor
Last edited: 02/07/2019 at 23:07 by postal
Reason: None given

Log in to reply
Coming soon: multi-start timetables and seeding 02/07/2019 at 23:36 #119231
Meld
Avatar
619 posts
Typical Geordie over-complicating matters
Log in to reply