EntitySelector

Trait EntitySelector 

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

Required Methods§

Source

fn iter<'a>( &'a self, score_director: &'a dyn ScoreDirector<S>, ) -> 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(&self, score_director: &dyn ScoreDirector<S>) -> 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.

Implementors§