-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consolidate most attentionbank code to just one location #1664
Conversation
@misgeatgit please look this over. This defines a new guile module, which will require you to say |
After grepping, I see that the following need to say
I think this is the full, exhaustive list. |
@linas correct. those are the places that need these change. What was the reason for changing the name though? |
changing what name? I don't think I changed the name of anything ... |
Oh, it's a new module...got it! |
I'll merge in a few hours, unless you have comments ... |
This is needed to stay in sync with opencog/atomspace#1664
pull req opencog/opencog#3098 needed to use the new module |
{ | ||
AtomSpace* atomspace = SchemeSmob::ss_get_env_as("cog-af"); | ||
|
||
Handle af_anchor = atomspace->add_node(ANCHOR_NODE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@linas Why would you want to record the list of atoms in the attention-focus, explicitly in the atomspace?
auto gone = prev_af.find(hi); | ||
if (prev_af.end() == gone) | ||
{ | ||
atomspace->add_link(MEMBER_LINK, hi, af_anchor); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could create a nested list of MemberLinks
if prev_af
has MemberLink
s used to represent the set of atoms in the attentional-focus(af). The logic = the representative sets are likely to be in the af because they are connected to atoms that are in the af, and sti
will diffuse to them as a result of which they are likely to enter the af.
Hi @amebel to answer both your questions: the API was designed to return an (unordered) list. There are two ways to represent a list in the atomspace: with a SetLink, or a MemberLink. I picked MemberLink, because SetLink has a variety of technical drawbacks. The technical reasons for this are detailed in #1502. A different API, that might be better, would be to use the NextLink construct proposed in #1507 - however, that is not yet implemented, and it's not yet clear how such an API should be used. As to diffusing STI to anchors: the answer is real simple: don't do that! Diffuse the STI to things that actually matter, for whatever problem you are trying to solve. Don't diffuse STI to core infrastructure. Perhaps it would be better to have an AnchorLink, with a rule that says "never diffuse to AnchorLink". There's a long, long list of link types that you never want to diffuse to: BindLink, or and subtype of PatternLink, VariableNode, or any of the VariableTypes, LambdaLink, and probably not the function links -- roughly, you never want to diffuse to any link type that is executable or evaluatable. |
It's probably deriving to an off topic discussion, but I feel diffusion should be user programmable, the user should be able to overwrite the defaults by providing some scheme function(s) that dictate(s) how STI should be diffused. Not offering that greatly lowers the usability of the attention allocation module, IMO. |
@ngeiswei @amebel I just opened opencog/opencog#3107 to track this as an attention-allocation agent issue. That way we can be on-target for that discussion. |
The attentionbank code was starting to get invasive, causing dependency problems.
This isolates most of that code to just one directory.