Needs AI API documentation version 1.0.0

Needs AI is a utility-based AI library written in Haxe.

Getting Started With Needs AI


Top Level

..
Action

The Action class represents an action that an agent has the option of intending/attempting to perform within the game world. It encapsulates a collection of Considerations that are evaluated using a scoring function to calculate an overall utility score for the Action.

ActionPickingStrategies

The ActionPickingStrategies class contains boilerplate methods for choosing the most appropriate action from a ActionSet.

ActionScorePair

Pair type for conveniently returning an action and its utility score from scoring functions.

ActionScoringStrategies

The ActionScoringStrategies class contains boilerplate methods for determining the utility of an Action. These scoring strategies combine the scores of individual Considerations to determine the total utility of an Action.

ActionSet

The ActionSet represents a set of Actions, each of which an agent has the option of attempting to perform within the game world. It encapsulates a collection of Actions that are evaluated using a scoring function to pick the most-preferred action to perform.

ActionSetScorePair

Pair type for conveniently returning an action set and its utility score from scoring functions.

ActionSetScoringStrategies

The ActionSetScoringStrategies class contains boilerplate methods for determining the relative utility of ActionSets. These scoring strategies are typically used to rank particular ActionSets to put some groups of Actions ahead of others.

Brain

The Brain class represents the top-level reasoning element of your utility-based AI agent. It encapsulates a collection of Reasoners, which it updates to drive decision-making logic of the agent. The Brain broadcasts when the actions its reasoners pick change, which other parts of the codebase e.g. an animation system, can listen to.

Consideration

The Consideration class transforms an observation about the game world that your agent cares about into a utility score. A consideration produces the utility score by evaluating (or appraising) an Input - an aspect of the world the agent is interested in - against a response curve. This result is typically a floating point value, which is later used for calculating the overall utility of an Action available to the agent.

Reasoner

The Reasoner class encapsulates sets of actions available to an agent. It exposes a technique for selecting the best available Action from a collection of ActionSets. It emits a signal when the Action it selects changes.

ReasonerActionPickingStrategies

The ReasonerActionPickingStrategies class contains boilerplate methods that a Reasoner uses to select the most appropriate Action.

Class Diagrams