Add factory generator
This commit is contained in:
parent
295490858b
commit
6fbff67e61
14 changed files with 308 additions and 15 deletions
|
|
@ -267,7 +267,7 @@ impl ConflictAvoidance {
|
|||
while b.next_finish_state(timeout) {
|
||||
// println!("{}", b);
|
||||
// b.print();
|
||||
b.print_visualization();
|
||||
// b.print_visualization();
|
||||
let c = b.cost();
|
||||
if c < min_cost {
|
||||
min_cost = c;
|
||||
|
|
|
|||
|
|
@ -40,13 +40,14 @@ impl SinglePathfinder for ConflictAvoidance {
|
|||
);
|
||||
}
|
||||
|
||||
p.print_visualization();
|
||||
// p.print_visualization();
|
||||
|
||||
if p.find_path() {
|
||||
let mut c = conflict_avoidance::ConflictAvoidance::new(&p);
|
||||
c.print_visualization();
|
||||
// c.print_visualization();
|
||||
|
||||
if c.remove_all_conflicts(self.timeout) {
|
||||
c.print_visualization();
|
||||
Some(c.get_paths().to_vec())
|
||||
} else {
|
||||
None
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ where
|
|||
start_dir: c.start_dir,
|
||||
end_pos: c
|
||||
.end_pos
|
||||
.in_direction(&c.start_dir.clockwise(), i as PositionType),
|
||||
.in_direction(&c.end_dir.clockwise(), i as PositionType),
|
||||
end_dir: c.end_dir,
|
||||
beltspeed: c.beltspeed,
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue