tuning kinematic model for roundabouts

This commit is contained in:
Arndt Brenschede 2019-10-01 18:48:40 +02:00
parent dbf1479da4
commit 5668f36626
5 changed files with 16 additions and 13 deletions

View file

@ -23,7 +23,7 @@ final class KinematicModel extends OsmPathModel
return new KinematicPath(); return new KinematicPath();
} }
public double turnAngleDecayLength; public double turnAngleDecayTime;
public double f_roll; public double f_roll;
public double f_air; public double f_air;
public double f_recup; public double f_recup;
@ -70,7 +70,7 @@ final class KinematicModel extends OsmPathModel
params = extraParams; params = extraParams;
turnAngleDecayLength = getParam( "turnAngleDecayLength", 50.f ); turnAngleDecayTime = getParam( "turnAngleDecayTime", 5.f );
f_roll = getParam( "f_roll", 232.f ); f_roll = getParam( "f_roll", 232.f );
f_air = getParam( "f_air", 0.4f ); f_air = getParam( "f_air", 0.4f );
f_recup = getParam( "f_recup", 400.f ); f_recup = getParam( "f_recup", 400.f );

View file

@ -58,22 +58,22 @@ final class KinematicPath extends OsmPath
{ {
double turnspeed = 999.; // just high double turnspeed = 999.; // just high
if ( km.turnAngleDecayLength != 0. ) // process turn-angle slowdown if ( km.turnAngleDecayTime != 0. ) // process turn-angle slowdown
{ {
double decayFactor = FastMath.exp( - dist / km.turnAngleDecayLength );
floatingAngleLeft = (float)( floatingAngleLeft * decayFactor );
floatingAngleRight = (float)( floatingAngleRight * decayFactor );
if ( angle < 0 ) floatingAngleLeft -= (float)angle; if ( angle < 0 ) floatingAngleLeft -= (float)angle;
else floatingAngleRight += (float)angle; else floatingAngleRight += (float)angle;
float aa = Math.max( floatingAngleLeft, floatingAngleRight ); float aa = Math.max( floatingAngleLeft, floatingAngleRight );
if ( aa > 130. ) turnspeed = 0.; double curveSpeed = aa > 10. ? 200. / aa : 20.;
else if ( aa > 100. ) turnspeed = 1.; double distanceTime = dist / curveSpeed;
else if ( aa > 70. ) turnspeed = 2.; double decayFactor = FastMath.exp( - distanceTime / km.turnAngleDecayTime );
else if ( aa > 50. ) turnspeed = 4.; floatingAngleLeft = (float)( floatingAngleLeft * decayFactor );
else if ( aa > 30. ) turnspeed = 8.; floatingAngleRight = (float)( floatingAngleRight * decayFactor );
else if ( aa > 20. ) turnspeed = 14.;
else if ( aa > 10. ) turnspeed = 20.; if ( curveSpeed < 20. )
{
turnspeed = curveSpeed;
}
} }
if ( nsection == 0 ) // process slowdown by crossing geometry if ( nsection == 0 ) // process slowdown by crossing geometry

View file

@ -267,4 +267,5 @@ assign maxspeed =
switch greater way:priorityclassifier 22 3 switch greater way:priorityclassifier 22 3
switch greater way:priorityclassifier 20 1 switch greater way:priorityclassifier 20 1
0 0
else if railway=level_crossing then 0
else 999 else 999

View file

@ -267,4 +267,5 @@ assign maxspeed =
switch greater way:priorityclassifier 22 3 switch greater way:priorityclassifier 22 3
switch greater way:priorityclassifier 20 1 switch greater way:priorityclassifier 20 1
0 0
else if railway=level_crossing then 0
else 999 else 999

View file

@ -267,4 +267,5 @@ assign maxspeed =
switch greater way:priorityclassifier 22 3 switch greater way:priorityclassifier 22 3
switch greater way:priorityclassifier 20 1 switch greater way:priorityclassifier 20 1
0 0
else if railway=level_crossing then 0
else 999 else 999