Trait asi_core0::Runtime
[−]
[src]
pub trait Runtime { type Agent; fn load(&mut self, agent: Self::Agent); fn start(&mut self); fn update(&mut self, dt: f64); fn is_running(&self) -> bool; fn shut_down(&mut self, dt: f64) -> f64; fn kill(&mut self); fn is_sleeping(&self) -> bool; fn wake_up(&mut self); }
Implemented by runtimes for agents.
This controls the loading, starting, updating and shut down procedures.
Associated Types
type Agent
The type of agent.
Required Methods
fn load(&mut self, agent: Self::Agent)
Loads a new agent as initial condition.
fn start(&mut self)
Starts the agent.
This must be called before update
to run the agent.
fn update(&mut self, dt: f64)
Move forward in time.
fn is_running(&self) -> bool
Returns true
if the agent is still running or have not started yet.
fn shut_down(&mut self, dt: f64) -> f64
Start shut down procedure, expected to complete in a number of seconds.
Returns estimate from the decision maker.
This is 0
if ready to shut down.
fn kill(&mut self)
Terminate immediately even if the decision maker is not ready. This is called when the controller of the agent is impatient. (It does not morally kill the agent as it might be resurrected from backup memory).
fn is_sleeping(&self) -> bool
Returns true
if the agent is sleeping.
fn wake_up(&mut self)
Wakes the agent up from sleep.
Implementors
impl<I, O, T, D> Runtime for StandardRuntime<I, O, T, D> where
D: DecisionMaker<T>,
I: Sensor<T>,
O: Actuator<T>,
T: Default, type Agent = Agent<I, O, T, D>;