Skip to main content

Simulator

Trait Simulator 

Source
pub trait Simulator {
    // Required methods
    fn name(&self) -> &str;
    fn project(
        &self,
        world: &WorldState,
        goal: &Goal,
        hypothesis: &Hypothesis,
    ) -> Projection;

    // Provided method
    fn project_all(
        &self,
        world: &WorldState,
        goal: &Goal,
        hs: &[Hypothesis],
    ) -> Vec<Projection> { ... }
}
Expand description

Anything that can project a hypothesis forward.

Implementations range from the structural one below (no domain knowledge, no execution) through domain models to simulators that actually run the experiment in a sandbox. All of them must obey the module rule: an unmeasured dimension is Term::absent.

Required Methods§

Source

fn name(&self) -> &str

Stable name, recorded in the projection and hashed into the decision record.

Source

fn project( &self, world: &WorldState, goal: &Goal, hypothesis: &Hypothesis, ) -> Projection

Provided Methods§

Source

fn project_all( &self, world: &WorldState, goal: &Goal, hs: &[Hypothesis], ) -> Vec<Projection>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§