Skip to main content

Event

A class in Root.Township, Alta.Intelligence.

One remembered event in an AI's History: some knowledge atoms that fade over a lifetime. Events form a linked list of the active ones.

Constructors​

MemberWhat it is
Event(Event next, Day day, float lifeTime, params IAtomDefinition[] knowledge)Creates an Event from previous.
Event(Event previous)Creates an Event from previous.

Fields​

2 private and internal fields
MemberWhat it is
private Event nextActiveNext event in the linked list of live events.
private Event previousActivePrevious event in the linked list of live events.

Properties​

MemberWhat it is
Day Day { get; private set; }The day the event happened.
bool IsAlive { get; private set; }False once the event is older than its lifetime and has left the active list.
IAtomDefinition[] Knowledge { get; private set; }The knowledge atoms this event holds. Their age weighting falls from 1 to 0 as the event ages.
Event Next { get; }The next active event in the history list.
2 private and internal properties
MemberWhat it is
private float Age { get; set; }How long the event has existed, added to by Update.
private float LifeTime { get; set; }How long the event lasts. Its knowledge fades from weight 1 to 0 over this time.

Methods​

MemberWhat it is
void Update(float duration)Ages the event, lowering its knowledge weighting, and unlinks it once its lifetime runs out.
1 private and internal method
MemberWhat it is
private void AgeWeightKnowledge(float weight)Sets the age weighting on every knowledge atom of the event.

Used in​

Members of other types that take, return or hold a Event: