Skip to content

Commit

Permalink
removed comments after speaking with Matt
Browse files Browse the repository at this point in the history
  • Loading branch information
calbaker committed Jan 14, 2025
1 parent 0bb559c commit 74c36ed
Showing 1 changed file with 12 additions and 25 deletions.
37 changes: 12 additions & 25 deletions rust/altrios-core/src/train/train_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -844,11 +844,7 @@ pub fn run_speed_limit_train_sims(
])
.sort_by_exprs(
vec![col("Arrival_Time_Actual_Hr"), col("Locomotive_ID")],
// TODO: Matt, please verify this next line and remove the subsequent commented lines
SortMultipleOptions::default(),
// vec![false, false],
// false,
// false,
)
.collect()
.with_context(|| format_dbg!())?;
Expand Down Expand Up @@ -883,13 +879,10 @@ pub fn run_speed_limit_train_sims(
while !done {
let arrivals_mask = arrival_times
.column("Arrival_Time_Actual_Hr")?
.equal(
// TODO: Matt, check if there's a better way to do this
&Column::new(
"current_time_const".into(),
vec![current_time; arrival_times.height()],
),
)
.equal(&Column::new(
"current_time_const".into(),
vec![current_time; arrival_times.height()],
))
.with_context(|| format_dbg!())?;
let arrivals = arrival_times
.clone()
Expand Down Expand Up @@ -1061,10 +1054,10 @@ pub fn run_speed_limit_train_sims(
let idx_mask = arrival_times
.column("TrainSimVec_Index")
.with_context(|| format_dbg!())?
.equal(
// TODO: Matt, check if there's a better way to do this
&Column::new("idx_const".into(), vec![idx as u32; arrival_times.height()]),
)
.equal(&Column::new(
"idx_const".into(),
vec![idx as u32; arrival_times.height()],
))
.with_context(|| format_dbg!())?;
let arrival_locos = arrival_times
.filter(&idx_mask)
Expand All @@ -1088,7 +1081,6 @@ pub fn run_speed_limit_train_sims(
let arrival_loco_indices: Vec<usize> = arrival_loco_mask
.into_iter()
.enumerate()
// TODO: Matt, help Chad figure out what to replace `unwrap_or_default` with
.filter(|(_, val)| val.unwrap_or_default())
.map(|(i, _)| i)
.collect();
Expand Down Expand Up @@ -1134,13 +1126,10 @@ pub fn run_speed_limit_train_sims(
& (loco_pool)
.column("Ready_Time_Est")
.with_context(|| format_dbg!())?
.equal(
// TODO: Matt, remove this `Column::new` if you find a better way
&Column::new(
"current_time_const".into(),
vec![current_time; refueling_mask.len()],
),
)
.equal(&Column::new(
"current_time_const".into(),
vec![current_time; refueling_mask.len()],
))
.with_context(|| format_dbg!())?;
let refueling_finished = loco_pool
.clone()
Expand All @@ -1166,8 +1155,6 @@ pub fn run_speed_limit_train_sims(
"Node",
"Locomotive_Type",
"Fuel_Type",
// TODO: Matt, please check that `cumsum(false)` that I removed
// from the next line was not doing anything important
])) + (col("Status").eq(lit("Queued")).over([
"Node",
"Locomotive_Type",
Expand Down

0 comments on commit 74c36ed

Please sign in to comment.