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§
Sourcefn name(&self) -> &str
fn name(&self) -> &str
Stable name, recorded in the projection and hashed into the decision record.
fn project( &self, world: &WorldState, goal: &Goal, hypothesis: &Hypothesis, ) -> Projection
Provided Methods§
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".