Skip to content

BrainContext beta ​

Interface of @v12-engine/engine/ai

ts
export interface BrainContext

What a seat hands a brain as it is made, besides its session and its options (createComputerSystem's make)

Members ​

budget ​

ts
budget?: number | ThinkBudgetOptions;

How much of a think one tick may do (ThinkBudgetOptions: modules a tick, units looked at a tick, the milliseconds a module is warned over), or the modules a tick as a number. A think with more goes on at the next tick, over the same picture of the game, so that no tick does all of it. Everything in one tick when left out

checks ​

ts
checks?: boolean;

Whether every think is checked against the invariants (checkBrain): its world's (world.checks.ai), as its seat says. The process's (debugChecks.ai) for a brain made by hand

profiling ​

ts
profiling?: () => boolean;

Whether to time each module this think: on while the world's scheduler profiles. Timing never decides anything

seed ​

ts
seed?: number;

What the brain's own numbers start from: the world's seed and the player, as the seat works it out

team ​

ts
team?: () => TeamBoard;

The board of its team (TeamBoard), shared by the computers of one team and kept by the world (core.ai.teams): read anew each time, for a load replaces it. A brain with none plays alone