-
Notifications
You must be signed in to change notification settings - Fork 83
dev Decision Making
This article gives some implementation details on how to implement a basic decision-making functionality. It does not refer to the OpenNARS codebase in any direct way, but the mechanisms are very similar or equal. See here for the theory about decision making.
It is assumed that the reader knows what decision making is about and how decisions are made. It is assumed that the reader knows what sequences, predictive implications, derivations, etc. are.
Some things are left out for the sake of simplicity, such as:
- projection
- anticipation
- planning
- attention mechanism and interaction with the goal system
These steps are done in each cycle of the procedural reasoner.
- filter predictive implications by the current events as the predicate.
ex:
a. :|: // current event
<(b &/ ^x) =/> a>. // candidate implication (which is filtered and used for the next step)
<(c &/ ^x) =/> e>. // candidate, filtered out and not used
Note that this is not the preferred way how to implement it. OpenNARS for research and other implementations derive goals from judgement+goal. The derived goal can or can not be linked to the premise goal, depending on the implementation.
One example of a derivation is as follows:
a! :|: <- goal to be executed
<(b &/ ^x) =/> a>. <- judgment
|-
(b &/ ^x)! :|:
Note here that the goals are in this case not eternal. A reason for this is that the situation is fluid and changes from one moment in time to the next. It is the task of the executive to decide the best goal to get executed in each moment.
Now we have to select the best option by searching in the filtered predictive implications for the item with the highest expectation value.
Now we need to decide if we want to execute the operation. We can only do this if the computed expectation is above the decision threshold.
if maxExp > decisionThreshold {
// do operation
// ...
// add event to anticipation
// ...
}