-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core: add ertms braking simulator interface
Signed-off-by: Erashin <alwenn.charpentier@gmail.com>
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
core/src/main/kotlin/fr/sncf/osrd/ertms/etcs/ETCSBrakingSimulator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package fr.sncf.osrd.ertms.etcs | ||
|
||
import fr.sncf.osrd.envelope.Envelope | ||
import fr.sncf.osrd.sim_infra.api.Path | ||
import fr.sncf.osrd.sim_infra.api.PathProperties | ||
import fr.sncf.osrd.train.RollingStock | ||
import fr.sncf.osrd.utils.units.Offset | ||
|
||
interface ETCSBrakingSimulator { | ||
val trainPath: PathProperties | ||
val rollingStock: RollingStock | ||
val timeStep: Double | ||
|
||
/** | ||
* Compute the ETCS braking envelope from the MRSP: for each decreasing speed transition, | ||
* compute the corresponding ETCS braking curve. | ||
*/ | ||
fun getETCSBrakingEnvelopeFromMrsp(mrsp: Envelope) | ||
|
||
/** | ||
* Compute the ETCS braking envelope from target: compute the corresponding ETCS braking curve | ||
* decreasing from rolling stock max speed and ending at target offset/speed-wise. | ||
*/ | ||
fun getETCSBrakingEnvelopeFromTarget(target: Target) | ||
} | ||
|
||
data class Target( | ||
val offset: Offset<Path>, | ||
val speed: Double, | ||
val type: TargetType = if (speed != 0.0) TargetType.SLOWDOWN else TargetType.STOP | ||
) | ||
|
||
enum class TargetType { | ||
SLOWDOWN, | ||
STOP | ||
} | ||
|
||
class ETCSBrakingSimulatorImpl( | ||
override val trainPath: PathProperties, | ||
override val rollingStock: RollingStock, | ||
override val timeStep: Double | ||
) : ETCSBrakingSimulator { | ||
|
||
override fun getETCSBrakingEnvelopeFromMrsp(mrsp: Envelope) { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
override fun getETCSBrakingEnvelopeFromTarget(target: Target) { | ||
TODO("Not yet implemented") | ||
} | ||
} |