CombineMemoryTrait
{@see \NHA\StateStore} slice: durable `combine` bookkeeping so {@see \NHA\Brain\AutoPlayer} never re-submits a set that mints nothing — every set tried this session (capped, deduped), and the confirmed-dead subset the Inventors' Guild has rejected. Both survive a restart: a restart is not a fresh invention budget.
Relies on the host's array $data and save().
Tags
Table of Contents
Constants
- DEAD_COMBINES_CAP : mixed = 5000
- Cap on the confirmed-dead list per agent.
- TRIED_COMBINES_CAP : mixed = 2000
- Cap on the "every set tried" list per agent.
Methods
- getDeadCombines() : array<int, string>
- Every `combine` signature the Guild has rejected for this agent — sets proven to make nothing. Oldest first.
- getTriedCombineSignatures() : array<int, string>
- Every `combine` signature this agent has already submitted, oldest first.
- recordCombineSignature() : void
- Records that a `combine` set — identified by its sorted `"a+b"` signature — has been submitted for this agent, so {@see \NHA\Brain\AutoPlayer} can refuse to resubmit it (the world mints nothing for a repeat). Kept as a capped, de-duplicated list that also survives a restart.
- recordDeadCombine() : void
- Records a `combine` set the world has PROVEN cannot make anything — the Inventors' Guild rejected the submission. Unlike {@see recordCombineSignature()} (every set the agent tried), this is the confirmed-dead subset: it is never worth another intent, ever, so {@see \NHA\Brain\AutoPlayer} treats it like a world-known recipe and never lets it through — not even a production recipe.
Constants
DEAD_COMBINES_CAP
Cap on the confirmed-dead list per agent.
private
mixed
DEAD_COMBINES_CAP
= 5000
TRIED_COMBINES_CAP
Cap on the "every set tried" list per agent.
private
mixed
TRIED_COMBINES_CAP
= 2000
Methods
getDeadCombines()
Every `combine` signature the Guild has rejected for this agent — sets proven to make nothing. Oldest first.
public
getDeadCombines(int $agent_id) : array<int, string>
Parameters
- $agent_id : int
Tags
Return values
array<int, string>getTriedCombineSignatures()
Every `combine` signature this agent has already submitted, oldest first.
public
getTriedCombineSignatures(int $agent_id) : array<int, string>
Parameters
- $agent_id : int
Tags
Return values
array<int, string>recordCombineSignature()
Records that a `combine` set — identified by its sorted `"a+b"` signature — has been submitted for this agent, so {@see \NHA\Brain\AutoPlayer} can refuse to resubmit it (the world mints nothing for a repeat). Kept as a capped, de-duplicated list that also survives a restart.
public
recordCombineSignature(int $agent_id, string $signature) : void
Parameters
- $agent_id : int
- $signature : string
Tags
recordDeadCombine()
Records a `combine` set the world has PROVEN cannot make anything — the Inventors' Guild rejected the submission. Unlike {@see recordCombineSignature()} (every set the agent tried), this is the confirmed-dead subset: it is never worth another intent, ever, so {@see \NHA\Brain\AutoPlayer} treats it like a world-known recipe and never lets it through — not even a production recipe.
public
recordDeadCombine(int $agent_id, string $signature) : void
Parameters
- $agent_id : int
- $signature : string