Agent

Trait Agent 

Source
pub trait Agent: Send + Sync {
    // Required methods
    fn id(&self) -> AgentId;
    fn negotiate(&mut self, request: NegotiationRequest) -> NegotiationResponse;
    fn apply_budget(&mut self, budget: ResourceBudget);
    fn update(&mut self, context: &mut EngineContext<'_>);
    fn report_status(&self) -> AgentStatus;
    fn execute(&mut self);
    fn as_any(&self) -> &dyn Any;
    fn as_any_mut(&mut self) -> &mut dyn Any;
}
Expand description

The foundational interface for an Intelligent Subsystem Agent (ISA).

Each major subsystem (Rendering, Physics, etc.) implements this trait to participate in the engine’s dynamic resource negotiation (GORNA).

Required Methods§

Source

fn id(&self) -> AgentId

Returns the unique identifier for this agent.

Source

fn negotiate(&mut self, request: NegotiationRequest) -> NegotiationResponse

Negotiates with the DCC to determine the best execution strategy given the current global resource constraints and priorities.

Source

fn apply_budget(&mut self, budget: ResourceBudget)

Applies a resource budget issued by the DCC. The agent must adjust its internal logic (e.g., LOD, quality settings) to stay within the allocated limits.

Source

fn update(&mut self, context: &mut EngineContext<'_>)

Periodically updates the agent’s internal state.

Source

fn report_status(&self) -> AgentStatus

Reports the current status and health of the agent.

Source

fn execute(&mut self)

Executes the agent’s primary function for this frame. Called after update(), this is where the agent performs its main work.

Source

fn as_any(&self) -> &dyn Any

Allows downcasting to concrete agent types.

Source

fn as_any_mut(&mut self) -> &mut dyn Any

Allows mutable downcasting to concrete agent types.

Implementors§