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§
Sourcefn negotiate(&mut self, request: NegotiationRequest) -> NegotiationResponse
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.
Sourcefn apply_budget(&mut self, budget: ResourceBudget)
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.
Sourcefn update(&mut self, context: &mut EngineContext<'_>)
fn update(&mut self, context: &mut EngineContext<'_>)
Periodically updates the agent’s internal state.
Sourcefn report_status(&self) -> AgentStatus
fn report_status(&self) -> AgentStatus
Reports the current status and health of the agent.
Sourcefn execute(&mut self)
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.
Sourcefn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Allows mutable downcasting to concrete agent types.