[−][src]Struct agent_safety_layers::AgentZ
Stores an agent that only acts, assuming its model is perfect.
Fields
model: M
Stores the model.
decider: fn(_: &M) -> A
Decides what to do based on some model.
actor: fn(_: &mut M, _: A)
Performs an action on the model.
mutater: fn(_: &mut M) -> D
Mutates the model and returns a delta change.
undoer: fn(_: &mut M, _: D)
Undoes a delta change by resetting the model.
Methods
impl<M, A, D> AgentZ<M, A, D>
[src]
Trait Implementations
impl<M, A, D> Agent for AgentZ<M, A, D>
[src]
type Model = M
The type of the model.
type Action = A
The type of actions.
type Delta = D
The type of delta changes (caused by mutation).
fn update_model(&mut self, model: M)
[src]
fn decide(&mut self) -> Decision<A>
[src]
fn act(&mut self, action: A)
[src]
fn mutate(&mut self) -> D
[src]
fn undo(&mut self, delta: D)
[src]
impl<M: Clone, A: Clone, D: Clone> Clone for AgentZ<M, A, D>
[src]
Auto Trait Implementations
impl<M, A, D> RefUnwindSafe for AgentZ<M, A, D> where
M: RefUnwindSafe,
M: RefUnwindSafe,
impl<M, A, D> Send for AgentZ<M, A, D> where
M: Send,
M: Send,
impl<M, A, D> Sync for AgentZ<M, A, D> where
M: Sync,
M: Sync,
impl<M, A, D> Unpin for AgentZ<M, A, D> where
M: Unpin,
M: Unpin,
impl<M, A, D> UnwindSafe for AgentZ<M, A, D> where
M: UnwindSafe,
M: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,