Updating preference weights
Lightweight Architecture for boundedly Rational Agents
Brought to you by:
danielklemm,
s-holzhauer
View and moderate all "Problems" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
After one iteration, I want to update the preference weights of some agents. First, I
Second, I get the preference weight map and then start to put the new weights for the goals.
Third, I create a new Set for the behavioural options and add them accordingly with the new preferences.
Finally, memorise them.
getLaraComp().getBOMemory().memoriseAll(behaviouralOptions);
The problem that I have is that in the next iterations, when computing the scores for the BOs, it keeps doing it with the old values of the preference weight.
Could you help on me on this? That is, how to make the new values be used for computing the new scores for the BOs?
Thanks.
First, one needs to distinguish between BO preference utilities (that represent a BO's utlity towards defined preferences and usually differ from BO to BO) and agents' preferences. In the above example, the same set of preference utilities is assigned to all BOs, which is unlikely what is wanted. To assign the altered set of preferences to an agent, call
getLaraComp().addPreferenceWeights(preferences);
Manipulating the map that is returned by
getLaraComp().getPreferenceWeights();
has no effect on its own since the method returns a copy of the underlying agent's preference map. Hope that helps!View and moderate all "Problems" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Thanks! It works.
But I would have another question: it is necessary to clear the BO memory before updating and set a new Set for the behavioural options so the BO memory memorizes it?
that is, as you see above,
1)
getLaraComp().getBOMemory().clear();
2)
Thanks again!
Usually one does not have to clear the memory in order to update objects within. Rather, the proper type of memory (unfortunately they are not yet documented very well) should be used to accomplish the desired behaviour. In your case, the LDefaultLimitedCapacityOverwriteBoMemory would overwrite the BO with the same key when you memorise an updated BO.