brute force round robin.

This commit is contained in:
hal8174 2023-12-31 15:54:54 +01:00
parent 5d9926fba7
commit 9cb7e25149
4 changed files with 250 additions and 115 deletions

View file

@ -19,7 +19,7 @@ fn main() {
(Position::new(1, 7), Direction::Up),
);
b.set_blocked_range(0, 2, 5, 4, true);
b.set_blocked_range(0, 2, 5, 5, true);
// b.set_blocked_range(2, 0, 2, 2, true);
let mut b = b.build();
@ -28,23 +28,22 @@ fn main() {
println!("{}\n{}\n{}", b.count(), b.solution_count(), b);
}
// println!("{}\n{}\n{}", b.count(), b.solution_count(), b);
// b.next_state();
// println!("{}\n{}\n{}", b.count(), b.solution_count(), b);
// b.next_state();
// println!("{}\n{}\n{}", b.count(), b.solution_count(), b);
// b.next_state();
// println!("{}\n{}\n{}", b.count(), b.solution_count(), b);
// b.next_state();
// println!("{}\n{}\n{}", b.count(), b.solution_count(), b);
// b.next_state();
// println!("{}\n{}\n{}", b.count(), b.solution_count(), b);
// b.next_state();
// println!("{}\n{}\n{}", b.count(), b.solution_count(), b);
// b.next_state();
// println!("{}\n{}\n{}", b.count(), b.solution_count(), b);
// b.next_state();
// println!("{}\n{}\n{}", b.count(), b.solution_count(), b);
// b.next_state();
// println!("{}\n{}\n{}", b.count(), b.solution_count(), b);
// println!(
// "{}\n{}\n{}\n{}",
// b.count(),
// b.solution_count(),
// b.modify_pointer(),
// b
// );
// for i in 0..20 {
// b.next_state();
// println!(
// "{}\n{}\n{}\n{}",
// b.count(),
// b.solution_count(),
// b.modify_pointer(),
// b
// );
// }
}

View file

@ -1,42 +1,42 @@
use factorio_blueprint::belt_finding::{brute_force::BruteforceBuilder, Direction, Position};
fn main() {
let mut b = BruteforceBuilder::new(20, 5);
let mut b = BruteforceBuilder::new(14, 6);
b.add_path(
(Position::new(0, 0), Direction::Right),
(Position::new(19, 0), Direction::Right),
(Position::new(13, 0), Direction::Right),
);
b.add_path(
(Position::new(0, 1), Direction::Right),
(Position::new(19, 1), Direction::Right),
(Position::new(13, 1), Direction::Right),
);
b.add_path(
(Position::new(0, 2), Direction::Right),
(Position::new(19, 2), Direction::Right),
(Position::new(13, 2), Direction::Right),
);
b.add_path(
(Position::new(0, 3), Direction::Right),
(Position::new(19, 3), Direction::Right),
(Position::new(13, 3), Direction::Right),
);
b.add_path(
(Position::new(0, 4), Direction::Right),
(Position::new(19, 4), Direction::Right),
(Position::new(13, 4), Direction::Right),
);
// b.add_path(
// (Position::new(0, 5), Direction::Right),
// (Position::new(19, 5), Direction::Right),
// );
b.add_path(
(Position::new(0, 5), Direction::Right),
(Position::new(13, 5), Direction::Right),
);
b.set_blocked_range(4, 2, 16, 2, true);
b.set_blocked_range(7, 3, 10, 4, true);
// b.set_blocked_range(7, 2, 10, 2, true);
// b.set_blocked_range(7, 3, 10, 4, true);
// b.set_blocked_range(4, 0, 7, 2, true);
b.set_blocked_range(3, 2, 10, 3, true);
let mut b = b.build();
@ -45,4 +45,10 @@ fn main() {
println!("{}\n{}\n{}", b.count(), b.solution_count(), b);
}
println!("{}\n{}", b.count(), b.solution_count());
// println!("{}\n{}", b.count(), b);
// while b.next_state() {
// println!("{}\n{}", b.count(), b);
// }
}