Matthew Lohbihler
unread,Oct 10, 2012, 5:30:19 PM10/10/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ccrg-m...@googlegroups.com
I placed a few logging statements into BehaviorNetwork to try and track down some suspected odd behaviour. Specifically, around lin 218:
public void receiveBehavior(Behavior b) {
logger.log(Level.INFO, "Received behavior.", TaskManager.getCurrentTick()); // <== ADDED
Around line 251:
public void runThisFrameworkTask() {
logger.log(Level.INFO, "BehaviorNetworkBackgroundTask.runThisFrameworkTask", TaskManager.getCurrentTick()); // <== ADDED
Around line 522:
public void decayModule(long t) {
logger.log(Level.INFO, "decayModule", TaskManager.getCurrentTick()); // <== ADDED
I did this because it seemed like behaviours were not being executed as expected. In particular, there appeared to be long, seemingly random delays before actions took place, while activation levels in PAM and elsewhere looked ok. Here are some snips of the output.
In this snip, behaviours are received, but the BehaviourNetworkBackgroundTask has already run, and so they never get any excitation by the passActivationFromSchemes method. In the next tick, the decayModule method mops them up because their activations are 0.
0000010019 :0000004871 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> BehaviorNetworkBackgroundTask.runThisFrameworkTask
0000010020 :0000004872 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> decayModule
0000010021 :0000004872 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> BehaviorNetworkBackgroundTask.runThisFrameworkTask
0000010022 :0000004872 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> Received behavior.
0000010023 :0000004872 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> Received behavior.
0000010024 :0000004872 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> Received behavior.
0000010025 :0000004872 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> Received behavior.
0000010026 :0000004873 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> decayModule
In this snip, the behaviours are received and they receive activation because this time the BehaviorNetworkBackgroundTask runs after the thread that send them. Presumably, these resulted in actions being executes (although i did not add logging to confirm this... yet).
0000010227 :0000004971 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> BehaviorNetworkBackgroundTask.runThisFrameworkTask
0000010228 :0000004972 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> decayModule
0000010229 :0000004972 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> Received behavior.
0000010230 :0000004972 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> Received behavior.
0000010231 :0000004972 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> Received behavior.
0000010232 :0000004972 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> Received behavior.
0000010233 :0000004972 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> BehaviorNetworkBackgroundTask.runThisFrameworkTask
0000010234 :0000004973 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> decayModule
Here is one where the background task runs in the middle of the behaviour receipt:
0000011687 :0000005681 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> BehaviorNetworkBackgroundTask.runThisFrameworkTask
0000011688 :0000005682 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> decayModule
0000011689 :0000005682 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> Received behavior.
0000011690 :0000005682 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> BehaviorNetworkBackgroundTask.runThisFrameworkTask
0000011691 :0000005682 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> Received behavior.
0000011692 :0000005682 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> Received behavior.
0000011693 :0000005682 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> Received behavior.
0000011694 :0000005683 :INFO :edu.memphis.ccrg.lida.actionselection.behaviornetwork.BehaviorNetwork -> decayModule
By far the majority of these are like the first where the behaviours are removed before they receive any activation. I believe this also explains the odd behaviour of the ALife example, in which the agent would sit still for long periods while going hungry and being attacked by monkeys. I think the log snips above indicate a definite race condition in the threading.
Regards,
Matthew