OpenNARS-for-Applications
OpenNARS-for-Applications copied to clipboard
(WIP) Attempt to eliminate cyclic dependency `NAR→Cycle→Decision`
Maybe reducing cyclic dependency can make the module dependency of ONA better?
- Privatize the global variable currentTime in
NAR.c- completely possible - Supplement the parameter
currentTimeofDecision_ConsiderNegativeOutcomesto eliminate the cyclic dependency ofNAR->Cycle->Decision- still WIP and needs further discussions
The only problem is here:
https://github.com/opennars/OpenNARS-for-Applications/blob/9954416ca1316bdb42ffe6c8e65b339c0c54ca95/src/Decision.c#L230
Are there any good alternatives to "input beliefs"?
Pass a function pointer such like void (*InputBelief) (Term) as a parameter on Decision_Execute, Cycle_ProcessAndInferGoalEvents and Cycle_Perform?
Awesome that you found this, thank you!
And I will think about a solution to replacing NAR_AddInputBelief(feedbackTerm) there.
Awesome that you found this, thank you! And I will think about a solution to replacing
NAR_AddInputBelief(feedbackTerm)there.
Thanks for your watching too!
I also have some extra information that I hope will help us.
That's my dependancy analyze of ONA using Graphviz dot:
(generated on 2024-09-21, .svg vectorgraph)
And its Graphviz code can be seen and previewed here.
(2 cyclic dependencies: Narsese.h ⇄ Variable.h, Decision.h→NAR.h→Cycle.h)
Perhaps it can give us a macro overview of module dependencies in ONA :)