14
14
import fr .sncf .osrd .envelope .part .constraints .EnvelopeConstraint ;
15
15
import fr .sncf .osrd .envelope .part .constraints .EnvelopePartConstraint ;
16
16
import fr .sncf .osrd .envelope .part .constraints .PositionConstraint ;
17
+ import fr .sncf .osrd .envelope_sim .EnvelopeProfile ;
17
18
import fr .sncf .osrd .envelope_sim .EnvelopeSimContext ;
18
19
import fr .sncf .osrd .envelope_sim .PhysicsRollingStock ;
19
20
import fr .sncf .osrd .envelope_sim .allowances .utils .AllowanceRange ;
@@ -157,7 +158,7 @@ private Envelope[] computeAllowanceRegion(Envelope envelopeRegion, EnvelopeSimCo
157
158
var range = ranges .get (i );
158
159
var percentage = range .value .getAllowanceRatio (
159
160
envelopeRegion .getTimeBetween (range .beginPos , range .endPos ),
160
- range .beginPos - range .endPos
161
+ range .endPos - range .beginPos
161
162
);
162
163
rangePercentages [i ] = new RangePercentage (range , percentage );
163
164
}
@@ -401,6 +402,7 @@ private EnvelopePart computeLeftJunction(Envelope envelopeSection,
401
402
EnvelopeDeceleration .decelerate (
402
403
context , envelopeSection .getBeginPos (), imposedBeginSpeed , constrainedBuilder , 1
403
404
);
405
+ partBuilder .setAttr (EnvelopeProfile .BRAKING );
404
406
lastIntersection = constrainedBuilder .lastIntersection ;
405
407
} else if (imposedBeginSpeed < envelopeSection .getBeginSpeed ()) {
406
408
constraints .add (new EnvelopeConstraint (envelopeTarget , CEILING ));
@@ -412,6 +414,7 @@ private EnvelopePart computeLeftJunction(Envelope envelopeSection,
412
414
EnvelopeAcceleration .accelerate (
413
415
context , envelopeSection .getBeginPos (), imposedBeginSpeed , constrainedBuilder , 1
414
416
);
417
+ partBuilder .setAttr (EnvelopeProfile .ACCELERATING );
415
418
lastIntersection = constrainedBuilder .lastIntersection ;
416
419
}
417
420
if (lastIntersection == 0 ) {
@@ -449,6 +452,7 @@ private EnvelopePart computeRightJunction(Envelope envelopeSection,
449
452
EnvelopeAcceleration .accelerate (
450
453
context , envelopeSection .getEndPos (), imposedEndSpeed , constrainedBuilder , -1
451
454
);
455
+ partBuilder .setAttr (EnvelopeProfile .ACCELERATING );
452
456
lastIntersection = constrainedBuilder .lastIntersection ;
453
457
} else if (imposedEndSpeed < envelopeSection .getEndSpeed ()) {
454
458
constraints .add (new EnvelopeConstraint (envelopeTarget , CEILING ));
@@ -459,6 +463,7 @@ private EnvelopePart computeRightJunction(Envelope envelopeSection,
459
463
EnvelopeDeceleration .decelerate (
460
464
context , envelopeSection .getEndPos (), imposedEndSpeed , constrainedBuilder , -1
461
465
);
466
+ partBuilder .setAttr (EnvelopeProfile .BRAKING );
462
467
lastIntersection = constrainedBuilder .lastIntersection ;
463
468
}
464
469
if (lastIntersection == 0 ) {
0 commit comments