History
A class in Root.Township, Alta.Intelligence.
A timeline of days and knowledge events for the experimental AI reasoning system. Time is in days (1.0 is one day). Only created by the test Intelligence component.
- Listed in Creatures and AI
Constructors
| Member | What it is |
|---|---|
History() | Creates a History with default values. |
Fields
3 private and internal fields
Properties
| Member | What it is |
|---|---|
Day Current { get; private set; } | The current day. A new day starts each time Time passes 1. |
float Time { get; private set; } | Time of day as a 0 to 1 fraction. Wraps back to 0 and starts a new day when it passes 1. |
float Time24 { get; } | Time of day in hours (0 to 24). |
Methods
| Member | What it is |
|---|---|
Event CreateEvent(float lifeTime = -1, params IAtomDefinition[] knowledge) | Creates an event in the current day carrying the given knowledge, with an optional lifetime in days (-1 for no limit). |
static float Duration(int days = 0, int hours = 0, int minutes = 0, int seconds = 0) | Converts days, hours, minutes and seconds into a duration in days. |
IEnumerable<Event> GetActive() (iterator) | Enumerates the events that are still active, oldest first. |
static float Hours(int hours) | Converts whole hours into a fraction of a day. |
static float Minutes(int minutes) | Converts whole minutes into a fraction of a day. |
static float Seconds(int seconds) | Converts whole seconds into a fraction of a day. |
void Update(float progression) | Advances time by the given fraction of a day and updates every active event. |
1 private and internal method
| Member | What it is |
|---|---|
private void StartDay() | Starts a new Day with the next index and makes it Current. Called on creation and when Time passes 1. |
Used in
Members of other types that take, return or hold a History: