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: amend ertms braking simulator interface #9911

Merged
merged 1 commit into from
Dec 3, 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
Expand Up @@ -11,28 +11,30 @@ interface ETCSBrakingSimulator {
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)
/** Compute the ETCS braking envelope from the MRSP, for each LOA and EOA. */
fun addETCSBrakingParts(
mrsp: Envelope,
limitsOfAuthority: Collection<LimitOfAuthority>,
endsOfAuthority: Collection<EndOfAuthority>
): Envelope
}

data class Target(
data class LimitOfAuthority(
val offset: Offset<Path>,
val speed: Double,
val type: TargetType = if (speed != 0.0) TargetType.SLOWDOWN else TargetType.STOP
)
) {
init {
assert(speed > 0)
}
}

enum class TargetType {
SLOWDOWN,
STOP
data class EndOfAuthority(
val offsetEOA: Offset<Path>,
val offsetSVL: Offset<Path>?,
) {
init {
if (offsetSVL != null) assert(offsetSVL >= offsetEOA)
}
}

class ETCSBrakingSimulatorImpl(
Expand All @@ -41,11 +43,11 @@ class ETCSBrakingSimulatorImpl(
override val timeStep: Double
) : ETCSBrakingSimulator {

override fun getETCSBrakingEnvelopeFromMrsp(mrsp: Envelope) {
TODO("Not yet implemented")
}

override fun getETCSBrakingEnvelopeFromTarget(target: Target) {
override fun addETCSBrakingParts(
mrsp: Envelope,
limitsOfAuthority: Collection<LimitOfAuthority>,
endsOfAuthority: Collection<EndOfAuthority>
): Envelope {
TODO("Not yet implemented")
}
}
Loading