pub struct Programmer<'g, G: ?Sized> {
pub instances: Vec<Instance<'g, G>>,
pub evaluations: u64,
}Expand description
The planner-programming objective: the mean relative excess cost / optimum - 1 of the
decoded planner over the training instances (a failed run counts 10), each run with a
fixed seed so a genome’s score is deterministic.
Fields§
§instances: Vec<Instance<'g, G>>The training instances (reachable ones only contribute).
evaluations: u64The evaluation budget of every planner run.
Implementations§
Source§impl<'g, G: Graph + ?Sized> Programmer<'g, G>
impl<'g, G: Graph + ?Sized> Programmer<'g, G>
Sourcepub fn new(instances: Vec<Instance<'g, G>>, evaluations: u64) -> Self
pub fn new(instances: Vec<Instance<'g, G>>, evaluations: u64) -> Self
A programmer for instances with a per-run budget.
Sourcepub fn score(&self, planner: &PlannerConfig) -> f64
pub fn score(&self, planner: &PlannerConfig) -> f64
The score of a decoded planner (smaller is better).
Sourcepub fn evolve<R: Rng + ?Sized>(
&mut self,
meta: &MetaConfig,
rng: &mut R,
) -> (PlannerConfig, f64)
pub fn evolve<R: Rng + ?Sized>( &mut self, meta: &MetaConfig, rng: &mut R, ) -> (PlannerConfig, f64)
Runs the meta-GA and returns the best planner with its score.
Trait Implementations§
Auto Trait Implementations§
impl<'g, G> Forget for Programmer<'g, G>where
G: ?Sized,
impl<'g, G> Freeze for Programmer<'g, G>
impl<'g, G> Move for Programmer<'g, G>where
G: ?Sized,
impl<'g, G> RefUnwindSafe for Programmer<'g, G>
impl<'g, G> Send for Programmer<'g, G>
impl<'g, G> Sync for Programmer<'g, G>
impl<'g, G> Unpin for Programmer<'g, G>
impl<'g, G> UnsafeUnpin for Programmer<'g, G>
impl<'g, G> UnwindSafe for Programmer<'g, G>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more