from python_actr import * from python_actr_hdm import * import python_actr log=python_actr.log() class MyEnvironment(Model): pass class MyAgent(ACTR): focus=Buffer() DMbuffer=Buffer() Use_HDM = True if Use_HDM: # standard latency = 0.05 DM=HDM(DMbuffer,N=64,latency=0.5,threshold=-888,verbose=True,noise=0.000001,forgetting=0.0,finst_size=22,finst_time=100.0) else: # standard latency = 0.05 DM=Memory(DMbuffer,latency=3.0,threshold=-8,finst_size=22,finst_time=100.0) # latency controls the relationship between activation and recall # activation must be above threshold - can be set to none dm_n=DMNoise(DM,noise=0.0,baseNoise=0.0) # turn on for DM subsymbolic processing dm_bl=DMBaseLevel(DM,decay=0.5,limit=None) # turn on for DM subsymbolic processing focus.set('goal:recall') ## DM.add('animal tiger') ## DM.add('animal tiger') ## DM.add('animal tiger') ## DM.add('animal tiger') ## DM.add('animal tiger') DM.add('animal lion') DM.add('animal lion') DM.add('animal tiger') DM.add('animal tiger') def request(focus='goal:recall'): print("requesting") DM.request('animal ?') focus.set('goal:retrieve') def retrieve(focus='goal:retrieve',DMbuffer='animal ?B',DM='busy:False'): print("retrieved") print (B) DMbuffer.set('nil') focus.set('goal:stop') tim=MyAgent() somewhere=MyEnvironment() somewhere.agent=tim log_everything(somewhere) somewhere.run()