Rewrote path selection for conflict avoidance.

This commit is contained in:
hal8174 2024-02-17 02:42:38 +01:00
parent 8f6809c17f
commit 7fdf32342a
8 changed files with 514 additions and 439 deletions

View file

@ -15,6 +15,7 @@ enum ProblemCase {
Level1,
Level2,
Level3,
Level5,
}
impl ProblemCase {
@ -23,6 +24,7 @@ impl ProblemCase {
ProblemCase::Level1 => problems::belt_madness_level_1(),
ProblemCase::Level2 => problems::belt_madness_level_2(),
ProblemCase::Level3 => problems::belt_madness_level_3(),
ProblemCase::Level5 => problems::belt_madness_level_5(),
}
}
}
@ -31,7 +33,7 @@ impl ProblemCase {
struct Args {
#[arg(value_enum, default_value = "level1")]
problem: ProblemCase,
#[arg(value_enum, default_value = "solve")]
#[arg(value_enum, default_value = "conflict-avoidance")]
mode: Mode,
}
@ -47,6 +49,12 @@ fn main() {
println!("{}", p);
}
Mode::ConflictAvoidance => {
println!("{}", p);
p.find_path();
println!("{}", p);
p.find_path();
println!("{}", p);
p.find_path();
println!("{}", p);
p.find_path();
println!("{}", p);
@ -57,6 +65,12 @@ fn main() {
}
}
Mode::ConflictStep => {
println!("{}", p);
p.find_path();
println!("{}", p);
p.find_path();
println!("{}", p);
p.find_path();
println!("{}", p);
p.find_path();
println!("{}", p);