EntitySelector

Trait EntitySelector 

Source
pub trait EntitySelector<S: PlanningSolution>: Send + Debug {
    // Required methods
    fn iter<'a, D: ScoreDirector<S>>(
        &'a self,
        score_director: &'a D,
    ) -> Box<dyn Iterator<Item = EntityReference> + 'a>;
    fn size<D: ScoreDirector<S>>(&self, score_director: &D) -> usize;

    // Provided method
    fn is_never_ending(&self) -> bool { ... }
}
Expand description

Trait for selecting entities from a planning solution.

Entity selectors provide an iteration order over the entities that the solver will consider for moves.

§Type Parameters

  • S - The planning solution type

Required Methods§

Source

fn iter<'a, D: ScoreDirector<S>>( &'a self, score_director: &'a D, ) -> Box<dyn Iterator<Item = EntityReference> + 'a>

Returns an iterator over entity references.

The iterator yields EntityReference values that identify entities within the solution.

Source

fn size<D: ScoreDirector<S>>(&self, score_director: &D) -> usize

Returns the approximate number of entities.

Provided Methods§

Source

fn is_never_ending(&self) -> bool

Returns true if this selector may return the same entity multiple times.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§