News:

SimuTranslator
Make Simutrans speak your language.

Viewing curve speed limits and calculating acceleration time/distance

Started by dannyliux, January 01, 2020, 10:27:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Spenk009

It works very well on my Ubuntu machine, compiled from the suggested branch and run on a fresh copy of PakBritain-Ex (compiled without issues):



Would it make sense to show speed reached in lower increments if vmax is not shown on the graph? Example: The lower two graphs are from a GWR 3700 Class that can reach up to 150km/h, would it be helpful to show at least twice or quadruple the distance in "v-t graph"?

OS: Ubuntu 20.04.1 LTS x86_64
Host: 20EFS01B01 ThinkPad W541
Kernel: 5.4.0-52-generic
Uptime: 4 days, 23 hours, 3 mins
Packages: 2716 (dpkg), 6 (snap)
Shell: bash 5.0.17
Resolution: 2880x1620
DE: Plasma
WM: KWin
Theme: Breeze [Plasma], Breeze [GTK2/3]
Icons: breeze [Plasma], breeze [GTK2/3]
Terminal: konsole
CPU: Intel i7-4810MQ (8) @ 3.800GHz
GPU: NVIDIA Quadro K2100M
GPU: Intel 4th Gen Core Processor
Memory: 9147MiB / 17686MiB

Ranran

I'm sorry. This is a derivative of the r8653 branch, but I haven't merged the changes in r8653 branch yet.

freddyhayward

This is the error: In file included from /usr/include/c++/10/bits/stl_iterator_base_types.h:67,
                 from /usr/include/c++/10/iterator:61,
                 from bauer/../utils/../utils/for.h:10,
                 from bauer/../utils/../simtypes.h:13,
                 from bauer/../utils/log.h:12,
                 from bauer/../simdebug.h:21,
                 from bauer/brueckenbauer.cc:8:
/usr/include/c++/10/type_traits: In instantiation of 'struct std::is_move_constructible<sparse_tpl<short unsigned int> >':
/usr/include/c++/10/type_traits:138:12:   required from 'struct std::__and_<std::is_move_constructible<sparse_tpl<short unsigned int> >, std::is_move_assignable<sparse_tpl<short unsigned int> > >'
/usr/include/c++/10/type_traits:143:12:   required from 'struct std::__and_<std::__not_<std::__is_tuple_like<sparse_tpl<short unsigned int> > >, std::is_move_constructible<sparse_tpl<short unsigned int> >, std::is_move_assignable<sparse_tpl<short unsigned int> > >'
/usr/include/c++/10/type_traits:2195:11:   required by substitution of 'template<class ... _Cond> using _Require = std::__enable_if_t<std::__and_< <template-parameter-1-1> >::value> [with _Cond = {std::__not_<std::__is_tuple_like<sparse_tpl<short unsigned int> > >, std::is_move_constructible<sparse_tpl<short unsigned int> >, std::is_move_assignable<sparse_tpl<short unsigned int> >}]'
/usr/include/c++/10/bits/move.h:189:5:   required by substitution of 'template<class _Tp> std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = sparse_tpl<short unsigned int>]'
bauer/../obj/../tpl/sparse_tpl.h:242:15:   required from 'class sparse_tpl<short unsigned int>'
bauer/../obj/../simcity.h:171:21:   required from here
/usr/include/c++/10/type_traits:960:52: error: static assertion failed: template argument must be a complete class or an unbounded array
  960 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),

jamespetts

Quote from: Ranran on November 01, 2020, 02:19:35 PM
I'm sorry. This is a derivative of the r8653 branch, but I haven't merged the changes in r8653 branch yet.

Excellent, thank you: please let me know when you have merged these changes so that I can start work in testing this.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ranran


freddyhayward

Quote from: Ranran on November 01, 2020, 03:20:59 PM
accel-curve-chart-v2 branch is now up to date.
It compiles, runs, doesn't crash, and its new location in the tabs make sense! Thank you!

Ranran

Thank you for your confirmation. This patch can now move forward.  :)

Vladki

I see the accel graphs in new tab in convoy dialog. Looks good. Is this considered finished?

PJMack

To answer that question on curve speed limits, I inserted a spreadsheet below (It will need to be copied and pasted into Calc as unformatted text).  To determine that max speed of a vehicle on the curve, determine the number of tiles backwards, or "steps," for curves of self corecting 45 degress as well as continuous 90, 135, and 180 degree curves.  For non-tilting vehicles, simply use the minimum speed for the number of steps associated with four step values found.  For example if a vehicle took 4 steps to turn from 90 degrees, and 5 steps to turn from 135 degrees, the speed limit would be 42kph.  For tilting vehicles, check that the minimum radius on the chart is less than the tilting_min_radius_effect, and if it is, multiplier the non-tilting speed by 130  / 100 (the "speed with tilt" columns have such multiplication done out).  The chart is configurable and with the values in row 2, which are set below as the default for rail vehicles in pack128.britain.  For trucks and trams, such packset has corner force dividers of 5 and 8 respectivly.

