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();
}
public double turnAngleDecayLength;
public double turnAngleDecayTime;
public double f_roll;
public double f_air;
public double f_recup;
@ -70,7 +70,7 @@ final class KinematicModel extends OsmPathModel
params = extraParams;
turnAngleDecayLength = getParam( "turnAngleDecayLength", 50.f );
turnAngleDecayTime = getParam( "turnAngleDecayTime", 5.f );
f_roll = getParam( "f_roll", 232.f );
f_air = getParam( "f_air", 0.4f );
f_recup = getParam( "f_recup", 400.f );

View file

@ -58,22 +58,22 @@ final class KinematicPath extends OsmPath
{
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;
else floatingAngleRight += (float)angle;
float aa = Math.max( floatingAngleLeft, floatingAngleRight );
if ( aa > 130. ) turnspeed = 0.;
else if ( aa > 100. ) turnspeed = 1.;
else if ( aa > 70. ) turnspeed = 2.;
else if ( aa > 50. ) turnspeed = 4.;
else if ( aa > 30. ) turnspeed = 8.;
else if ( aa > 20. ) turnspeed = 14.;
else if ( aa > 10. ) turnspeed = 20.;
double curveSpeed = aa > 10. ? 200. / aa : 20.;
double distanceTime = dist / curveSpeed;
double decayFactor = FastMath.exp( - distanceTime / km.turnAngleDecayTime );
floatingAngleLeft = (float)( floatingAngleLeft * decayFactor );
floatingAngleRight = (float)( floatingAngleRight * decayFactor );
if ( curveSpeed < 20. )
{
turnspeed = curveSpeed;
}
}
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 20 1
0
else if railway=level_crossing then 0
else 999

View file

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

View file

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