Struct PurrMultiThreadRunner

Source
pub struct PurrMultiThreadRunner<T: PurrShape> {
    pub shape_number: u32,
    pub thread_number: u32,
    pub states: Vec<PurrState<T>>,
    pub rxs: Vec<Receiver<PurrState<T>>>,
    pub txs: Vec<Sender<PurrWorkerCmd>>,
    pub on_step: Option<Box<dyn FnMut(PurrState<T>) + Sync + Send>>,
}

Fields§

§shape_number: u32§thread_number: u32§states: Vec<PurrState<T>>§rxs: Vec<Receiver<PurrState<T>>>§txs: Vec<Sender<PurrWorkerCmd>>§on_step: Option<Box<dyn FnMut(PurrState<T>) + Sync + Send>>

Implementations§

Source§

impl<T: 'static + PurrShape> PurrMultiThreadRunner<T>

Source

pub fn new( shape_number: u32, thread_number: u32, on_step: Option<Box<dyn FnMut(PurrState<T>) + Sync + Send>>, ) -> Self

Trait Implementations§

Source§

impl<T: PurrShape> Default for PurrMultiThreadRunner<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T: 'static + PurrShape> PurrModelRunner for PurrMultiThreadRunner<T>

Source§

type M = PurrHillClimbModel

Source§

fn init(&mut self, model: &mut Self::M)

Source§

fn step(&mut self, model: &mut Self::M)

Source§

fn stop(&mut self)

Source§

fn run(&mut self, model: &mut Self::M)

Source§

fn get_svg(&self, context: &PurrContext, idx: usize) -> String

Source§

fn get_last_shape(&self) -> String

Source§

fn save(&self, context: &PurrContext, output: &str)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> SetParameter for T

Source§

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result
where T: Parameter<Self>,

Sets value as a parameter of self.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V