Coder Social home page Coder Social logo

Comments (4)

magicant avatar magicant commented on September 26, 2024

n 個先の閉塞の開始位置が dn [m] 先であるとする。2.5 [km/h/s] の減速度で減速していって dn - 30 [m] の位置までに停止できれば良いとすると、現在位置を通過できる速度の上限 vn [km/h] は何か? 等加速度**の公式に従えば、

vn = 3.6 √(2 (2.5 / 3.6) (dn - 30)) = √(18 (dn - 30))

さて、信号インデックス i の制限速度を li [km/h] とする。最終的に求めたいのは、 livn を満たす最大の i である。これを求めるには livn を満たし 0 より大きい i がいくつあるか数えればよい。ここで、 livn の時に 1 となりそれ以外の時に 0 となる式 D(i, n) があれば、それを全ての i について足し合わせることで、求めたかった信号インデックスが求められる。

その D(i, n) であるが、vn ≥ 0, li > 0であるから、 D(i, n) = min(1, floor(vn / li)) とすればよい。さらに、 v は高々数千 [km/h] だから、 D(i, n) = ceil(floor(vn / li) / 65536) とでもしておけば十分である。

from bve-random-map.

magicant avatar magicant commented on September 26, 2024

進行信号は二段階あって、見た目は同じだが次が進行か進行以外かで信号インデックスが違う。これに対応するには、ある閉塞を設置したときの信号インデックスを変数に覚えておいて、その一つ手前の閉塞を設置するときにそれを参照するとよい。(ただし、これは ATC では行わなくてよい)

先行列車が n 個先の閉塞にいるときの現在閉塞の信号インデックス (上の D(i, n) の和) を cn とする。そして先行列車の位置が同じ時での一つ先の閉塞の信号インデックスを fn とする。現在閉塞と一つ先の閉塞とで連続した進行信号となるときを考慮した現在閉塞の信号インデックスを hn とすると、これは以下のように求められる。

hn = cn + floor(fn / m)

ただし m は進行信号の信号インデックスである。ここでは m が 2 以上の整数であるという仮定を用いた。

from bve-random-map.

magicant avatar magicant commented on September 26, 2024

さらに、進行信号の次にいきなり警戒信号や停止信号が出てきたら面食らうので、隣り合う閉塞の信号インデックスの差は 2 以下に抑えることにする。そのために、ある閉塞を設置したときの信号インデックスを変数に覚えておいて、その一つ手前の閉塞を設置するときに差が大きくなり過ぎないように抑える。 (ただし、これは ATC では行わなくてよい)

信号インデックスの差が大きくなり過ぎないように抑えた信号インデックスを jn とすると、

jn = min(hn, fn + 2)

なお

min(x, y) = (x + y - abs(x - y)) / 2

from bve-random-map.

magicant avatar magicant commented on September 26, 2024

CS-ATC の場合は、信号インデックスが一閉塞づつずれる。

例えば、n 番目の閉塞に先行列車がいる場合、n - 1 番目の閉塞の信号インデックスは 10 (= ATC 01 信号) となる。自車が n - 1 番目の閉塞に進入したときに n 番目の閉塞より手前で止まれる上限の速度を v [km/h] とすると、n - 2 番目の閉塞の信号インデックスは対応する速度が v 以下の最も大きな信号インデックスとなる。それは、ATC でない路線において n - 1 番目の閉塞に設定される信号インデックスに等しい。

from bve-random-map.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.