Struct FixedTickWorld
pub struct FixedTickWorld<const MAX_AGENTS: usize, const MAX_QUEUE: usize> {
pub seed: u64,
pub prng: DeterministicPrng,
pub current_tick: u64,
pub agents: [AgentState; MAX_AGENTS],
pub agent_count: usize,
/* private fields */
}Expand description
Fixed-capacity multi-agent simulation world kernel (Zero Heap hot path).
Fields§
§seed: u64§prng: DeterministicPrng§current_tick: u64§agents: [AgentState; MAX_AGENTS]§agent_count: usizeImplementations§
§impl<const MAX_AGENTS: usize, const MAX_QUEUE: usize> FixedTickWorld<MAX_AGENTS, MAX_QUEUE>
impl<const MAX_AGENTS: usize, const MAX_QUEUE: usize> FixedTickWorld<MAX_AGENTS, MAX_QUEUE>
pub fn new(seed: u64) -> FixedTickWorld<MAX_AGENTS, MAX_QUEUE>
pub fn new(seed: u64) -> FixedTickWorld<MAX_AGENTS, MAX_QUEUE>
Creates a default FixedTickWorld.
pub fn register_agent(&mut self, entity_id: u64, x_mm: i64, y_mm: i64) -> bool
pub fn register_agent(&mut self, entity_id: u64, x_mm: i64, y_mm: i64) -> bool
Spawn or register an agent entity in the world.
pub fn submit_command(
&mut self,
cmd: SimulationCommand,
) -> Result<(), RejectionReason>
pub fn submit_command( &mut self, cmd: SimulationCommand, ) -> Result<(), RejectionReason>
Submit a command intent into the deterministic tick queue.
pub fn step_tick(&mut self, out_receipts: &mut [CommandReceipt]) -> usize
pub fn step_tick(&mut self, out_receipts: &mut [CommandReceipt]) -> usize
Step the simulation by exactly one fixed tick (Zero Heap Tier 1 loop). Writes output receipts into the caller-supplied slice.
pub fn compute_state_hash(&self) -> u64
pub fn compute_state_hash(&self) -> u64
Compute a canonical 64-bit state fingerprint across all entities.
pub fn get_agent_position(&self, entity_id: u64) -> Option<(i64, i64)>
pub fn get_agent_position(&self, entity_id: u64) -> Option<(i64, i64)>
Lookup current coordinates of an agent (in millimeters).
pub fn set_agent_position(
&mut self,
entity_id: u64,
x_mm: i64,
y_mm: i64,
) -> bool
pub fn set_agent_position( &mut self, entity_id: u64, x_mm: i64, y_mm: i64, ) -> bool
Set position directly for an agent.
Auto Trait Implementations§
impl<const MAX_AGENTS: usize, const MAX_QUEUE: usize> Freeze for FixedTickWorld<MAX_AGENTS, MAX_QUEUE>
impl<const MAX_AGENTS: usize, const MAX_QUEUE: usize> RefUnwindSafe for FixedTickWorld<MAX_AGENTS, MAX_QUEUE>
impl<const MAX_AGENTS: usize, const MAX_QUEUE: usize> Send for FixedTickWorld<MAX_AGENTS, MAX_QUEUE>
impl<const MAX_AGENTS: usize, const MAX_QUEUE: usize> Sync for FixedTickWorld<MAX_AGENTS, MAX_QUEUE>
impl<const MAX_AGENTS: usize, const MAX_QUEUE: usize> Unpin for FixedTickWorld<MAX_AGENTS, MAX_QUEUE>
impl<const MAX_AGENTS: usize, const MAX_QUEUE: usize> UnsafeUnpin for FixedTickWorld<MAX_AGENTS, MAX_QUEUE>
impl<const MAX_AGENTS: usize, const MAX_QUEUE: usize> UnwindSafe for FixedTickWorld<MAX_AGENTS, MAX_QUEUE>
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more