Struct asi_core0::StandardRuntime
[−]
[src]
pub struct StandardRuntime<I, O, T, D> { pub agent: Option<Agent<I, O, T, D>>, pub wait: f64, pub actions: VecDeque<(Action, bool)>, pub memory_limit: Option<usize>, // some fields omitted }
Standard runtime for running an agent.
This runtime permits setting a memory limit. A sleeping agent can also be interrupted.
The runtime keeps track of actions that are waiting for confirmation.
Fields
agent: Option<Agent<I, O, T, D>>
Stores agent data.
This is set to None
before the runtime is loaded.
wait: f64
The number of seconds to wait before performing the next action.
actions: VecDeque<(Action, bool)>
Actions of sending or retrieving inputs and outputs. The flag tells whether this is done or not.
memory_limit: Option<usize>
A limit to the amount of memory states.
Methods
impl<I, O, T, D> StandardRuntime<I, O, T, D>
[src]
pub fn new() -> StandardRuntime<I, O, T, D>
[src]
Creates a new standard runtime with an agent with no sensors, actuators or memory.
Trait Implementations
impl<I, O, T, D> Runtime for StandardRuntime<I, O, T, D> where
D: DecisionMaker<T>,
I: Sensor<T>,
O: Actuator<T>,
T: Default,
[src]
D: DecisionMaker<T>,
I: Sensor<T>,
O: Actuator<T>,
T: Default,
type Agent = Agent<I, O, T, D>
The type of agent.
fn load(&mut self, agent: Agent<I, O, T, D>)
[src]
Loads a new agent as initial condition.
fn start(&mut self)
[src]
Starts the agent. This must be called before update
to run the agent. Read more
fn is_running(&self) -> bool
[src]
Returns true
if the agent is still running or have not started yet.
fn kill(&mut self)
[src]
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). Read more
fn shut_down(&mut self, dt: f64) -> f64
[src]
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. Read more
fn is_sleeping(&self) -> bool
[src]
Returns true
if the agent is sleeping.
fn wake_up(&mut self)
[src]
Wakes the agent up from sleep.
fn update(&mut self, dt: f64)
[src]
Move forward in time.