Difference between revisions of "Duration"
m |
m (→Concept) |
||
(One intermediate revision by the same user not shown) | |||
Line 4: | Line 4: | ||
== Concept == | == Concept == | ||
The '''Duration Type''' for a [[ | The '''Duration Type''' for a [[behavior]] specifies how long a behavior should run. If it is set to "'''instant'''", the behavior runs once and doesn't carry over until the next cycle. If it is set to "'''continuous'''", there is a factor added to its score on the next [[think cycle]] that increases its score by 25% (as a default). Known as "decision momentum," this helps prevent "state strobing" where two (or more) similarly scoring behaviors keep switching back and forth between each other. Therefore, there would need to be a significant increase in one of the ''other'' behaviors to overcome that momentum and change the behavior. | ||
Additionally, it changes how [[ | Additionally, it changes how [[behavior history|behavior histories]] are processed. An '''instant''' behavior registers that it is has been run when it is executed. A '''continuous''' behavior doesn't register that has been run until a ''new'' behavior is selected and takes its place. | ||
When executing a behavior, all behaviors run both the [[ | When executing a behavior, all behaviors run both the [[behavior setup]] and [[execute action]] routines contained in the code for the [[behavior type]]. However, a '''continuous''' behavior will only run the Execute routine on subsequent calls while it continues to run. | ||
== Code == | == Code == |
Latest revision as of 13:51, 7 October 2021
This page is part of the IAUS Manual. ♦ Brain ♦ Behavior ♦ Behavior Type ♦ Decision ♦ AI Entity ♦
This item is a component of a Behavior.
Concept
The Duration Type for a behavior specifies how long a behavior should run. If it is set to "instant", the behavior runs once and doesn't carry over until the next cycle. If it is set to "continuous", there is a factor added to its score on the next think cycle that increases its score by 25% (as a default). Known as "decision momentum," this helps prevent "state strobing" where two (or more) similarly scoring behaviors keep switching back and forth between each other. Therefore, there would need to be a significant increase in one of the other behaviors to overcome that momentum and change the behavior.
Additionally, it changes how behavior histories are processed. An instant behavior registers that it is has been run when it is executed. A continuous behavior doesn't register that has been run until a new behavior is selected and takes its place.
When executing a behavior, all behaviors run both the behavior setup and execute action routines contained in the code for the behavior type. However, a continuous behavior will only run the Execute routine on subsequent calls while it continues to run.
Code
It is stored as a simple enum, "DurationType" in the enums file.
enum class DurationType
{
Instant = 1, // Used once and is over
Continuous = 2 // Can continue over multiple think cycles
};
Data
There is no editable data in the Data Tool for Duration Type. It is exported along with the other enums, however.