Intelligence
A class in Root.Township, Alta.Intelligence.
Unfinished experiment with a Prolog-like knowledge system (who owns, hates and attacked whom, with fading memories). Awake only builds a hard-coded test with frogs and toads and logs a query; no creature uses it.
- Listed in Creatures and AI
- Inherits or implements
MonoBehaviour
Constructors
| Member | What it is |
|---|---|
Intelligence() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
| Member | What it is |
|---|---|
static readonly Atom<ITerm, ITerm> Attacked | Atom for "A attacked B". |
static readonly Atom<ITerm, IData<Vector3>> AttackedLocated | Atom for "the attacker of A was at position P". |
static readonly Atom<ITerm, ITerm> Equal | Atom for "A equals B", named "Equals". |
static readonly Atom<ITerm> Hates | Atom for "hates A". |
static readonly Atom<ITerm, IData<Vector3>> IsLocated | Atom for "A is at position P". |
static readonly Atom<ITerm, ITerm> Owner | Atom for "A is the direct owner (parent) of B". |
static readonly Atom<ITerm, ITerm> Owns | Atom for "A owns B", directly or through a chain of owners. |
1 private and internal field
| Member | What it is |
|---|---|
private History history | The event history created in Awake. |
Methods
5 private and internal methods
| Member | What it is |
|---|---|
private void Awake() | Builds the test knowledge (Everyone, Frogs, Fred, Toads, Ted), records Ted attacking Fred, and logs whether the frogs hate Ted. |
private void BasicHate(Character character) | Tells a group that it hates anyone who attacked one of its members. |
private bool GetLastSeen(KnowledgeHolder knowledge, BaseAtom target, out Vector3 position, out float weight) | Finds the highest-weighted known position of a target. Never called. |
private Vector3? GetLastSeen2(KnowledgeHolder knowledge, BaseAtom target) | Finds the highest-weighted known position of whoever attacked a target. Never called. |
private void Update() | Advances the history clock at a tenth of real time, ageing events. |