Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: add ertms braking simulator interface #9794

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
}
}
Loading