murk-engine 0.1.9

Simulation engine orchestrating Murk environments
Documentation

murk-engine

Simulation engine for the Murk framework.

Provides two runtime modes:

  • LockstepWorld — synchronous stepping (&mut self), ideal for RL training loops
  • RealtimeAsyncWorld — autonomous background tick thread with epoch-based memory reclamation, for real-time applications

Also includes the tick engine, ingress command queue, and egress observation pool.

Available via the top-level murk crate as murk::engine.

Installation

cargo add murk-engine

Most users should depend on the top-level murk crate, which re-exports this as murk::engine.

Usage

use murk_engine::{LockstepWorld, WorldConfig, BackoffConfig};
use murk_core::{FieldDef, FieldType, FieldMutability, BoundaryBehavior};
use murk_space::{Square4, EdgeBehavior};

let space = Square4::new(16, 16, EdgeBehavior::Absorb).unwrap();
let config = WorldConfig {
    space: Box::new(space),
    fields: vec![FieldDef {
        name: "heat".into(),
        field_type: FieldType::Scalar,
        mutability: FieldMutability::PerTick,
        units: None,
        bounds: None,
        boundary_behavior: BoundaryBehavior::Clamp,
    }],
    propagators: vec![],
    dt: 0.1,
    seed: 42,
    ring_buffer_size: 8,
    max_ingress_queue: 64,
    tick_rate_hz: None,
    backoff: BackoffConfig::default(),
};

let mut world = LockstepWorld::new(config).unwrap();
let result = world.step_sync(vec![]).unwrap();

Documentation