brute force round robin.
This commit is contained in:
parent
5d9926fba7
commit
9cb7e25149
4 changed files with 250 additions and 115 deletions
|
|
@ -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);
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue