Railroad train games by Rule the Rail - Home Train games, railway games Rule the Rail!

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How are simultaneous controls processed?

 
Post new topic   Reply to topic    Train games, railway games Rule the Rail! Forum Index -> Creating automatic controls
View previous topic :: View next topic  
Author Message
AZRoger



Joined: 17 Aug 2006
Posts: 29
Location: Prescott, AZ, USA

PostPosted: Sat Oct 21, 2006 2:52 pm    Post subject: How are simultaneous controls processed? Reply with quote

Hi,

I'll trying to change the 4x8 layout from my earlier thread to allow whichever train is ready to enter the yard first to get in. Right now, it toggles between Freight Trains and Passenger Trains. Due to the passenger station and freight yard processing (allowing trains to pass) the arrivals at the yard become "lumpy".

To fix this I need to know how simultaneous controls are processed. Imagine the following scenario. Two trains are rushing toward control points on their respective tracks. They both get there "at the same time". What needs to happen in this case is this:

One of the trains has to be considered to be first. <b>All</b> the controls for that train have to be processed before <b>any</b> control is processed for the second train. Is that how it works? It is very hard to test this with a layout. It could work 100 or a 1000 times and then crash. Many graphics intensive programs uses lots a parallelism, dealing with different ojects and layers, to gain performance. I'd like to know that there isn't an parallelism in processing controls before I build something that won't work.

Any insight will be appreciated.

Roger
Back to top
View user's profile Send private message
Blazer9



Joined: 20 Apr 2006
Posts: 211
Location: Jacksonville FL

PostPosted: Sat Oct 21, 2006 5:30 pm    Post subject: controls Reply with quote

AZRoger

Each engine has an ID that activates a control in some fashion. when two trains reach there respective controllers each activate there respective objects at the same time.

I have set a schedule for my trains to enter thier respective objectives on time by using small sections of tracks to allow for speed control. The use of the small sections of track allow me to use how many controllers a need at one time.

4 small sections equal a short section of track and 4 short sections of track equal one long length of track. So I could place a total of 16 controllers in the same space of one long length of track.

and considering you could control numerous items like switches signals crossing gates uncoupllers and speed controls for unlimitless numbers of trains by using the id system and the option of an east and west bound operations.

The sky is the limit. I also use a controller track to control the switching and uncouplling in all of my yard operations.

I hope this helps you in the operation of your layout.

Happy RailRoading

DonR aka Blazer9
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
AZRoger



Joined: 17 Aug 2006
Posts: 29
Location: Prescott, AZ, USA

PostPosted: Sat Oct 21, 2006 6:01 pm    Post subject: Multiple controls per controller block Reply with quote

Don,

Thanks for the suggestion of using very short track pieces. I have built my controls with multiple controls (switches, power levels, etc.) that fire from the same controller block, ie. the same red/blue block. Most red/blue blocks have 2 controls but some have as many as 8 or 10. I use mostly short (middle sized) straights. I had problems with the very short straights when power was involved. The trains would coast through the following control even with the power off. Sad

My question has to do with two different trains hitting different red/blue blocks at the same time. I'd like to have all the controls triggered by one of the red/blue blocks run before any of the controls from the other one. For example, if one of the trains wants 4 switches to be straight. And the other needs 2 switches to be set to curve, I don't want to wind up with one switch set to curve. After both sets of controls process, I need to have a valid state of the switches.

Roger
Back to top
View user's profile Send private message
Chris



Joined: 10 Mar 2006
Posts: 644
Location: Wisconsin, USA

PostPosted: Sun Oct 22, 2006 2:07 am    Post subject: Reply with quote

Roger,

I'm not sure there's a foolproof way to do what you're hoping to accomplish. I tend to give one type train priority over another by isolating a certain number of short straights on each line 'powered' by the other line. So as the priority loco enters its stretch of isolated track it crosses a control that kills the power on the lower priority track. The lower priority loco has to travel more track within its isolated section before it can kill the power to the higher priority train.

This section would be before the switch controls, etc. Just ensure that the disabled loco can't coast into its other controls.

Hope that helps.

Chris
Back to top
View user's profile Send private message Send e-mail
AZRoger



Joined: 17 Aug 2006
Posts: 29
Location: Prescott, AZ, USA

PostPosted: Mon Oct 23, 2006 4:49 am    Post subject: The age of the engine is key.... Reply with quote

I did some tests with the simple layout called timing found here

www.shotscan.com/ruletherail/timing.zip

I have 12 controls on each of the two lanes, all under the single Red/Blue block on that lane. All 12 of the disconnected switches are set to either straight or curve by the controls at that block. I tried changing the order of creation of the controls. I tried moving the track segments with the controls between the lanes. I tried Slightly delaying one engine's arrival at the controls. (That's why there's a very short short track segment laying on the grass.)

To operate the test, it's easiest to click on the power control. Click to a minus value to push the engines against the bumpers at the left. Click positive to run the engines to the right.


The very slight delay caused the expected result. Going from right to left, all the switches were set to curve. Going back the other way, they were all set straight. One lane was the boss going left and the other was the boss going right.

When the lengths of track were equal for both engines, all the switches would go straight (or curve) going to the right and the would also go straight (or curve) going to the left. The same engine seemed always to control the switches. Surprised

It turns out that the OLDest engine is the one that ruled when there were ties. Let's say, the top lane is setting the switches, both directions. If you delete that engine and add back in an identical engine, the bottom lane will start setting the switches. The bottom lane now has the OLDer engine.

I ran several tests where I intentionally set the switches to "random" settings before the test run. After the runs, all the switches were either curved or straight.

So it seems that All the controls triggered by One engine crossing a control block are processed before any of the controls of any other engine that might be crossing any control block at the "same" time. The engines are processed from newest to oldest. If there are conflicts, the settings triggered by the older engine with prevail.

OK. Each Red/Blue block is processed completely before going on to the next. There is no such thing as a true tie. One is always first ... and last. This is good. But, Chris, as you suggested, I'm not sure it helps. I still have to deal with coasting down, gradual speed up, and differences in these things with different consists....Ugh.

Roger
Back to top
View user's profile Send private message
SeymourDavid



Joined: 28 Aug 2006
Posts: 45
Location: United Kingdom (UK)

PostPosted: Wed Jan 10, 2007 11:32 pm    Post subject: Reply with quote

I have sometimes use a small section of track that switches off when a train begins a sequence and turns back on once the program can accept the next sequence.

Hope this helps.

Note: This process is best used only if 2 trains are involved. if you try to incorperate more it might get much more complex

Keep on Tracking
_________________
Keep on Tracking
David S
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Train games, railway games Rule the Rail! Forum Index -> Creating automatic controls All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum