Validate
Checks an Types.AgentDefinition or a Types.Brain and errors with the path of the first bad
field. Build() and VluxyAI.NewAgent run it for you; call VluxyAI.Validate yourself to
check content modules in a test.
Functions
Brain
Validate.Brain(brain: any,--
The candidate brain.
path: string?--
The prefix for messages. Default Brain.
) → ()
Checks a brain table: Initial names a state, every state's functions are functions, every
transition targets a state, and no field is misspelled. The 0.1 names Start and End are
called out by name.
Errors
| Type | Description |
|---|---|
| string | The path and problem of the first bad field. |
Definition
Validate.Definition(definition: any--
The candidate definition.
) → ()
Checks a whole definition against [Types.AgentDefinition]: the entity, the brain (through
Validate.Brain), that a pathfinder and a mover come as a pair and have their methods, that
every sense has Tick, and that the numbers are numbers.
The entity may be a plain table in a test; a real Instance must be a Model with a
PrimaryPart. It may be left out when the mover has GetPivot (Record): a headless agent.
Errors
| Type | Description |
|---|---|
| string | The path and problem of the first bad field. |