Add criterion benchmark
This commit is contained in:
parent
9cb7e25149
commit
6c2c34f9a3
6 changed files with 520 additions and 6 deletions
|
|
@ -7,7 +7,7 @@ use crate::misc::Map;
|
|||
|
||||
use super::{Direction, Position, COLORS};
|
||||
|
||||
#[derive(Default)]
|
||||
#[derive(Default, Clone)]
|
||||
pub struct BruteforceField {
|
||||
pub blocked: bool,
|
||||
underground_vertical: bool,
|
||||
|
|
@ -53,6 +53,7 @@ impl PathField {
|
|||
|
||||
static MAX_UNDERGROUND_LENGTH: u8 = 6;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct BruteforceBuilder {
|
||||
map: Map<BruteforceField>,
|
||||
path: Vec<[(Position, Direction); 2]>,
|
||||
|
|
@ -110,6 +111,7 @@ impl BruteforceBuilder {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
struct Problem {
|
||||
path: Vec<PathField>,
|
||||
end_pos: Position,
|
||||
|
|
@ -117,6 +119,7 @@ struct Problem {
|
|||
finished: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Bruteforce {
|
||||
map: Map<BruteforceField>,
|
||||
problems: Vec<Problem>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue