AgentSea. Crew. Delegation behaviour
(agentsea_crews v0.1.0)
Copy Markdown
Strategy behaviour for assigning a task to an agent. Each strategy is a module
implementing delegate/3; the coordinator selects one by config.
Summary
Types
A candidate agent: its name, pid, and (optional) role.
Strategy context, e.g. :counter, :bidding_time_ms, :minimum_bid, :selection_criteria.
Functions
Run a delegation strategy, timing the decision.
Types
@type agent_ref() :: %{ :name => term(), :pid => pid() | nil, optional(:role) => AgentSea.Role.t() | nil }
A candidate agent: its name, pid, and (optional) role.
@type ctx() :: map()
Strategy context, e.g. :counter, :bidding_time_ms, :minimum_bid, :selection_criteria.
Callbacks
@callback delegate(task :: term(), [agent_ref()], ctx()) :: {:ok, AgentSea.Crew.Delegation.Result.t()} | {:error, term()}