assumed_curve_radius_45_degrees,,meters_per_tile,,corner_force_divider,,tilting_min_radius_effect,,,,,,,,,
750,,125,,10,,375,,,,,,,,,
,,,,,,,,,,,,,,,
Steps:,Radius,,,,Speed,,,,Speed with tilt,,,,,,
,45?-45?,90?,135?,180?,45?-45?,90?,135?,180?,45?-45?,90?,135?,180?,,Vehicle Top Speed (kph),Max Steps
1,"=MAX($A$2,$A6 * $C$2)",=FLOOR($A6 * $C$2 / 2),=FLOOR($A6 * $C$2 / 3),"=FLOOR(MAX(1,FLOOR($A6 / 2)) * $C$2 / 2)",=FLOOR(SQRT(FLOOR(87 * B6 / $E$2))),,,,"=IF(B6<$G$2,'',FLOOR(F6*1.3))",,,,,5,=FLOOR(FLOOR(O6*O6 * $E$2 / 87) / $C$2) * 2
=A6+1,"=MAX($A$2,$A7 * $C$2)",=FLOOR($A7 * $C$2 / 2),=FLOOR($A7 * $C$2 / 3),"=FLOOR(MAX(1,FLOOR($A7 / 2)) * $C$2 / 2)",=FLOOR(SQRT(FLOOR(87 * B7 / $E$2))),=FLOOR(SQRT(FLOOR(87 * C7 / $E$2))),,,"=IF(B7<$G$2,"""",FLOOR(F7*1.3))","=IF(C7<$G$2,"""",FLOOR(G7*1.3))",,,,=O6+5,=FLOOR(FLOOR(O7*O7 * $E$2 / 87) / $C$2) * 2
=A7+1,"=MAX($A$2,$A8 * $C$2)",=FLOOR($A8 * $C$2 / 2),=FLOOR($A8 * $C$2 / 3),"=FLOOR(MAX(1,FLOOR($A8 / 2)) * $C$2 / 2)",=FLOOR(SQRT(FLOOR(87 * B8 / $E$2))),=FLOOR(SQRT(FLOOR(87 * C8 / $E$2))),=FLOOR(SQRT(FLOOR(87 * D8 / $E$2))),=FLOOR(SQRT(FLOOR(87 * E8 / $E$2))),"=IF(B8<$G$2,"""",FLOOR(F8*1.3))","=IF(C8<$G$2,"""",FLOOR(G8*1.3))","=IF(D8<$G$2,"""",FLOOR(H8*1.3))","=IF(E8<$G$2,"""",FLOOR(I8*1.3))",,=O7+5,=FLOOR(FLOOR(O8*O8 * $E$2 / 87) / $C$2) * 2
=A8+1,"=MAX($A$2,$A9 * $C$2)",=FLOOR($A9 * $C$2 / 2),=FLOOR($A9 * $C$2 / 3),"=FLOOR(MAX(1,FLOOR($A9 / 2)) * $C$2 / 2)",=FLOOR(SQRT(FLOOR(87 * B9 / $E$2))),=FLOOR(SQRT(FLOOR(87 * C9 / $E$2))),=FLOOR(SQRT(FLOOR(87 * D9 / $E$2))),=FLOOR(SQRT(FLOOR(87 * E9 / $E$2))),"=IF(B9<$G$2,"""",FLOOR(F9*1.3))","=IF(C9<$G$2,"""",FLOOR(G9*1.3))","=IF(D9<$G$2,"""",FLOOR(H9*1.3))","=IF(E9<$G$2,"""",FLOOR(I9*1.3))",,=O8+5,=FLOOR(FLOOR(O9*O9 * $E$2 / 87) / $C$2) * 2
=A9+1,"=MAX($A$2,$A10 * $C$2)",=FLOOR($A10 * $C$2 / 2),=FLOOR($A10 * $C$2 / 3),"=FLOOR(MAX(1,FLOOR($A10 / 2)) * $C$2 / 2)",=FLOOR(SQRT(FLOOR(87 * B10 / $E$2))),=FLOOR(SQRT(FLOOR(87 * C10 / $E$2))),=FLOOR(SQRT(FLOOR(87 * D10 / $E$2))),=FLOOR(SQRT(FLOOR(87 * E10 / $E$2))),"=IF(B10<$G$2,"""",FLOOR(F10*1.3))","=IF(C10<$G$2,"""",FLOOR(G10*1.3))","=IF(D10<$G$2,"""",FLOOR(H10*1.3))","=IF(E10<$G$2,"""",FLOOR(I10*1.3))",,=O9+5,=FLOOR(FLOOR(O10*O10 * $E$2 / 87) / $C$2) * 2
=A10+1,"=MAX($A$2,$A11 * $C$2)",=FLOOR($A11 * $C$2 / 2),=FLOOR($A11 * $C$2 / 3),"=FLOOR(MAX(1,FLOOR($A11 / 2)) * $C$2 / 2)",=FLOOR(SQRT(FLOOR(87 * B11 / $E$2))),=FLOOR(SQRT(FLOOR(87 * C11 / $E$2))),=FLOOR(SQRT(FLOOR(87 * D11 / $E$2))),=FLOOR(SQRT(FLOOR(87 * E11 / $E$2))),"=IF(B11<$G$2,"""",FLOOR(F11*1.3))","=IF(C11<$G$2,"""",FLOOR(G11*1.3))","=IF(D11<$G$2,"""",FLOOR(H11*1.3))","=IF(E11<$G$2,"""",FLOOR(I11*1.3))",,=O10+5,=FLOOR(FLOOR(O11*O11 * $E$2 / 87) / $C$2) * 2


edit: I can only post the first few rows of the sheet, however all remaining rows are the same as the bottom posted row, up to 192 steps.

Ranran

As suggested somewhere before, I think we can divide the car body tilt angle into multiple levels (or the angle itself).