[][src]Trait gridsim::Direction

pub trait Direction: Sized + From<usize> + Into<usize> {
    type Directions: Iterator<Item = Self>;
    fn directions() -> Self::Directions;

    fn inv(self) -> Self { ... }
fn total() -> usize { ... }
fn chooser(
        sigmoids: impl Iterator<Item = f32>
    ) -> Option<(Self, FloatOrd<f32>)> { ... }
fn chooser_slice(sigmoids: &[f32]) -> Option<(Self, FloatOrd<f32>)> { ... }
fn turn_clockwise(self) -> Self { ... }
fn turn_counterclockwise(self) -> Self { ... } }

Associated Types

type Directions: Iterator<Item = Self>[src]

Loading content...

Required methods

fn directions() -> Self::Directions[src]

An iterator over all directions. There must be an even number of directions and they must rotate counter-clockwise when iterating in order for all default impls to work. If your direction does not follow these rules then you must override the default impls.

Loading content...

Provided methods

fn inv(self) -> Self[src]

All directions should have an opposite direction on the opposite side of its iterator.

fn total() -> usize[src]

The total number of directions.

fn chooser(sigmoids: impl Iterator<Item = f32>) -> Option<(Self, FloatOrd<f32>)>[src]

Must provide an input iterator with length of the number of directions for the Direction impl which contains sigmoid outputs in the range of (0.0, 1.0). This will choose a direction based on the highest sigmoid output. If none of the values are greater than 0.5, then it will choose no direction.

fn chooser_slice(sigmoids: &[f32]) -> Option<(Self, FloatOrd<f32>)>[src]

fn turn_clockwise(self) -> Self[src]

fn turn_counterclockwise(self) -> Self[src]

Loading content...

Implementors

Loading content...