16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 16:19:19 +02:00

improved consistency of simulation updates, reduction of random factor in acceleration calculations

This commit is contained in:
tmj-fstate
2017-09-05 22:19:46 +02:00
parent 2446468038
commit 2324ae5eda
9 changed files with 115 additions and 34 deletions

View File

@@ -1094,6 +1094,7 @@ void TMoverParameters::CollisionDetect(int CouplerN, double dt)
coupler.Connected->Couplers[0].CouplingFlag = 0;
break;
}
WriteLog( "Bad driving: " + Name + " broke a coupler" );
}
}
}
@@ -1268,11 +1269,13 @@ double TMoverParameters::ComputeMovement(double dt, double dt1, const TTrackShap
AccN = g * Shape.dHrail / TrackW;
// szarpanie
if (FuzzyLogic((10.0 + Track.DamageFlag) * Mass * Vel / Vmax, 500000.0,
p_accn)) // Ra: czemu tu masa bez ładunku?
AccV = sqrt((1.0 + Track.DamageFlag) * Random(floor(50.0 * Mass / 1000000.0)) * Vel /
(Vmax * (10.0 + (Track.QualityFlag & 31))));
#ifdef EU07_USE_FUZZYLOGIC
if( FuzzyLogic( ( 10.0 + Track.DamageFlag ) * Mass * Vel / Vmax, 500000.0, p_accn ) ) {
// Ra: czemu tu masa bez ładunku?
AccV /= ( 2.0 * 0.95 + 2.0 * Random() * 0.1 ); // 95-105% of base modifier (2.0)
}
else
#endif
AccV = AccV / 2.0;
if (AccV > 1.0)
@@ -1438,12 +1441,13 @@ double TMoverParameters::FastComputeMovement(double dt, const TTrackShape &Shape
// else AccN:=g*Shape.dHrail/TrackW;
// szarpanie}
if (FuzzyLogic((10.0 + Track.DamageFlag) * Mass * Vel / Vmax, 500000.0, p_accn))
{
AccV = sqrt((1.0 + Track.DamageFlag) * Random(floor(50.0 * Mass / 1000000.0)) * Vel /
(Vmax * (10.0 + (Track.QualityFlag & 31)))); // Trunc na floor, czy dobrze?
#ifdef EU07_USE_FUZZYLOGIC
if( FuzzyLogic( ( 10.0 + Track.DamageFlag ) * Mass * Vel / Vmax, 500000.0, p_accn ) ) {
// Ra: czemu tu masa bez ładunku?
AccV /= ( 2.0 * 0.95 + 2.0 * Random() * 0.1 ); // 95-105% of base modifier (2.0)
}
else
#endif
AccV = AccV / 2.0;
if (AccV > 1.0)