Difference between revisions of "Yield Line"
From #openttdcoop wiki
(→The Logic) |
(→The Logic) |
||
Line 17: | Line 17: | ||
Using Osai's definition of 0 for Green and 1 for Red: | Using Osai's definition of 0 for Green and 1 for Red: | ||
− | {| align="center" border="1" | + | {| align="center" border="1" cellspacing="20" |
! !! 1 !! 0 | ! !! 1 !! 0 | ||
|- | |- | ||
! Q || Will Yield || Will Not Yield | ! Q || Will Yield || Will Not Yield | ||
|- | |- | ||
− | + | ! X || Train Following || No Train Following | |
|- | |- | ||
− | + | ! B || Train on ML Ahead || No Train on ML Ahead | |
|- | |- | ||
− | + | ! C || Train on YL || No Train on YL | |
|} | |} | ||
Line 51: | Line 51: | ||
Truth Table: | Truth Table: | ||
A = (No Train on ML or YL) = B NOR C | A = (No Train on ML or YL) = B NOR C | ||
− | {| align="center" border="1" | + | {| align="center" border="1" cellspacing="20" |
! X !! A !! Q | ! X !! A !! Q | ||
|- | |- |
Revision as of 20:15, 11 May 2010
by scobos
Overview
Yield Lines are temporary extra tracks than run parallel to a ML or SL. The idea is force slow(er) trains to move to the side and allow fast(er) trains to pass.
The Concept
Often a ML or SL can become slightly jammed by the presence of slower trains. This can happen when trains are out of date and haven't replaced yet, or simply when they are carrying full loads back to a drop on the same line as empty trains. Ideally, we would be able to separate trains to different tracks based on speed. Since currently this is not possible, a theoretical work-around is to separate trains based on Gap Distance.
As a slower train continue down a ML or SL, traffic builds up behind them, but a Gap opens in front of them (as faster trains move ahead). Therefore, we can assume that if there is a large Gap in front of a train, and no Gap behind it, it is probably a slow train. Now the only question is how to sort it.
The Logic
Q is the Entry Combo Signal that determines whether a train can continue on the ML or must go to the Yield Line (YL). Note the penalty on the YL.
Using Osai's definition of 0 for Green and 1 for Red:
1 | 0 | |
---|---|---|
Q | Will Yield | Will Not Yield |
X | Train Following | No Train Following |
B | Train on ML Ahead | No Train on ML Ahead |
C | Train on YL | No Train on YL |
Why These Inputs Matter
X: If there is a train behind us, we might be slow and should consider yielding. If there is no train behind us, we probably aren't slow and can continue.
B: If there is a train right in front of us (who didn't yield), we probably aren't slow. If there is no train right in front of us, we might be slow and should consider yielding.
C: If there is a train on the YL, he might be slow and we should try to pass! (Continue on ML) If there is no train on the YL... well, this by itself doesn't really tell us much!
So the logic, first in words, then formula, is that we want: (Train Will Yield) if (Train is Behind) and (No Train on ML) and (No Train on YL) Q = X NAND B NAND C
which is the same as saying: (Train Will Yield) if (Train is Behind) and [No Train on ML or YL] Q = X AND (B NOR C)
Truth Table: A = (No Train on ML or YL) = B NOR C
X | A | Q |
---|---|---|
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
Pros:
Cons:
Progress on joiners
Idea | Player | Draft of idea | Testing | Completed | Remarks |
---|---|---|---|---|---|
Yield Line | scobos | Currently Editing |