Intelligence · class
UtilityPolicy
The default floor: score every option, take the highest.
Explained in Agents and behaviour.
class UtilityPolicy implements AgentPolicyimport { UtilityPolicy } from '@driftengine/ai';In depth
Small on purpose. The seam is the deliverable and this is a convenience that has to earn its place by being used. What it costs: every consumer links a scorer it may not want. What would make it wrong: if consumers universally replace it, it is dead weight and belongs behind its own export rather than in the barrel.
Allocates nothing per tick. select returns one of the options' pre-built
intents — the same object identity every time that option wins. That is what makes
the claim true by construction, and utility.alloc.test.ts is what keeps it true.
Constructor
new
constructor(options: readonly PolicyOption[])| Parameter | Type | Description |
|---|---|---|
options | readonly PolicyOption[] |
Methods
select
select(context: PolicyContext): Intent| Parameter | Type | Description |
|---|---|---|
context | PolicyContext |