Skip to content

Commit

Permalink
core: add ertms braking simulator interface
Browse files Browse the repository at this point in the history
Signed-off-by: Erashin <[email protected]>
  • Loading branch information
Erashin committed Nov 20, 2024
1 parent 83fbe09 commit 9850dff
Showing 1 changed file with 52 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
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")
}

}

0 comments on commit 9850dff

Please sign in to comment.