Skip to content

Commit

Permalink
nb nodes explored so far
Browse files Browse the repository at this point in the history
  • Loading branch information
pschaus committed Aug 28, 2024
1 parent b2e68bf commit f3d4c96
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ddo/src/abstraction/solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,8 @@ pub trait Solver {

(u - l) as f32 / u as f32
}
}
}

/// Returns the number of nodes that have been explored during the search.
fn explored() -> usize;
}
5 changes: 5 additions & 0 deletions ddo/src/implementation/solver/parallel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ where

WorkLoad::WorkItem { node: nn }
}

}

impl<'a, State, D, C> Solver for ParallelSolver<'a, State, D, C>
Expand Down Expand Up @@ -633,6 +634,10 @@ where
critical.best_lb = value;
}
}
/// Returns the number of nodes that have been explored so far.
fn explored(&self) -> usize {

Check failure on line 638 in ddo/src/implementation/solver/parallel.rs

View workflow job for this annotation

GitHub Actions / build

method `explored` has a `&self` declaration in the impl, but not in the trait

Check failure on line 638 in ddo/src/implementation/solver/parallel.rs

View workflow job for this annotation

GitHub Actions / run_tests

method `explored` has a `&self` declaration in the impl, but not in the trait

Check failure on line 638 in ddo/src/implementation/solver/parallel.rs

View workflow job for this annotation

GitHub Actions / coverage

method `explored` has a `&self` declaration in the impl, but not in the trait

Check failure on line 638 in ddo/src/implementation/solver/parallel.rs

View workflow job for this annotation

GitHub Actions / clippy

method `explored` has a `&self` declaration in the impl, but not in the trait

error[E0185]: method `explored` has a `&self` declaration in the impl, but not in the trait --> ddo/src/implementation/solver/parallel.rs:638:5 | 638 | fn explored(&self) -> usize { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&self` used in impl | ::: ddo/src/abstraction/solver.rs:96:5 | 96 | fn explored() -> usize; | ----------------------- trait method declared without `&self`

Check failure on line 638 in ddo/src/implementation/solver/parallel.rs

View workflow job for this annotation

GitHub Actions / clippy

method `explored` has a `&self` declaration in the impl, but not in the trait

error[E0185]: method `explored` has a `&self` declaration in the impl, but not in the trait --> ddo/src/implementation/solver/parallel.rs:638:5 | 638 | fn explored(&self) -> usize { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&self` used in impl | ::: ddo/src/abstraction/solver.rs:96:5 | 96 | fn explored() -> usize; | ----------------------- trait method declared without `&self`
self.shared.critical.lock().explored
}
}


Expand Down
5 changes: 5 additions & 0 deletions ddo/src/implementation/solver/sequential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ where

WorkLoad::WorkItem { node: nn }
}

}

impl<'a, State, D, C> Solver for SequentialSolver<'a, State, D, C>
Expand Down Expand Up @@ -518,6 +519,10 @@ where
self.best_lb = value;
}
}
/// Returns the number of nodes that have been explored so far.
fn explored(&self) -> usize {

Check failure on line 523 in ddo/src/implementation/solver/sequential.rs

View workflow job for this annotation

GitHub Actions / build

method `explored` has a `&self` declaration in the impl, but not in the trait

Check failure on line 523 in ddo/src/implementation/solver/sequential.rs

View workflow job for this annotation

GitHub Actions / run_tests

method `explored` has a `&self` declaration in the impl, but not in the trait

Check failure on line 523 in ddo/src/implementation/solver/sequential.rs

View workflow job for this annotation

GitHub Actions / coverage

method `explored` has a `&self` declaration in the impl, but not in the trait

Check failure on line 523 in ddo/src/implementation/solver/sequential.rs

View workflow job for this annotation

GitHub Actions / clippy

method `explored` has a `&self` declaration in the impl, but not in the trait

error[E0185]: method `explored` has a `&self` declaration in the impl, but not in the trait --> ddo/src/implementation/solver/sequential.rs:523:5 | 523 | fn explored(&self) -> usize { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&self` used in impl | ::: ddo/src/abstraction/solver.rs:96:5 | 96 | fn explored() -> usize; | ----------------------- trait method declared without `&self`

Check failure on line 523 in ddo/src/implementation/solver/sequential.rs

View workflow job for this annotation

GitHub Actions / clippy

method `explored` has a `&self` declaration in the impl, but not in the trait

error[E0185]: method `explored` has a `&self` declaration in the impl, but not in the trait --> ddo/src/implementation/solver/sequential.rs:523:5 | 523 | fn explored(&self) -> usize { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&self` used in impl | ::: ddo/src/abstraction/solver.rs:96:5 | 96 | fn explored() -> usize; | ----------------------- trait method declared without `&self`
self.explored
}
}


Expand Down

0 comments on commit f3d4c96

Please sign in to comment.