Skip to main content

FixedTickWorld

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: usize

Implementations§

§

impl<const MAX_AGENTS: usize, const MAX_QUEUE: usize> 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

Spawn or register an agent entity in the world.

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

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

Compute a canonical 64-bit state fingerprint across all entities.

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

Set position directly for an agent.

pub fn query_agents_in_bounds( &self, min_x_mm: i64, min_y_mm: i64, max_x_mm: i64, max_y_mm: i64, out_entity_ids: &mut [u64], ) -> usize

Spatial box selection / range query (Zero Heap Tier 1 hot path).

Writes matching entity_id values into out_entity_ids and returns the count.

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§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,