[][src]Struct graco::ant::Ant

pub struct Ant {
    pub number: usize,
    pub visited_nodes: Vec<usize>,
    pub visited_edges: Vec<usize>,
    pub edge_weight: f64,
    // some fields omitted
}

Fields

number: usizevisited_nodes: Vec<usize>visited_edges: Vec<usize>edge_weight: f64

Methods

impl Ant[src]

pub fn from_node(
    number: usize,
    node_idx: usize,
    seed: u64,
    obj: Objective
) -> Ant
[src]

pub fn move_prob<N: 'static + Clone + Display + Debug + PartialEq + Send, Ty: 'static + Clone + EdgeType + Send>(
    &self,
    colony: &Colony<N, Ty>,
    from: usize,
    to: usize
) -> f64
[src]

pub fn move_ant<N: 'static + Clone + Display + Debug + PartialEq + Send, Ty: 'static + Clone + EdgeType + Send>(
    &mut self,
    colony: &Colony<N, Ty>
) -> bool
[src]

Moves an ant to the next node. Returns false when the objective is satisfied.

pub fn remove_cycles<N: 'static + Clone + Display + Debug + PartialEq + Send, Ty: 'static + Clone + EdgeType + Send>(
    &mut self,
    colony: &Colony<N, Ty>
)
[src]

Remove any cycles and updates the cost function

Trait Implementations

impl Debug for Ant[src]

Auto Trait Implementations

impl RefUnwindSafe for Ant

impl Send for Ant

impl Sync for Ant

impl Unpin for Ant

impl UnwindSafe for Ant

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.