Skip to main content

PillarSelector

Trait PillarSelector 

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

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

Trait for selecting pillars of entities.

A pillar selector groups entities by their variable values and returns groups (pillars) that can be moved together.

§Type Parameters

  • S - The planning solution type

Required Methods§

Source

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

Returns an iterator over pillars.

Each pillar contains entity references for entities that share the same variable value.

Source

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

Returns the approximate number of pillars.

Source

fn descriptor_index(&self) -> usize

Returns the descriptor index this selector operates on.

Provided Methods§

Source

fn is_never_ending(&self) -> bool

Returns true if this selector may return the same pillar 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§

Source§

impl<S, V, ES, E> PillarSelector<S> for DefaultPillarSelector<S, V, ES, E>
where S: PlanningSolution, V: Clone + Eq + Hash + Send + Sync + 'static, ES: EntitySelector<S>, E: Fn(&dyn ScoreDirector<S>, usize, usize) -> Option<V> + Send + Sync,