Cycles participants in an explicitly given order, forever. Use it when participants act in a fixed, possibly uneven sequence — D&D initiative order, priority-based triage, etc.
Pass :order (a list of participant ids); participants not in :order are
appended after it. If :order is omitted, it degrades to insertion order.
ExAgent.Session.start_link(
shared_state: %{},
policy: {:initiative, order: ["rogue", "fighter", "wizard"]},
participants: [...]
)
Summary
Types
@type t() :: %ExAgent.Session.TurnPolicy.Initiative{ current: term() | nil, ids: [term()], index: non_neg_integer() }