-
Notifications
You must be signed in to change notification settings - Fork 44
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
editoast: stdcm fix train simulation #9660
base: dev
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## dev #9660 +/- ##
==========================================
- Coverage 38.22% 38.20% -0.02%
==========================================
Files 995 995
Lines 91910 91961 +51
Branches 1193 1193
==========================================
+ Hits 35128 35136 +8
- Misses 56327 56370 +43
Partials 455 455
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
f0f89c1
to
e5e6b33
Compare
e5e6b33
to
fbf7d12
Compare
bedcaf7
to
54c85fb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have three functions (train_simulation_batch
, get_train_batch_simulation
and consist_train_simulation_batch
). Only two of them are required.
train_simulation_batch(&[TrainSchedule])
- Retrieve rolling stocks from
rolling_stock_name
field` - Convert this rolling stocks into
PhysicsConsistParameters
- Call
consist_train_simulation_batch
- Retrieve rolling stocks from
consist_train_simulation_batch(&[TrainScheduleWithPhysicsConsist])
- Check valkey cache
- Call the pathfinding
- Cal the simulation
- Cache the response
- Return the response
editoast/src/views/train_schedule.rs
Outdated
conn: &mut DbConnection, | ||
valkey_client: Arc<ValkeyClient>, | ||
core: Arc<CoreClient>, | ||
train_schedules: &[TrainSchedule], | ||
infra: &Infra, | ||
electrical_profile_set_id: Option<i64>, | ||
physics_consist_parameters: PhysicsConsistParameters, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This parameter must be set for each train schedule, not globaly.
The consist_train_simulation_batch
should be the function that actually do the simulation.
editoast/src/views/train_schedule.rs
Outdated
train_schedules: &[TrainSchedule], | ||
rolling_stocks: HashMap<String, RollingStockModel>, | ||
pathfinding_results: Vec<PathfindingResult>, | ||
electrical_profile_set_id: Option<i64>, | ||
physics_consist_parameters: Option<PhysicsConsistParameters>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
train_schedules: &[TrainSchedule], | |
rolling_stocks: HashMap<String, RollingStockModel>, | |
pathfinding_results: Vec<PathfindingResult>, | |
electrical_profile_set_id: Option<i64>, | |
physics_consist_parameters: Option<PhysicsConsistParameters>, | |
train_schedules: &[TrainSchedule], | |
pathfinding_results: Vec<PathfindingResult>, | |
electrical_profile_set_id: Option<i64>, |
The get_train_batch_simulation
should simply build the PhysicsConsistParameters from the rolling stock names then call the consist_train_simulation_batch
editoast/src/views/train_schedule.rs
Outdated
/// Compute in batch the simulation of a list of train schedule | ||
/// | ||
/// Note: The order of the returned simulations is the same as the order of the train schedules. | ||
pub async fn train_simulation_batch( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The train_simulation_batch
should simply build the PhysicsConsistParameters from the rolling stock names then call the consist_train_simulation_batch
54c85fb
to
6339879
Compare
e76a0cc
to
463e084
Compare
Signed-off-by: Egor Berezovskiy <egor@berezify.fr>
Signed-off-by: Egor Berezovskiy <egor@berezify.fr>
463e084
to
9fa4b7f
Compare
fix #9544