pub struct SimCell {
pub id: String,
pub region: Option<Region3D>,
pub world: SimWorld,
pub agents: Vec<AgentPolicy>,
pub tick: Duration,
pub next_deadline: DateTime<Utc>,
pub co_placement: CoPlacement,
pub priority: i32,
}Expand description
A gang-schedulable, checkpointable simulation unit: one world shard plus its co-resident agent policy models, advancing on a fixed tick cadence.
This is the sim-native workload type. It is also called a “habitat” in
product docs; SimCell is the canonical name here.
Fields§
§id: StringStable identifier for the cell (used to build member ids and the gang id).
region: Option<Region3D>Optional spatial footprint for interest management.
world: SimWorldThe authoritative simulation world shard.
agents: Vec<AgentPolicy>Co-resident agent policy models.
tick: DurationTick cadence (wall-clock budget per simulation step).
next_deadline: DateTime<Utc>Absolute time the next tick is due — the EEVDF virtual deadline used by
crate::scheduler::deadline.
co_placement: CoPlacementHow members must be placed relative to one another.
priority: i32Base scheduling priority applied to every expanded member.
Implementations§
Source§impl SimCell
impl SimCell
Sourcepub fn new(id: impl Into<String>, world: SimWorld, tick: Duration) -> Self
pub fn new(id: impl Into<String>, world: SimWorld, tick: Duration) -> Self
Create a new sim cell. next_deadline defaults to now + tick.
Sourcepub fn with_region(self, region: Region3D) -> Self
pub fn with_region(self, region: Region3D) -> Self
Attach a spatial region for interest management.
Sourcepub fn with_agent(self, agent: AgentPolicy) -> Self
pub fn with_agent(self, agent: AgentPolicy) -> Self
Add an agent policy member.
Sourcepub fn with_co_placement(self, policy: CoPlacement) -> Self
pub fn with_co_placement(self, policy: CoPlacement) -> Self
Set the co-placement policy.
Sourcepub fn with_priority(self, priority: i32) -> Self
pub fn with_priority(self, priority: i32) -> Self
Set the base priority applied to every member.
Sourcepub fn with_next_deadline(self, deadline: DateTime<Utc>) -> Self
pub fn with_next_deadline(self, deadline: DateTime<Utc>) -> Self
Set an explicit next-tick deadline (overrides the now + tick default).
Sourcepub fn member_count(&self) -> usize
pub fn member_count(&self) -> usize
Total number of members (world + agents).
Sourcepub fn advance_deadline(&mut self)
pub fn advance_deadline(&mut self)
Advance the deadline by one tick (used after a tick completes).
Sourcepub fn members(&self) -> Vec<Workload>
pub fn members(&self) -> Vec<Workload>
Expand into bare Workloads, as required by the task signature
fn members(&self) -> Vec<Workload>. Prefer SimCell::expand when you
need the role/ordinal structure.
Sourcepub fn gang_group(&self) -> GangGroup
pub fn gang_group(&self) -> GangGroup
Build the all-or-nothing GangGroup for this cell.