├── .classpath ├── .gitignore ├── .project ├── .settings ├── org.eclipse.jdt.core.prefs └── org.eclipse.ltk.core.refactoring.prefs ├── build.xml ├── configs ├── agent.xml ├── factoryData.xml ├── factoryData2.xml ├── guiCommands.properties ├── guiPanels.properties ├── lidaConfig.properties ├── logging.properties └── testFactoryData.xml ├── junit └── edu │ └── memphis │ └── ccrg │ └── lida │ ├── actionselection │ ├── BasicActionSelectionTest.java │ └── behaviornetwork │ │ ├── BehaviorNetworkTest.java │ │ ├── MockActionSelectionListener.java │ │ └── OrderingTest.java │ ├── attentioncodelets │ ├── AttentionCodeletModuleTest.java │ ├── DefaultAttentionCodeletTest.java │ ├── MockAttentionCodeletImpl.java │ └── NeighborhoodAttentionCodeletTest.java │ ├── episodicmemory │ ├── BasicEMinitializerTest.java │ ├── EpisodicMemoryImplTest.java │ └── sdm │ │ ├── BasicTranslatorTest.java │ │ ├── HardLocationImplTest.java │ │ └── SparseDistributedMemoryImplTest.java │ ├── framework │ ├── FrameworkModuleImplTest.java │ ├── initialization │ │ ├── AgentXmlFactoryTest.java │ │ ├── FactoriesDataXmlLoaderTest.java │ │ ├── FactoriesDataXmlLoaderTest2.java │ │ ├── FactoriesDataXmlLoaderTest3.java │ │ ├── InitializableImplTest.java │ │ ├── StrategyDefTest.java │ │ └── XmlUtilsTest.java │ ├── mockclasses │ │ ├── ExecutingMockTaskSpawner.java │ │ ├── MockActionSelectionImpl.java │ │ ├── MockAttentionCodeletImpl.java │ │ ├── MockBroadcastListener.java │ │ ├── MockDetectionAlgorithm.java │ │ ├── MockFrameworkGuiEventListener.java │ │ ├── MockFrameworkModule.java │ │ ├── MockGlobalWorkspaceImpl.java │ │ ├── MockInitializer.java │ │ ├── MockInitializer2.java │ │ ├── MockLocalAssocListener.java │ │ ├── MockPAM.java │ │ ├── MockSensoryMotorMemory.java │ │ ├── MockTaskSpawner.java │ │ ├── MockTranslator.java │ │ └── MockWorkspaceBufferImpl.java │ ├── shared │ │ ├── ConcurrentHashSetTest.java │ │ ├── DefaultElementFactoryTest.java │ │ ├── ElementFactoryTest.java │ │ ├── ExtendedIdTest.java │ │ ├── LinkImplTest.java │ │ ├── NodeImplTest.java │ │ ├── NodeStructureConcurrencyTest.java │ │ ├── NodeStructureImpl2Test.java │ │ ├── NodeStructureImplTest.java │ │ ├── TestBigNs.java │ │ ├── UnmodifiableNodeStructureImplTest.java │ │ └── activation │ │ │ ├── ActivatibleImplTest.java │ │ │ └── LearnableImplTest.java │ ├── strategies │ │ ├── LinearDecayStrategyTest.java │ │ ├── LinearExciteStrategyTest.java │ │ ├── SigmoidDecayStrategyTest.java │ │ └── SigmoidExciteStrategyTest.java │ └── tasks │ │ ├── FrameworkTaskImplTest.java │ │ ├── MockFrameworkTask.java │ │ ├── MockTaskManager.java │ │ ├── MockTaskSpawner.java │ │ ├── RandomizingTsTest.java │ │ ├── TaskManagerTest.java │ │ └── TaskSpawnerImplTest.java │ ├── globalworkspace │ ├── CoalitionImplTest.java │ ├── GlobalWorkspaceImplTest.java │ ├── GlobalWorkspaceInitalizerTest.java │ ├── MockBroadcastTrigger.java │ └── triggers │ │ ├── AggregateCoalitionActivationTriggerTest.java │ │ ├── IndividualCoaltionActivationTriggerTest.java │ │ ├── NoBroadcastOccurringTriggerTest.java │ │ └── NoCoalitionArrivingTriggerTest.java │ ├── pam │ ├── BasicPamInitializerTest.java │ ├── MockPamListener.java │ ├── PamLinkImplSubclass.java │ ├── PamLinkImplTest.java │ ├── PamNodeImplSubclass.java │ ├── PamNodeImplTest.java │ ├── PerceptualAssociativeMemoryImplTest.java │ └── tasks │ │ ├── AddToPerceptTaskTest.java │ │ ├── ExcitationTaskTest.java │ │ └── PropagationTaskTest.java │ ├── proceduralmemory │ ├── MockProceduralMemory.java │ ├── MockProceduralMemoryListener.java │ ├── ProceduralMemoryImplTest.java │ └── SchemeImplTest.java │ ├── sensorymemory │ ├── MockEnvironmentImpl.java │ ├── SensoryMemoryBackgroundTaskTest.java │ └── SensoryMemoryImplTest.java │ └── workspace │ ├── CueBackgroundTaskTest.java │ ├── MockBroadcastQueueImpl.java │ ├── UpdateCsmBackgroundTaskTest.java │ ├── WorkspaceImplTest.java │ ├── structurebuildingcodelets │ ├── BasicStructureBuildingCodeletTest.java │ ├── MockStructureBuildingCodeletImpl.java │ └── StructureBuildingCodeletModuleTest.java │ └── workspacebuffers │ ├── BroadcastQueueImplTest.java │ └── WorkspaceBufferImplTest.java ├── lib ├── collections-generic-4.01.jar ├── colt-1.2.0.jar ├── concurrent-1.3.4.jar ├── jcommon-1.0.16.jar ├── jfreechart-1.0.13.jar ├── jung-3d-2.0.1.jar ├── jung-3d-demos-2.0.1.jar ├── jung-algorithms-2.0.1.jar ├── jung-api-2.0.1.jar ├── jung-graph-impl-2.0.1.jar ├── jung-io-2.0.1.jar ├── jung-jai-2.0.1.jar ├── jung-jai-samples-2.0.1.jar ├── jung-samples-2.0.1.jar ├── jung-visualization-2.0.1.jar ├── stax-api-1.0.1.jar ├── vecmath-1.3.1.jar └── wstx-asl-3.2.6.jar ├── license └── LIDA-framework-non-commercial-v1.0.pdf ├── manifest.mf ├── nbproject ├── build-impl.xml ├── genfiles.properties ├── project.properties └── project.xml ├── src └── edu │ └── memphis │ └── ccrg │ └── lida │ ├── actionselection │ ├── Action.java │ ├── ActionImpl.java │ ├── ActionSelection.java │ ├── ActionSelectionListener.java │ ├── BasicActionSelection.java │ ├── Behavior.java │ ├── BehaviorImpl.java │ ├── PreafferenceListener.java │ ├── behaviornetwork │ │ ├── .nbattrs │ │ └── BehaviorNetwork.java │ └── package.html │ ├── attentioncodelets │ ├── AttentionCodelet.java │ ├── AttentionCodeletImpl.java │ ├── AttentionCodeletModule.java │ ├── BasicAttentionCodelet.java │ ├── DefaultAttentionCodelet.java │ ├── NeighborhoodAttentionCodelet.java │ └── package.html │ ├── environment │ ├── Environment.java │ ├── EnvironmentImpl.java │ └── package.html │ ├── episodicmemory │ ├── BasicEpisodicMemoryInitializer.java │ ├── CueListener.java │ ├── EpisodicMemory.java │ ├── EpisodicMemoryImpl.java │ ├── LocalAssociationListener.java │ ├── package.html │ └── sdm │ │ ├── BasicTranslator.java │ │ ├── BitVectorUtils.java │ │ ├── HardLocation.java │ │ ├── HardLocationImpl.java │ │ ├── SparseDistributedMemory.java │ │ ├── SparseDistributedMemoryImpl.java │ │ ├── Translator.java │ │ └── package.html │ ├── framework │ ├── Agent.java │ ├── AgentImpl.java │ ├── CodeletManagerModule.java │ ├── FrameworkModule.java │ ├── FrameworkModuleImpl.java │ ├── ModuleListener.java │ ├── ModuleName.java │ ├── gui │ │ ├── FrameworkGui.form │ │ ├── FrameworkGui.java │ │ ├── FrameworkGuiController.java │ │ ├── FrameworkGuiControllerImpl.java │ │ ├── FrameworkGuiFactory.java │ │ ├── commands │ │ │ ├── AddPanelCommand.java │ │ │ ├── AddTicksCommand.java │ │ │ ├── Command.java │ │ │ ├── CommandImpl.java │ │ │ ├── EnableTicksModeCommand.java │ │ │ ├── PauseRunningThreadsCommand.java │ │ │ ├── QuitAllCommand.java │ │ │ ├── ResetEnvironmentCommand.java │ │ │ ├── ResumeRunningThreadsCommand.java │ │ │ ├── SetTimeScaleCommand.java │ │ │ └── package.html │ │ ├── events │ │ │ ├── FrameworkGuiEvent.java │ │ │ ├── FrameworkGuiEventListener.java │ │ │ ├── GuiEventProvider.java │ │ │ └── package.html │ │ ├── package.html │ │ ├── panels │ │ │ ├── ActionSelectionPanel.form │ │ │ ├── ActionSelectionPanel.java │ │ │ ├── ActivationChartPanel.form │ │ │ ├── ActivationChartPanel.java │ │ │ ├── AddEditPanel.form │ │ │ ├── AddEditPanel.java │ │ │ ├── BroadcastQueuePanel.form │ │ │ ├── BroadcastQueuePanel.java │ │ │ ├── ConfigurationFilesPanel.form │ │ │ ├── ConfigurationFilesPanel.java │ │ │ ├── ControlToolBarPanel.form │ │ │ ├── ControlToolBarPanel.java │ │ │ ├── FrameworkTaskPanel.form │ │ │ ├── FrameworkTaskPanel.java │ │ │ ├── GlobalWorkspaceTablePanel.form │ │ │ ├── GlobalWorkspaceTablePanel.java │ │ │ ├── GuiPanel.java │ │ │ ├── GuiPanelImpl.form │ │ │ ├── GuiPanelImpl.java │ │ │ ├── LoggingPanel.form │ │ │ ├── LoggingPanel.java │ │ │ ├── NodeStructurePanel.form │ │ │ ├── NodeStructurePanel.java │ │ │ ├── NodeStructureTable.form │ │ │ ├── NodeStructureTable.java │ │ │ ├── ProceduralMemoryPanel.form │ │ │ ├── ProceduralMemoryPanel.java │ │ │ ├── TaskQueuePanel.form │ │ │ ├── TaskQueuePanel.java │ │ │ └── package.html │ │ └── utils │ │ │ ├── GuiLink.java │ │ │ ├── GuiUtils.java │ │ │ ├── NodeIcon.java │ │ │ ├── NodeStructureGuiAdapter.java │ │ │ └── package.html │ ├── initialization │ │ ├── AgentFactory.java │ │ ├── AgentStarter.java │ │ ├── AgentXmlFactory.java │ │ ├── ConfigUtils.java │ │ ├── FactoriesDataXmlLoader.java │ │ ├── FrameworkFormatter.java │ │ ├── FrameworkGuiDef.java │ │ ├── FrameworkGuiPanelDef.java │ │ ├── FrameworkTaskDef.java │ │ ├── FullyInitializable.java │ │ ├── GlobalInitializer.java │ │ ├── Initializable.java │ │ ├── InitializableImpl.java │ │ ├── Initializer.java │ │ ├── LinkableDef.java │ │ ├── ModuleUsage.java │ │ ├── StrategyDef.java │ │ ├── XmlUtils.java │ │ ├── config │ │ │ ├── LidaFactories.xsd │ │ │ ├── LidaGuiDef.xsd │ │ │ └── LidaXMLSchema.xsd │ │ └── package.html │ ├── package.html │ ├── shared │ │ ├── ConcurrentHashSet.java │ │ ├── ElementFactory.java │ │ ├── ExtendedId.java │ │ ├── Link.java │ │ ├── LinkCategory.java │ │ ├── LinkImpl.java │ │ ├── Linkable.java │ │ ├── Node.java │ │ ├── NodeImpl.java │ │ ├── NodeStructure.java │ │ ├── NodeStructureImpl.java │ │ ├── NodeType.java │ │ ├── RefractoryPeriod.java │ │ ├── Translatable.java │ │ ├── UnmodifiableNodeStructureImpl.java │ │ ├── activation │ │ │ ├── Activatible.java │ │ │ ├── ActivatibleImpl.java │ │ │ ├── Learnable.java │ │ │ ├── LearnableImpl.java │ │ │ └── package.html │ │ └── package.html │ ├── strategies │ │ ├── DecayStrategy.java │ │ ├── DefaultTotalActivationStrategy.java │ │ ├── ExciteStrategy.java │ │ ├── LinearDecayStrategy.java │ │ ├── LinearExciteStrategy.java │ │ ├── LinearIncentiveSalienceDecay.java │ │ ├── NoDecayStrategy.java │ │ ├── NoExciteStrategy.java │ │ ├── SigmoidDecayStrategy.java │ │ ├── SigmoidExciteStrategy.java │ │ ├── Strategy.java │ │ ├── StrategyImpl.java │ │ ├── TotalActivationStrategy.java │ │ ├── WeightedTotalActivationStrategy.java │ │ └── package.html │ └── tasks │ │ ├── Codelet.java │ │ ├── CodeletImpl.java │ │ ├── FrameworkTask.java │ │ ├── FrameworkTaskImpl.java │ │ ├── RandomizingTaskSpawner.java │ │ ├── TaskManager.java │ │ ├── TaskSpawner.java │ │ ├── TaskSpawnerImpl.java │ │ ├── TaskStatus.java │ │ └── package.html │ ├── globalworkspace │ ├── BroadcastContent.java │ ├── BroadcastListener.java │ ├── Coalition.java │ ├── CoalitionImpl.java │ ├── GlobalWorkspace.java │ ├── GlobalWorkspaceImpl.java │ ├── GlobalWorkspaceInitalizer.java │ ├── GlobalWorkspaceInitializer.java │ ├── package.html │ └── triggers │ │ ├── AggregateCoalitionActivationTrigger.java │ │ ├── BroadcastTrigger.java │ │ ├── IndividualCoaltionActivationTrigger.java │ │ ├── NoBroadcastOccurringTrigger.java │ │ ├── NoCoalitionArrivingTrigger.java │ │ ├── TriggerListener.java │ │ ├── TriggerTask.java │ │ └── package.html │ ├── motivation │ ├── pam │ │ ├── FeelingPamLinkImpl.java │ │ ├── FeelingPamNodeImpl.java │ │ ├── IncentiveSaliencePropagationTask.java │ │ ├── MotivationPamInitializer.java │ │ └── MotivationPerceptualAssociativeMemory.java │ ├── proceduralmemory │ │ ├── MotivationProceduralMemory.java │ │ └── MotivationProceduralMemoryInitializer.java │ ├── shared │ │ ├── FeelingLinkImpl.java │ │ ├── FeelingNode.java │ │ ├── FeelingNodeImpl.java │ │ ├── Valenceable.java │ │ └── ValenceableImpl.java │ └── workspace │ │ ├── FeelingStructureBuildingCodelet.java │ │ ├── MotivationWorkspace.java │ │ └── MotivationWorkspaceInitializer.java │ ├── pam │ ├── BasicPamInitializer.java │ ├── PamLink.java │ ├── PamLinkImpl.java │ ├── PamLinkable.java │ ├── PamListener.java │ ├── PamNode.java │ ├── PamNodeImpl.java │ ├── PerceptualAssociativeMemory.java │ ├── PerceptualAssociativeMemoryImpl.java │ ├── PropagationStrategy.java │ ├── UpscalePropagationStrategy.java │ ├── package.html │ └── tasks │ │ ├── AddLinkToPerceptTask.java │ │ ├── AddNodeStructureToPerceptTask.java │ │ ├── AddNodeToPerceptTask.java │ │ ├── BasicDetectionAlgorithm.java │ │ ├── DetectionAlgorithm.java │ │ ├── ExcitationTask.java │ │ ├── MultipleDetectionAlgorithm.java │ │ ├── PropagationTask.java │ │ └── package.html │ ├── proceduralmemory │ ├── BasicProceduralMemoryInitializer.java │ ├── Condition.java │ ├── ProceduralMemory.java │ ├── ProceduralMemoryImpl.java │ ├── ProceduralMemoryListener.java │ ├── ProceduralUnit.java │ ├── Scheme.java │ ├── SchemeImpl.java │ └── package.html │ ├── sensorymemory │ ├── SensoryMemory.java │ ├── SensoryMemoryBackgroundTask.java │ ├── SensoryMemoryImpl.java │ ├── SensoryMemoryListener.java │ └── package.html │ ├── sensorymotormemory │ ├── BasicSensoryMotorMemory.java │ ├── BasicSensoryMotorMemoryInitializer.java │ ├── SensoryMotorMemory.java │ ├── SensoryMotorMemoryListener.java │ └── package.html │ └── workspace │ ├── CueBackgroundTask.java │ ├── UpdateCsmBackgroundTask.java │ ├── Workspace.java │ ├── WorkspaceContent.java │ ├── WorkspaceImpl.java │ ├── WorkspaceListener.java │ ├── package.html │ ├── structurebuildingcodelets │ ├── BasicStructureBuildingCodelet.java │ ├── StructureBuildingCodelet.java │ ├── StructureBuildingCodeletImpl.java │ ├── StructureBuildingCodeletModule.java │ └── package.html │ └── workspacebuffers │ ├── BroadcastQueue.java │ ├── BroadcastQueueImpl.java │ ├── WorkspaceBuffer.java │ ├── WorkspaceBufferImpl.java │ └── package.html └── testData ├── agentbad.xml ├── lidaPAM.xml ├── shortagent.xml └── testFactoriesData.xml /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /lida-framework/nbproject/private/ 2 | /nbproject/private/ -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | lidaFramework-v1.3b 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /.settings/org.eclipse.ltk.core.refactoring.prefs: -------------------------------------------------------------------------------- 1 | #Tue Jul 13 15:38:02 CDT 2010 2 | eclipse.preferences.version=1 3 | org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false 4 | -------------------------------------------------------------------------------- /configs/guiCommands.properties: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | # This program and the accompanying materials are made available 4 | # under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | # which accompanies this distribution, and is available at 6 | # http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | ############################################################################### 8 | pauseRunningThreads=edu.memphis.ccrg.lida.framework.gui.commands.PauseRunningThreadsCommand 9 | quitAll=edu.memphis.ccrg.lida.framework.gui.commands.QuitAllCommand 10 | resetEnvironment=edu.memphis.ccrg.lida.framework.gui.commands.ResetEnvironmentCommand 11 | resumeRunningThreads=edu.memphis.ccrg.lida.framework.gui.commands.ResumeRunningThreadsCommand 12 | setTimeScale=edu.memphis.ccrg.lida.framework.gui.commands.SetTimeScaleCommand 13 | EnableTicksMode=edu.memphis.ccrg.lida.framework.gui.commands.EnableTicksModeCommand 14 | AddTicks=edu.memphis.ccrg.lida.framework.gui.commands.AddTicksCommand -------------------------------------------------------------------------------- /configs/guiPanels.properties: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | # This program and the accompanying materials are made available 4 | # under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | # which accompanies this distribution, and is available at 6 | # http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | ############################################################################### 8 | #name = panel title, class name, Position [A,B,C,FLOAT, TOOL], tab order, Refresh after load 9 | 10 | # ____Tool Bar____ 11 | toolBar=Tool Bar,edu.memphis.ccrg.lida.framework.gui.panels.ControlToolBarPanel,TOOL,1,Y,0,1000 12 | 13 | # ____A Section____ 14 | environment=Test Environment,edu.memphis.ccrg.lida.example.genericlida.environment.VisualEnvironmentPanel,A,1,Y 15 | 16 | # ____B Section____ 17 | pamTable= PAM Table,edu.memphis.ccrg.lida.framework.gui.panels.NodeStructureTable,B,1,Y,PerceptualAssociativeMemory 18 | pamGraph= PAM Graph,edu.memphis.ccrg.lida.framework.gui.panels.NodeStructurePanel,B,2,Y,PerceptualAssociativeMemory 19 | runningTasks= Running Tasks,edu.memphis.ccrg.lida.framework.gui.panels.FrameworkTaskPanel,B,3,Y,PerceptualAssociativeMemory 20 | 21 | PerceptualBuffer = PerceptualBuffer,edu.memphis.ccrg.lida.framework.gui.panels.NodeStructurePanel,B,4,Y,Workspace.PerceptualBuffer 22 | CSM = CSM,edu.memphis.ccrg.lida.framework.gui.panels.NodeStructurePanel,B,5,Y,Workspace.CurrentSituationalModel 23 | 24 | GW = GW Coalitions,edu.memphis.ccrg.lida.framework.gui.panels.GlobalWorkspaceTablePanel,B,6,Y,GlobalWorkspace 25 | 26 | # ____C Section____ 27 | LogPanel=Logging,edu.memphis.ccrg.lida.framework.gui.panels.LoggingPanel,C,1,N 28 | configFiles = Configuration Files,edu.memphis.ccrg.lida.framework.gui.panels.ConfigurationFilesPanel,C,2,N 29 | taskQueue=Task Queue,edu.memphis.ccrg.lida.framework.gui.panels.TaskQueuePanel,C,4,N -------------------------------------------------------------------------------- /configs/lidaConfig.properties: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | # This program and the accompanying materials are made available 4 | # under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | # which accompanies this distribution, and is available at 6 | # http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | ############################################################################### 8 | #Agent properties 9 | lida.agentdata=configs/agent.xml 10 | lida.elementfactory.data=configs/factoryData.xml 11 | 12 | #Gui properties 13 | lida.gui.panels=configs/guiPanels.properties 14 | lida.gui.commands=configs/guiCommands.properties 15 | lida.gui.enable=true 16 | lida.gui.refreshRate=5 17 | 18 | #Logging properties 19 | lida.logging.configuration=configs/logging.properties -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/actionselection/behaviornetwork/MockActionSelectionListener.java: -------------------------------------------------------------------------------- 1 | package edu.memphis.ccrg.lida.actionselection.behaviornetwork; 2 | 3 | import edu.memphis.ccrg.lida.actionselection.Action; 4 | import edu.memphis.ccrg.lida.actionselection.ActionSelectionListener; 5 | 6 | public class MockActionSelectionListener implements ActionSelectionListener { 7 | 8 | public Action action; 9 | 10 | @Override 11 | public void receiveAction(Action a) { 12 | action = a; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/actionselection/behaviornetwork/OrderingTest.java: -------------------------------------------------------------------------------- 1 | package edu.memphis.ccrg.lida.actionselection.behaviornetwork; 2 | 3 | public class OrderingTest { 4 | 5 | public static void main(String[] args) { 6 | new OrderingTest().go(); 7 | } 8 | 9 | private Long[] src = new Long[10]; 10 | 11 | public void go() { 12 | for (long i = 0; i < src.length; i++) { 13 | src[(int) i] = i; 14 | } 15 | printIt(src); 16 | printIt(getRandomOrdering()); 17 | printIt(getRandomOrdering()); 18 | printIt(getRandomOrdering()); 19 | printIt(getRandomOrdering()); 20 | } 21 | 22 | private Long[] getRandomOrdering() { 23 | Long[] keys = src.clone(); 24 | for (int i = 0; i < keys.length - 1; i++) { 25 | int swapPosition = (int) (Math.random() * (keys.length - i)) + i; 26 | Long stored = keys[i]; 27 | keys[i] = keys[swapPosition]; 28 | keys[swapPosition] = stored; 29 | } 30 | return keys; 31 | } 32 | 33 | private void printIt(Long[] a) { 34 | // for(int i = 0; i < a.length; i++){ 35 | // System.out.print(a[i] + " "); 36 | // } 37 | for (Long l : a) { 38 | System.out.print(l + " "); 39 | } 40 | 41 | System.out.println(); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/attentioncodelets/MockAttentionCodeletImpl.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.attentioncodelets; 9 | 10 | import edu.memphis.ccrg.lida.framework.shared.NodeStructure; 11 | import edu.memphis.ccrg.lida.workspace.workspacebuffers.WorkspaceBuffer; 12 | 13 | public class MockAttentionCodeletImpl extends AttentionCodeletImpl { 14 | 15 | @Override 16 | public boolean bufferContainsSoughtContent(WorkspaceBuffer buffer) { 17 | 18 | return false; 19 | } 20 | 21 | @Override 22 | public NodeStructure retrieveWorkspaceContent(WorkspaceBuffer buffer) { 23 | 24 | return null; 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | return null; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/episodicmemory/BasicEMinitializerTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.episodicmemory; 9 | 10 | import static org.junit.Assert.assertNull; 11 | import static org.junit.Assert.assertTrue; 12 | 13 | import org.junit.Before; 14 | import org.junit.Test; 15 | 16 | import edu.memphis.ccrg.lida.episodicmemory.sdm.BasicTranslator; 17 | import edu.memphis.ccrg.lida.framework.Agent; 18 | import edu.memphis.ccrg.lida.framework.AgentImpl; 19 | import edu.memphis.ccrg.lida.framework.ModuleName; 20 | import edu.memphis.ccrg.lida.framework.mockclasses.MockPAM; 21 | import edu.memphis.ccrg.lida.framework.tasks.TaskManager; 22 | import edu.memphis.ccrg.lida.pam.PerceptualAssociativeMemory; 23 | 24 | public class BasicEMinitializerTest { 25 | 26 | private BasicEpisodicMemoryInitializer initializer; 27 | 28 | @Before 29 | public void setUp() throws Exception { 30 | initializer = new BasicEpisodicMemoryInitializer(); 31 | } 32 | 33 | @Test 34 | public void testInitModule() { 35 | TaskManager tm = new TaskManager(10, 10, -1,null); 36 | Agent agent = new AgentImpl(tm); 37 | PerceptualAssociativeMemory pam = new MockPAM(); 38 | pam.setModuleName(ModuleName.PerceptualAssociativeMemory); 39 | agent.addSubModule(pam); 40 | EpisodicMemoryImpl module = new EpisodicMemoryImpl(); 41 | initializer.initModule(module, agent, null); 42 | assertTrue(module.getTranslator() instanceof BasicTranslator); 43 | } 44 | 45 | @Test 46 | public void testInitModule1() { 47 | TaskManager tm = new TaskManager(10, 10, -1,null); 48 | Agent agent = new AgentImpl(tm); 49 | EpisodicMemoryImpl module = new EpisodicMemoryImpl(); 50 | initializer.initModule(module, agent, null); 51 | assertNull(module.getTranslator()); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/episodicmemory/sdm/BasicTranslatorTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.episodicmemory.sdm; 9 | 10 | import static org.junit.Assert.assertEquals; 11 | 12 | import org.junit.Before; 13 | import org.junit.Test; 14 | 15 | import cern.colt.bitvector.BitVector; 16 | import edu.memphis.ccrg.lida.framework.mockclasses.MockPAM; 17 | import edu.memphis.ccrg.lida.framework.shared.Node; 18 | import edu.memphis.ccrg.lida.framework.shared.NodeImpl; 19 | import edu.memphis.ccrg.lida.framework.shared.NodeStructure; 20 | import edu.memphis.ccrg.lida.framework.shared.NodeStructureImpl; 21 | import edu.memphis.ccrg.lida.pam.PerceptualAssociativeMemory; 22 | 23 | public class BasicTranslatorTest { 24 | 25 | private Translator tr; 26 | private static int SIZE = 100; 27 | private PerceptualAssociativeMemory pam; 28 | private NodeStructure ns; 29 | private BitVector vector; 30 | 31 | @Before 32 | public void setUp() throws Exception { 33 | pam = new MockPAM(); 34 | tr = new BasicTranslator(SIZE, pam); 35 | ns = new NodeStructureImpl(); 36 | Node n = new NodeImpl(); 37 | n.setId(10); 38 | ns.addDefaultNode(n); 39 | n = new NodeImpl(); 40 | n.setId(20); 41 | ns.addDefaultNode(n); 42 | vector = new BitVector(SIZE); 43 | vector.set(10); 44 | vector.set(20); 45 | 46 | } 47 | 48 | @Test 49 | public void testTranslateBitVector() { 50 | BitVector v = tr.translate(ns); 51 | assertEquals(vector, v); 52 | } 53 | 54 | @Test 55 | public void testTranslateNodeStructure() { 56 | NodeStructure nss = tr.translate(vector); 57 | assert (nss.getNodes().equals(ns.getNodes())); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/framework/mockclasses/ExecutingMockTaskSpawner.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.mockclasses; 9 | 10 | import java.util.ArrayList; 11 | import java.util.Collection; 12 | import java.util.Collections; 13 | import java.util.List; 14 | 15 | import edu.memphis.ccrg.lida.framework.tasks.FrameworkTask; 16 | import edu.memphis.ccrg.lida.framework.tasks.TaskSpawner; 17 | import edu.memphis.ccrg.lida.framework.tasks.TaskSpawnerImpl; 18 | 19 | public class ExecutingMockTaskSpawner extends TaskSpawnerImpl implements 20 | TaskSpawner { 21 | public List tasks = new ArrayList(); 22 | 23 | @Override 24 | public void addTask(FrameworkTask task) { 25 | tasks.add(task); 26 | task.setControllingTaskSpawner(this); 27 | try { 28 | task.call(); 29 | } catch (Exception e) { 30 | e.printStackTrace(); 31 | } 32 | } 33 | 34 | @Override 35 | public boolean cancelTask(FrameworkTask task) { 36 | return tasks.remove(task); 37 | } 38 | 39 | @Deprecated 40 | @Override 41 | public Collection getRunningTasks() { 42 | return getTasks(); 43 | } 44 | 45 | @Override 46 | public Collection getTasks() { 47 | return Collections.unmodifiableCollection(tasks); 48 | } 49 | 50 | @Override 51 | public void receiveFinishedTask(FrameworkTask task) { 52 | 53 | } 54 | 55 | @Override 56 | public void addTasks(Collection initialTasks) { 57 | for (FrameworkTask t : initialTasks) { 58 | addTask(t); 59 | } 60 | } 61 | 62 | @Override 63 | public void init() { 64 | // not implemented 65 | 66 | } 67 | 68 | @Override 69 | public boolean containsTask(FrameworkTask t) { 70 | return tasks.contains(t); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/framework/mockclasses/MockActionSelectionImpl.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.mockclasses; 9 | 10 | import java.util.Collection; 11 | import java.util.logging.Logger; 12 | 13 | import edu.memphis.ccrg.lida.actionselection.ActionSelection; 14 | import edu.memphis.ccrg.lida.actionselection.ActionSelectionListener; 15 | import edu.memphis.ccrg.lida.actionselection.Behavior; 16 | import edu.memphis.ccrg.lida.actionselection.PreafferenceListener; 17 | import edu.memphis.ccrg.lida.framework.FrameworkModuleImpl; 18 | import edu.memphis.ccrg.lida.framework.ModuleListener; 19 | 20 | public class MockActionSelectionImpl extends FrameworkModuleImpl implements 21 | ActionSelection { 22 | 23 | private static final Logger logger = Logger 24 | .getLogger(MockActionSelectionImpl.class.getCanonicalName()); 25 | 26 | @Override 27 | public void addActionSelectionListener(ActionSelectionListener listener) { 28 | } 29 | 30 | @Override 31 | public void init() { 32 | } 33 | 34 | @Override 35 | public void addPreafferenceListener(PreafferenceListener listener) { 36 | 37 | } 38 | 39 | @Override 40 | public void decayModule(long ticks) { 41 | // not implemented 42 | 43 | } 44 | 45 | @Override 46 | public Object getModuleContent(Object... params) { 47 | 48 | return null; 49 | } 50 | 51 | @Override 52 | public void addListener(ModuleListener listener) { 53 | 54 | } 55 | 56 | @Override 57 | public Behavior selectBehavior(Collection behaviors, 58 | double candidateThreshold) { 59 | // TODO Auto-generated method stub 60 | return null; 61 | } 62 | 63 | @Override 64 | public Collection getBehaviors() { 65 | // TODO Auto-generated method stub 66 | return null; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/framework/mockclasses/MockBroadcastListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.mockclasses; 9 | 10 | import edu.memphis.ccrg.lida.globalworkspace.BroadcastContent; 11 | import edu.memphis.ccrg.lida.globalworkspace.BroadcastListener; 12 | import edu.memphis.ccrg.lida.globalworkspace.Coalition; 13 | 14 | public class MockBroadcastListener implements BroadcastListener { 15 | 16 | public BroadcastContent content; 17 | 18 | @Override 19 | public void receiveBroadcast(Coalition c) { 20 | content = c.getContent(); 21 | } 22 | 23 | @Override 24 | public void learn(Coalition c) { 25 | // not implemetned 26 | 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/framework/mockclasses/MockDetectionAlgorithm.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.mockclasses; 9 | 10 | import edu.memphis.ccrg.lida.pam.tasks.BasicDetectionAlgorithm; 11 | 12 | public class MockDetectionAlgorithm extends BasicDetectionAlgorithm { 13 | 14 | public MockDetectionAlgorithm() { 15 | } 16 | 17 | @Override 18 | public double detect() { 19 | return 0; 20 | } 21 | 22 | @Override 23 | public String toString() { 24 | return null; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/framework/mockclasses/MockFrameworkGuiEventListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.mockclasses; 9 | 10 | import edu.memphis.ccrg.lida.framework.gui.events.FrameworkGuiEvent; 11 | import edu.memphis.ccrg.lida.framework.gui.events.FrameworkGuiEventListener; 12 | import edu.memphis.ccrg.lida.framework.tasks.TaskManager; 13 | 14 | public class MockFrameworkGuiEventListener implements FrameworkGuiEventListener { 15 | 16 | public FrameworkGuiEvent event; 17 | public long tick; 18 | 19 | @Override 20 | public void receiveFrameworkGuiEvent(FrameworkGuiEvent event) { 21 | this.event = event; 22 | tick = TaskManager.getCurrentTick(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/framework/mockclasses/MockFrameworkModule.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.mockclasses; 9 | 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | 13 | import edu.memphis.ccrg.lida.framework.FrameworkModule; 14 | import edu.memphis.ccrg.lida.framework.FrameworkModuleImpl; 15 | import edu.memphis.ccrg.lida.framework.ModuleListener; 16 | 17 | public class MockFrameworkModule extends FrameworkModuleImpl { 18 | 19 | public boolean wasDecayed; 20 | public long decayTicks; 21 | public List listeners = new ArrayList(); 22 | 23 | @Override 24 | public Object getModuleContent(Object... params) { 25 | 26 | return null; 27 | } 28 | 29 | @Override 30 | public void init() { 31 | 32 | } 33 | 34 | @Override 35 | public void addListener(ModuleListener listener) { 36 | listeners.add(listener); 37 | 38 | } 39 | 40 | @Override 41 | public void decayModule(long ticks) { 42 | decayTicks = ticks; 43 | wasDecayed = true; 44 | } 45 | 46 | public FrameworkModule associatedModule; 47 | public String moduleUsage; 48 | 49 | @Override 50 | public void setAssociatedModule(FrameworkModule module, String moduleUsage) { 51 | associatedModule = module; 52 | this.moduleUsage = moduleUsage; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/framework/mockclasses/MockInitializer.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.mockclasses; 9 | 10 | import java.util.Map; 11 | 12 | import edu.memphis.ccrg.lida.framework.Agent; 13 | import edu.memphis.ccrg.lida.framework.initialization.FullyInitializable; 14 | import edu.memphis.ccrg.lida.framework.initialization.Initializer; 15 | 16 | public class MockInitializer implements Initializer { 17 | 18 | public static FullyInitializable module; 19 | public static Agent agent; 20 | public static Map params; 21 | 22 | @Override 23 | public void initModule(FullyInitializable module, Agent agent, 24 | Map params) { 25 | MockInitializer.module = module; 26 | MockInitializer.agent = agent; 27 | MockInitializer.params = params; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/framework/mockclasses/MockInitializer2.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.mockclasses; 9 | 10 | import java.util.Map; 11 | 12 | import edu.memphis.ccrg.lida.framework.Agent; 13 | import edu.memphis.ccrg.lida.framework.initialization.FullyInitializable; 14 | import edu.memphis.ccrg.lida.framework.initialization.Initializer; 15 | 16 | public class MockInitializer2 implements Initializer { 17 | 18 | public static FullyInitializable module; 19 | public static Agent agent; 20 | public static Map params; 21 | 22 | @Override 23 | public void initModule(FullyInitializable module, Agent agent, 24 | Map params) { 25 | MockInitializer2.module = module; 26 | MockInitializer2.agent = agent; 27 | MockInitializer2.params = params; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/framework/mockclasses/MockLocalAssocListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.mockclasses; 9 | 10 | import edu.memphis.ccrg.lida.episodicmemory.LocalAssociationListener; 11 | import edu.memphis.ccrg.lida.framework.shared.NodeStructure; 12 | 13 | public class MockLocalAssocListener implements LocalAssociationListener { 14 | 15 | public NodeStructure ns; 16 | 17 | @Override 18 | public void receiveLocalAssociation(NodeStructure association) { 19 | ns = association; 20 | 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/framework/mockclasses/MockSensoryMotorMemory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.mockclasses; 9 | 10 | import edu.memphis.ccrg.lida.actionselection.Action; 11 | import edu.memphis.ccrg.lida.actionselection.ActionSelectionListener; 12 | import edu.memphis.ccrg.lida.sensorymotormemory.BasicSensoryMotorMemory; 13 | 14 | public class MockSensoryMotorMemory extends BasicSensoryMotorMemory implements 15 | ActionSelectionListener { 16 | 17 | public boolean actionReceived = false; 18 | public Action action; 19 | 20 | @Override 21 | public synchronized void receiveAction(Action action) { 22 | if (action != null) { 23 | actionReceived = true; 24 | this.action = action; 25 | } else { 26 | actionReceived = false; 27 | } 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/framework/mockclasses/MockTaskSpawner.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.mockclasses; 9 | 10 | import java.util.ArrayList; 11 | import java.util.Collection; 12 | import java.util.Collections; 13 | import java.util.List; 14 | 15 | import edu.memphis.ccrg.lida.framework.tasks.FrameworkTask; 16 | import edu.memphis.ccrg.lida.framework.tasks.TaskSpawner; 17 | import edu.memphis.ccrg.lida.framework.tasks.TaskSpawnerImpl; 18 | 19 | public class MockTaskSpawner extends TaskSpawnerImpl implements TaskSpawner { 20 | 21 | public List tasks = new ArrayList(); 22 | 23 | @Override 24 | public void addTask(FrameworkTask task) { 25 | tasks.add(task); 26 | task.setControllingTaskSpawner(this); 27 | } 28 | 29 | @Override 30 | public boolean cancelTask(FrameworkTask task) { 31 | return tasks.remove(task); 32 | } 33 | 34 | @Override 35 | public Collection getTasks() { 36 | return Collections.unmodifiableCollection(tasks); 37 | } 38 | 39 | @Deprecated 40 | @Override 41 | public Collection getRunningTasks() { 42 | return getTasks(); 43 | } 44 | 45 | @Override 46 | public void receiveFinishedTask(FrameworkTask task) { 47 | 48 | } 49 | 50 | @Override 51 | public void addTasks(Collection initialTasks) { 52 | for (FrameworkTask t : initialTasks) { 53 | addTask(t); 54 | } 55 | } 56 | 57 | @Override 58 | public void init() { 59 | // not implemented 60 | 61 | } 62 | 63 | @Override 64 | public boolean containsTask(FrameworkTask t) { 65 | return tasks.contains(t); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/framework/mockclasses/MockTranslator.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.mockclasses; 9 | 10 | import cern.colt.bitvector.BitVector; 11 | import edu.memphis.ccrg.lida.episodicmemory.sdm.BitVectorUtils; 12 | import edu.memphis.ccrg.lida.episodicmemory.sdm.Translator; 13 | import edu.memphis.ccrg.lida.framework.shared.NodeStructure; 14 | 15 | public class MockTranslator implements Translator { 16 | 17 | public NodeStructure ns; 18 | public NodeStructure ns2; 19 | public BitVector v = BitVectorUtils.getRandomVector(1000); 20 | public BitVector data; 21 | 22 | @Override 23 | public NodeStructure translate(BitVector data) { 24 | this.data = data; 25 | return ns2; 26 | } 27 | 28 | @Override 29 | public BitVector translate(NodeStructure structure) { 30 | ns = structure; 31 | return v; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/framework/mockclasses/MockWorkspaceBufferImpl.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.mockclasses; 9 | 10 | import java.util.Map; 11 | 12 | import edu.memphis.ccrg.lida.framework.shared.NodeStructure; 13 | import edu.memphis.ccrg.lida.framework.shared.NodeStructureImpl; 14 | import edu.memphis.ccrg.lida.workspace.WorkspaceContent; 15 | import edu.memphis.ccrg.lida.workspace.workspacebuffers.WorkspaceBufferImpl; 16 | 17 | public class MockWorkspaceBufferImpl extends WorkspaceBufferImpl { 18 | 19 | public Map params; 20 | public NodeStructure content = new NodeStructureImpl(); 21 | 22 | @Override 23 | public WorkspaceContent getBufferContent(Map params) { 24 | this.params = params; 25 | return super.getBufferContent(params); 26 | } 27 | 28 | @Override 29 | public void addBufferContent(WorkspaceContent content) { 30 | super.addBufferContent(content); 31 | this.content = content; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/framework/shared/ConcurrentHashSetTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.shared; 9 | 10 | import static org.junit.Assert.assertEquals; 11 | import static org.junit.Assert.assertNotNull; 12 | 13 | import java.util.Set; 14 | 15 | import org.junit.Before; 16 | import org.junit.Test; 17 | 18 | public class ConcurrentHashSetTest { 19 | 20 | @Before 21 | public void setUp() throws Exception { 22 | } 23 | 24 | @Test 25 | public void test1() { 26 | Set hashSet = new ConcurrentHashSet(); 27 | assertNotNull(hashSet); 28 | assertEquals(0, hashSet.size()); 29 | 30 | hashSet = new ConcurrentHashSet(hashSet); 31 | assertNotNull(hashSet); 32 | assertEquals(0, hashSet.size()); 33 | 34 | hashSet = new ConcurrentHashSet(34); 35 | assertNotNull(hashSet); 36 | assertEquals(0, hashSet.size()); 37 | 38 | hashSet = new ConcurrentHashSet(4, 0.99F); 39 | assertNotNull(hashSet); 40 | assertEquals(0, hashSet.size()); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/framework/shared/DefaultElementFactoryTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.shared; 9 | 10 | import static org.junit.Assert.assertTrue; 11 | 12 | import org.junit.Before; 13 | import org.junit.Test; 14 | 15 | import edu.memphis.ccrg.lida.framework.strategies.NoDecayStrategy; 16 | import edu.memphis.ccrg.lida.framework.strategies.NoExciteStrategy; 17 | import edu.memphis.ccrg.lida.pam.PamNode; 18 | import edu.memphis.ccrg.lida.pam.PamNodeImpl; 19 | 20 | public class DefaultElementFactoryTest { 21 | 22 | private static ElementFactory factory; 23 | 24 | @Before 25 | public void setUp() throws Exception { 26 | factory = ElementFactory.getInstance(); 27 | } 28 | 29 | @Test 30 | public void checkHasDefaultElementTypes() { 31 | assertTrue(factory.containsNodeType("NodeImpl")); 32 | assertTrue(factory.getNode("NodeImpl") instanceof NodeImpl); 33 | assertTrue(factory.containsNodeType("PamNodeImpl")); 34 | assertTrue(factory.getNode("PamNodeImpl") instanceof PamNodeImpl); 35 | assertTrue(factory.containsNodeType("NoDecayPamNode")); 36 | 37 | PamNode n = (PamNode) factory.getNode("NoDecayPamNode"); 38 | assertTrue(n.getBaseLevelDecayStrategy() instanceof NoDecayStrategy); 39 | assertTrue(n.getBaseLevelExciteStrategy() instanceof NoExciteStrategy); 40 | 41 | assertTrue(factory.containsLinkType("LinkImpl")); 42 | assertTrue(factory.containsLinkType("PamLinkImpl")); 43 | assertTrue(factory.containsLinkType("NoDecayPamLink")); 44 | 45 | assertTrue(factory.containsStrategy("noDecay")); 46 | assertTrue(factory.containsStrategy("noExcite")); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/framework/tasks/MockFrameworkTask.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.tasks; 9 | 10 | import edu.memphis.ccrg.lida.framework.FrameworkModule; 11 | 12 | public class MockFrameworkTask extends FrameworkTaskImpl { 13 | public MockFrameworkTask(int i, TaskSpawner taskSpawner) { 14 | super(i, taskSpawner); 15 | } 16 | 17 | public MockFrameworkTask(int i) { 18 | super(i); 19 | } 20 | 21 | public MockFrameworkTask() { 22 | super(10); 23 | } 24 | 25 | // @Override 26 | // public String toString() { 27 | // return "testTask"; 28 | // } 29 | public boolean wasRun; 30 | 31 | @Override 32 | protected void runThisFrameworkTask() { 33 | wasRun = true; 34 | } 35 | 36 | public FrameworkModule associatedModule; 37 | public String moduleUsage; 38 | 39 | @Override 40 | public void setAssociatedModule(FrameworkModule module, String moduleUsage) { 41 | associatedModule = module; 42 | this.moduleUsage = moduleUsage; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/framework/tasks/MockTaskManager.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.tasks; 9 | 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | 13 | public class MockTaskManager extends TaskManager { 14 | 15 | public FrameworkTask task; 16 | public FrameworkTask cancelTask; 17 | public long ticks; 18 | public List tasks = new ArrayList(); 19 | 20 | public MockTaskManager(int tickDuration, int maxPoolSize, int shutdownTick) { 21 | super(tickDuration, maxPoolSize, shutdownTick,null); 22 | 23 | } 24 | 25 | @Override 26 | public boolean scheduleTask(FrameworkTask task, long inXTicks) { 27 | this.task = task; 28 | ticks = inXTicks; 29 | tasks.add(task); 30 | return true; 31 | 32 | } 33 | 34 | @Override 35 | public boolean cancelTask(FrameworkTask task) { 36 | cancelTask = task; 37 | return true; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/framework/tasks/MockTaskSpawner.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.tasks; 9 | 10 | public class MockTaskSpawner extends TaskSpawnerImpl { 11 | 12 | public FrameworkTask lastReceived; 13 | 14 | @Override 15 | public void receiveFinishedTask(FrameworkTask task) { 16 | lastReceived = task; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/framework/tasks/RandomizingTsTest.java: -------------------------------------------------------------------------------- 1 | package edu.memphis.ccrg.lida.framework.tasks; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import java.util.logging.Level; 6 | import java.util.logging.Logger; 7 | 8 | import org.junit.Before; 9 | import org.junit.Test; 10 | 11 | public class RandomizingTsTest { 12 | private static final Logger logger = Logger.getLogger("RandomizingTsTest"); 13 | private RandomizingTaskSpawner ts; 14 | 15 | @Before 16 | public void setUp() throws Exception { 17 | ts = new RandomizingTaskSpawner(); 18 | } 19 | 20 | @Test 21 | public void testRandomize() { 22 | long ticks = 100L; 23 | 24 | for (int i = 0; i < 100; i++) { 25 | long result = ts.randomizeTicksPerRun(ticks); 26 | assertTrue(result >= 90); 27 | assertTrue(result <= 110); 28 | logger.log(Level.INFO, result + ""); 29 | } 30 | } 31 | 32 | @Test 33 | public void testRandomize1() { 34 | long ticks = 4; 35 | ts.setVariation(.2); 36 | for (int i = 0; i < 100; i++) { 37 | long result = ts.randomizeTicksPerRun(ticks); 38 | assertTrue(result >= 3); 39 | assertTrue(result <= 5); 40 | logger.log(Level.INFO, result + ""); 41 | } 42 | } 43 | 44 | @Test 45 | public void testRandomize2() { 46 | long ticks = 1; 47 | ts.setVariation(.9); 48 | for (int i = 0; i < 100; i++) { 49 | long result = ts.randomizeTicksPerRun(ticks); 50 | assertTrue(result > 0); 51 | assertTrue(result <= 2); 52 | logger.log(Level.INFO, result + ""); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/globalworkspace/MockBroadcastTrigger.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.globalworkspace; 9 | 10 | import java.util.Collection; 11 | import java.util.Map; 12 | 13 | import edu.memphis.ccrg.lida.globalworkspace.triggers.BroadcastTrigger; 14 | 15 | public class MockBroadcastTrigger implements BroadcastTrigger { 16 | 17 | public Collection coalitions; 18 | 19 | @Override 20 | public void checkForTriggerCondition(Collection coalitions) { 21 | this.coalitions = coalitions; 22 | } 23 | 24 | @Override 25 | public void init(Map parameters, GlobalWorkspace gw) { 26 | 27 | } 28 | 29 | public boolean wasReset; 30 | 31 | @Override 32 | public void reset() { 33 | wasReset = true; 34 | 35 | } 36 | 37 | @Override 38 | public void start() { 39 | 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/pam/MockPamListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.pam; 9 | 10 | import edu.memphis.ccrg.lida.framework.shared.Link; 11 | import edu.memphis.ccrg.lida.framework.shared.Node; 12 | import edu.memphis.ccrg.lida.framework.shared.NodeStructure; 13 | 14 | public class MockPamListener implements PamListener { 15 | public NodeStructure ns; 16 | public Node n; 17 | public Link l; 18 | 19 | @Override 20 | public void receivePercept(NodeStructure ns) { 21 | this.ns = ns; 22 | } 23 | 24 | @Override 25 | public void receivePercept(Node n) { 26 | this.n = n; 27 | } 28 | 29 | @Override 30 | public void receivePercept(Link l) { 31 | this.l = l; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/pam/PamLinkImplSubclass.java: -------------------------------------------------------------------------------- 1 | package edu.memphis.ccrg.lida.pam; 2 | 3 | public class PamLinkImplSubclass extends PamLinkImpl { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/pam/PamNodeImplSubclass.java: -------------------------------------------------------------------------------- 1 | package edu.memphis.ccrg.lida.pam; 2 | 3 | public class PamNodeImplSubclass extends PamNodeImpl { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/proceduralmemory/MockProceduralMemoryListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.proceduralmemory; 9 | 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | 13 | import edu.memphis.ccrg.lida.actionselection.Behavior; 14 | 15 | public class MockProceduralMemoryListener implements ProceduralMemoryListener { 16 | 17 | public List behaviors = new ArrayList(); 18 | public int timesCalled; 19 | 20 | @Override 21 | public void receiveBehavior(Behavior b) { 22 | timesCalled++; 23 | behaviors.add(b); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/sensorymemory/MockEnvironmentImpl.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.sensorymemory; 9 | 10 | import java.util.Map; 11 | 12 | import edu.memphis.ccrg.lida.environment.EnvironmentImpl; 13 | 14 | public class MockEnvironmentImpl extends EnvironmentImpl { 15 | 16 | @Override 17 | public void resetState() { 18 | 19 | } 20 | 21 | @Override 22 | public void processAction(Object action) { 23 | 24 | } 25 | 26 | @Override 27 | public Object getState(Map params) { 28 | 29 | return null; 30 | } 31 | 32 | @Override 33 | public Object getModuleContent(Object... params) { 34 | 35 | return null; 36 | } 37 | 38 | @Override 39 | public void init() { 40 | 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/workspace/MockBroadcastQueueImpl.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.workspace; 9 | 10 | import edu.memphis.ccrg.lida.globalworkspace.BroadcastContent; 11 | import edu.memphis.ccrg.lida.globalworkspace.Coalition; 12 | import edu.memphis.ccrg.lida.workspace.workspacebuffers.BroadcastQueueImpl; 13 | 14 | public class MockBroadcastQueueImpl extends BroadcastQueueImpl { 15 | 16 | public BroadcastContent broadcastContent; 17 | 18 | @Override 19 | public void receiveBroadcast(Coalition c) { 20 | this.broadcastContent = c.getContent(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /junit/edu/memphis/ccrg/lida/workspace/structurebuildingcodelets/MockStructureBuildingCodeletImpl.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.workspace.structurebuildingcodelets; 9 | 10 | import edu.memphis.ccrg.lida.framework.shared.NodeStructure; 11 | import edu.memphis.ccrg.lida.workspace.workspacebuffers.WorkspaceBuffer; 12 | 13 | public class MockStructureBuildingCodeletImpl extends 14 | StructureBuildingCodeletImpl { 15 | 16 | @Override 17 | protected void runThisFrameworkTask() { 18 | } 19 | 20 | @Override 21 | public boolean bufferContainsSoughtContent(WorkspaceBuffer buffer) { 22 | return false; 23 | } 24 | 25 | @Override 26 | public NodeStructure retrieveWorkspaceContent(WorkspaceBuffer buffer) { 27 | return null; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /lib/collections-generic-4.01.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CognitiveComputingResearchGroup/lida-framework/26bc3b2b34bf7ccfe2c62e1f12314db27d9719ec/lib/collections-generic-4.01.jar -------------------------------------------------------------------------------- /lib/colt-1.2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CognitiveComputingResearchGroup/lida-framework/26bc3b2b34bf7ccfe2c62e1f12314db27d9719ec/lib/colt-1.2.0.jar -------------------------------------------------------------------------------- /lib/concurrent-1.3.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CognitiveComputingResearchGroup/lida-framework/26bc3b2b34bf7ccfe2c62e1f12314db27d9719ec/lib/concurrent-1.3.4.jar -------------------------------------------------------------------------------- /lib/jcommon-1.0.16.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CognitiveComputingResearchGroup/lida-framework/26bc3b2b34bf7ccfe2c62e1f12314db27d9719ec/lib/jcommon-1.0.16.jar -------------------------------------------------------------------------------- /lib/jfreechart-1.0.13.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CognitiveComputingResearchGroup/lida-framework/26bc3b2b34bf7ccfe2c62e1f12314db27d9719ec/lib/jfreechart-1.0.13.jar -------------------------------------------------------------------------------- /lib/jung-3d-2.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CognitiveComputingResearchGroup/lida-framework/26bc3b2b34bf7ccfe2c62e1f12314db27d9719ec/lib/jung-3d-2.0.1.jar -------------------------------------------------------------------------------- /lib/jung-3d-demos-2.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CognitiveComputingResearchGroup/lida-framework/26bc3b2b34bf7ccfe2c62e1f12314db27d9719ec/lib/jung-3d-demos-2.0.1.jar -------------------------------------------------------------------------------- /lib/jung-algorithms-2.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CognitiveComputingResearchGroup/lida-framework/26bc3b2b34bf7ccfe2c62e1f12314db27d9719ec/lib/jung-algorithms-2.0.1.jar -------------------------------------------------------------------------------- /lib/jung-api-2.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CognitiveComputingResearchGroup/lida-framework/26bc3b2b34bf7ccfe2c62e1f12314db27d9719ec/lib/jung-api-2.0.1.jar -------------------------------------------------------------------------------- /lib/jung-graph-impl-2.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CognitiveComputingResearchGroup/lida-framework/26bc3b2b34bf7ccfe2c62e1f12314db27d9719ec/lib/jung-graph-impl-2.0.1.jar -------------------------------------------------------------------------------- /lib/jung-io-2.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CognitiveComputingResearchGroup/lida-framework/26bc3b2b34bf7ccfe2c62e1f12314db27d9719ec/lib/jung-io-2.0.1.jar -------------------------------------------------------------------------------- /lib/jung-jai-2.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CognitiveComputingResearchGroup/lida-framework/26bc3b2b34bf7ccfe2c62e1f12314db27d9719ec/lib/jung-jai-2.0.1.jar -------------------------------------------------------------------------------- /lib/jung-jai-samples-2.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CognitiveComputingResearchGroup/lida-framework/26bc3b2b34bf7ccfe2c62e1f12314db27d9719ec/lib/jung-jai-samples-2.0.1.jar -------------------------------------------------------------------------------- /lib/jung-samples-2.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CognitiveComputingResearchGroup/lida-framework/26bc3b2b34bf7ccfe2c62e1f12314db27d9719ec/lib/jung-samples-2.0.1.jar -------------------------------------------------------------------------------- /lib/jung-visualization-2.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CognitiveComputingResearchGroup/lida-framework/26bc3b2b34bf7ccfe2c62e1f12314db27d9719ec/lib/jung-visualization-2.0.1.jar -------------------------------------------------------------------------------- /lib/stax-api-1.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CognitiveComputingResearchGroup/lida-framework/26bc3b2b34bf7ccfe2c62e1f12314db27d9719ec/lib/stax-api-1.0.1.jar -------------------------------------------------------------------------------- /lib/vecmath-1.3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CognitiveComputingResearchGroup/lida-framework/26bc3b2b34bf7ccfe2c62e1f12314db27d9719ec/lib/vecmath-1.3.1.jar -------------------------------------------------------------------------------- /lib/wstx-asl-3.2.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CognitiveComputingResearchGroup/lida-framework/26bc3b2b34bf7ccfe2c62e1f12314db27d9719ec/lib/wstx-asl-3.2.6.jar -------------------------------------------------------------------------------- /license/LIDA-framework-non-commercial-v1.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CognitiveComputingResearchGroup/lida-framework/26bc3b2b34bf7ccfe2c62e1f12314db27d9719ec/license/LIDA-framework-non-commercial-v1.0.pdf -------------------------------------------------------------------------------- /manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=8a0206d9 2 | build.xml.script.CRC32=61fb8244 3 | build.xml.stylesheet.CRC32=8064a381@1.75.1.48 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=8a0206d9 7 | nbproject/build-impl.xml.script.CRC32=aa660ac4 8 | nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.1.48 9 | -------------------------------------------------------------------------------- /nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | lida-framework 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/actionselection/Action.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.actionselection; 9 | 10 | import edu.memphis.ccrg.lida.framework.initialization.Initializable; 11 | 12 | /** 13 | * Encapsulation of an action to be executed. 14 | * 15 | * @author Ryan J. McCall 16 | * @author Javier Snaider 17 | */ 18 | public interface Action extends Initializable { 19 | 20 | @SuppressWarnings(value = { "all" }) 21 | public enum Topology { 22 | BASIC, PARALLEL, SEQUENCIAL 23 | } 24 | 25 | /** 26 | * @return the action label. 27 | */ 28 | public String getLabel(); 29 | 30 | /** 31 | * @param label 32 | * the action label to set. 33 | */ 34 | public void setLabel(String label); 35 | 36 | /** 37 | * @return the {@link Action} id 38 | */ 39 | public int getId(); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/actionselection/ActionImpl.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.actionselection; 9 | 10 | import edu.memphis.ccrg.lida.framework.initialization.InitializableImpl; 11 | 12 | /** 13 | * Default implementation of {@link Action}. 14 | * 15 | * @author Ryan J. McCall 16 | * @author Javier Snaider 17 | * 18 | */ 19 | public class ActionImpl extends InitializableImpl implements Action { 20 | 21 | private static int idGenerator = 0; 22 | private int id; 23 | private String label; 24 | 25 | /** 26 | * Default constructor 27 | */ 28 | public ActionImpl() { 29 | id = idGenerator++; 30 | } 31 | 32 | /** 33 | * Convenience constructor that set the Action's label 34 | * 35 | * @param label 36 | * the label to set 37 | */ 38 | public ActionImpl(String label) { 39 | this(); 40 | this.label = label; 41 | } 42 | 43 | @Override 44 | public String getLabel() { 45 | return label; 46 | } 47 | 48 | @Override 49 | public void setLabel(String name) { 50 | this.label = name; 51 | } 52 | 53 | @Override 54 | public int getId() { 55 | return id; 56 | } 57 | 58 | @Override 59 | public String toString() { 60 | return label; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/actionselection/ActionSelection.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.actionselection; 9 | 10 | import java.util.Collection; 11 | 12 | import edu.memphis.ccrg.lida.framework.FrameworkModule; 13 | 14 | /** 15 | * Specification for the action selection module of LIDA. 16 | * 17 | * @author Ryan J. McCall 18 | * 19 | */ 20 | public interface ActionSelection extends FrameworkModule { 21 | 22 | /** 23 | * Adds specified {@link ActionSelectionListener}. 24 | * 25 | * @param l 26 | * a module that receives selected actions from 27 | * {@link ActionSelection} 28 | */ 29 | public void addActionSelectionListener(ActionSelectionListener l); 30 | 31 | /** 32 | * Adds specified {@link PreafferenceListener} 33 | * 34 | * @param l 35 | * a module that receives preafference from 36 | * {@link ActionSelection} 37 | */ 38 | public void addPreafferenceListener(PreafferenceListener l); 39 | 40 | /** 41 | * Selects a behavior (containing an action) for execution. 42 | * 43 | * @param behaviors 44 | * {@link Collection} of behaviors currently available in the 45 | * module 46 | * @param candidateThreshold 47 | * threshold for a behavior to be a candidate 48 | * @return winning Behavior or null if none was chosen 49 | */ 50 | public Behavior selectBehavior(Collection behaviors, 51 | double candidateThreshold); 52 | 53 | /** 54 | * Returns a view of the behaviors currently in {@link ActionSelection} 55 | * 56 | * @return a {@link Collection} of {@link Behavior} objects 57 | */ 58 | public Collection getBehaviors(); 59 | } 60 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/actionselection/ActionSelectionListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.actionselection; 9 | 10 | import edu.memphis.ccrg.lida.framework.ModuleListener; 11 | 12 | /** 13 | * A listeners of the {@link ActionSelection} Module 14 | * 15 | * @author Ryan J. McCall 16 | * 17 | */ 18 | public interface ActionSelectionListener extends ModuleListener { 19 | 20 | /** 21 | * Listener must receive actions. Will be called for each action selected by 22 | * the behavior network. 23 | * 24 | * @param action 25 | * - Id of the action stored in sensory motor memory 26 | */ 27 | public void receiveAction(Action action); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/actionselection/Behavior.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2010 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.actionselection; 9 | 10 | import edu.memphis.ccrg.lida.proceduralmemory.ProceduralUnit; 11 | import edu.memphis.ccrg.lida.proceduralmemory.Scheme; 12 | 13 | /** 14 | * An instantiated {@link Scheme} with a context, adding list, and deleting 15 | * list. 16 | * 17 | * @author Javier Snaider 18 | * @author Ryan J. McCall 19 | */ 20 | public interface Behavior extends ProceduralUnit { 21 | 22 | /** 23 | * Gets the scheme underlying the behavior. 24 | * 25 | * @return the generating scheme 26 | */ 27 | public Scheme getScheme(); 28 | 29 | /** 30 | * Gets the scheme underlying the behavior. 31 | * 32 | * @param s 33 | * the new generating scheme 34 | */ 35 | public void setScheme(Scheme s); 36 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/actionselection/PreafferenceListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.actionselection; 9 | 10 | import edu.memphis.ccrg.lida.framework.shared.NodeStructure; 11 | 12 | /** 13 | * Listener of preafferent signal from {@link ActionSelection} 14 | * 15 | * @author Ryan J. McCall 16 | * 17 | */ 18 | public interface PreafferenceListener { 19 | 20 | /** 21 | * Listener receives preafference. 22 | * 23 | * @param addSet 24 | * expected additions in future percepts 25 | * @param deleteSet 26 | * expected deletions in future percepts 27 | */ 28 | public void receivePreafference(NodeStructure addSet, 29 | NodeStructure deleteSet); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/actionselection/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes related to Action Selection, a subsystem which selects 3 | Behaviors for execution. 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/attentioncodelets/AttentionCodelet.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | 9 | package edu.memphis.ccrg.lida.attentioncodelets; 10 | 11 | import edu.memphis.ccrg.lida.framework.shared.RefractoryPeriod; 12 | import edu.memphis.ccrg.lida.framework.tasks.Codelet; 13 | import edu.memphis.ccrg.lida.globalworkspace.Coalition; 14 | import edu.memphis.ccrg.lida.globalworkspace.GlobalWorkspace; 15 | import edu.memphis.ccrg.lida.workspace.workspacebuffers.WorkspaceBuffer; 16 | 17 | /** 18 | * A kind of {@link Codelet} that checks {@link WorkspaceBuffer} for its desired 19 | * content and possibly adds {@link Coalition} to the {@link GlobalWorkspace} 20 | * 21 | * @author Ryan J. McCall 22 | * 23 | */ 24 | public interface AttentionCodelet extends Codelet, RefractoryPeriod { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/attentioncodelets/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes related to Attention Codelets. These processes function to select and 3 | bring WorkspaceContent to the GlobalWorkspace. 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/environment/Environment.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.environment; 9 | 10 | import java.util.Map; 11 | 12 | import edu.memphis.ccrg.lida.framework.FrameworkModule; 13 | 14 | /** 15 | * Specification for domains that the framework can use as an environment. 16 | * Generally speaking environments can be sensed and can receive actions. 17 | * 18 | * @author Ryan J. McCall 19 | */ 20 | public interface Environment extends FrameworkModule { 21 | 22 | /** 23 | * Resets the state of the environment 24 | */ 25 | public void resetState(); 26 | 27 | /** 28 | * Process the specified action updating the environment's state 29 | * accordingly. 30 | * 31 | * @param action 32 | * an algorithm to be processed by the environment 33 | */ 34 | public void processAction(Object action); 35 | 36 | /** 37 | * Returns the environment's state 38 | * 39 | * @param params 40 | * Map of optional parameters specifying the aspect of the state 41 | * which will be returned 42 | * @return some part of the environment's state depending on the parameters 43 | */ 44 | public Object getState(Map params); 45 | } 46 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/environment/EnvironmentImpl.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.environment; 9 | 10 | import edu.memphis.ccrg.lida.framework.FrameworkModule; 11 | import edu.memphis.ccrg.lida.framework.FrameworkModuleImpl; 12 | import edu.memphis.ccrg.lida.framework.initialization.AgentXmlFactory; 13 | 14 | /** 15 | * Abstract implementation of {@link Environment} Environments should not be a 16 | * listener of anything besides GUIs. Rather, SensoryMemory and 17 | * SensoryMotorMemory should add environments as associated modules in the XML 18 | * configuration file. 19 | * 20 | * @author Ryan J. McCall 21 | */ 22 | public abstract class EnvironmentImpl extends FrameworkModuleImpl implements 23 | Environment { 24 | 25 | /** 26 | * Default constructor will be invoked by {@link AgentXmlFactory} to create 27 | * this {@link FrameworkModule} 28 | */ 29 | public EnvironmentImpl() { 30 | } 31 | 32 | /** 33 | * override to implement Environment's decay. 34 | * 35 | * @see FrameworkModule#decayModule(long) 36 | */ 37 | @Override 38 | public void decayModule(long ticks) { 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/environment/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes which define the interface for environments which 3 | a framework Agent can sense from and perform actions in. 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/episodicmemory/CueListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.episodicmemory; 9 | 10 | import edu.memphis.ccrg.lida.framework.ModuleListener; 11 | import edu.memphis.ccrg.lida.framework.shared.NodeStructure; 12 | import edu.memphis.ccrg.lida.workspace.Workspace; 13 | 14 | /** 15 | * Listens to cues from the {@link Workspace}. This interface is typically 16 | * implemented by {@link EpisodicMemory} modules. 17 | * 18 | * @author Ryan J. McCall 19 | */ 20 | public interface CueListener extends ModuleListener { 21 | 22 | /** 23 | * Receive a cue 24 | * 25 | * @param cue 26 | * a {@link NodeStructure} to cue {@link EpisodicMemory} with 27 | */ 28 | public void receiveCue(NodeStructure cue); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/episodicmemory/EpisodicMemory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | 9 | package edu.memphis.ccrg.lida.episodicmemory; 10 | 11 | import edu.memphis.ccrg.lida.framework.FrameworkModule; 12 | 13 | /** 14 | * The interface for LIDA's episodic memory. Episodic memory in LIDA 15 | * communicates with the workspace, receiving memory cues, and returning local 16 | * associations. 17 | *

18 | * Specific implementations of episodic memories must implement this interface. 19 | * Every implementation of this interface must also implement 20 | * {@link edu.memphis.ccrg.lida.globalworkspace.BroadcastListener}. 21 | * 22 | * @author Javier Snaider 23 | */ 24 | public interface EpisodicMemory extends FrameworkModule { 25 | 26 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/episodicmemory/LocalAssociationListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.episodicmemory; 9 | 10 | import edu.memphis.ccrg.lida.framework.ModuleListener; 11 | import edu.memphis.ccrg.lida.framework.shared.NodeStructure; 12 | 13 | /** 14 | * Listen to response from Episodic memory to a previous cue. This cue need not 15 | * originate from this same Listener. Any class can originate the cue even if it 16 | * does not implement this interface. 17 | * 18 | * @author Ryan J. McCall 19 | */ 20 | public interface LocalAssociationListener extends ModuleListener { 21 | 22 | /** 23 | * @param association 24 | * The response generated from the Episodic Memory to a previous 25 | * cue. 26 | */ 27 | public void receiveLocalAssociation(NodeStructure association); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/episodicmemory/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes related to the definition of the Episodic Memory module and its default implementation. 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/episodicmemory/sdm/Translator.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | 9 | package edu.memphis.ccrg.lida.episodicmemory.sdm; 10 | 11 | import cern.colt.bitvector.BitVector; 12 | import edu.memphis.ccrg.lida.framework.shared.NodeStructure; 13 | 14 | /** 15 | * A translator between {@link BitVector} used in 16 | * {@link SparseDistributedMemory}, and {@link NodeStructure} used in many other 17 | * LIDA modules. 18 | * 19 | * @author Javier Snaider 20 | */ 21 | public interface Translator { 22 | 23 | /** 24 | * Translates a {@link BitVector} into a {@link NodeStructure}. 25 | * 26 | * @param v 27 | * a {@link BitVector} containing the boolean vector to be 28 | * translated 29 | * @return the {@link NodeStructure} associated with the address 30 | */ 31 | public NodeStructure translate(BitVector v); 32 | 33 | /** 34 | * Translates a {@link NodeStructure} into a {@link BitVector}. 35 | * 36 | * @param ns 37 | * the {@link NodeStructure} to be translated 38 | * @return a {@link BitVector} with the boolean address associated with the 39 | * {@link NodeStructure} 40 | */ 41 | public BitVector translate(NodeStructure ns); 42 | 43 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/episodicmemory/sdm/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes related to an implementation of Sparse Distributed Memory (Kanerva). 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/Agent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework; 9 | 10 | import edu.memphis.ccrg.lida.framework.tasks.TaskManager; 11 | 12 | /** 13 | * A {@link FrameworkModule} containing all of the {@link FrameworkModule}s of 14 | * an agent. 15 | * 16 | * @author Javier Snaider 17 | * 18 | */ 19 | public interface Agent extends FrameworkModule { 20 | 21 | /** 22 | * Returns the Task Manager 23 | * 24 | * @return {@link TaskManager} in charge of all tasks. 25 | */ 26 | public TaskManager getTaskManager(); 27 | 28 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/AgentImpl.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework; 9 | 10 | import java.util.logging.Level; 11 | import java.util.logging.Logger; 12 | 13 | import edu.memphis.ccrg.lida.framework.tasks.TaskManager; 14 | 15 | /** 16 | * Basic {@link Agent} Implementation. 17 | * 18 | * @author Javier Snaider 19 | * 20 | */ 21 | public class AgentImpl extends FrameworkModuleImpl implements Agent { 22 | 23 | private static final Logger logger = Logger.getLogger(AgentImpl.class 24 | .getCanonicalName()); 25 | 26 | private TaskManager taskManager; 27 | 28 | /** 29 | * @param tm 30 | * {@link TaskManager} 31 | */ 32 | public AgentImpl(TaskManager tm) { 33 | super(ModuleName.Agent); 34 | taskManager = tm; 35 | } 36 | 37 | @Override 38 | public void init() { 39 | taskManager.setDecayingModules(getSubmodules().values()); 40 | logger.log(Level.INFO, "FrameworkModules have been started\n", 0L); 41 | } 42 | 43 | @Override 44 | public TaskManager getTaskManager() { 45 | return taskManager; 46 | } 47 | 48 | /** 49 | * Should do nothing, submodules' decayModule method is called in 50 | * FrameworkModuleImpl#taskManagerDecayModule. 51 | * 52 | * @see edu.memphis.ccrg.lida.framework.FrameworkModule#decayModule(long) 53 | */ 54 | @Override 55 | public void decayModule(long ticks) { 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/ModuleListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | /** 9 | * 10 | */ 11 | package edu.memphis.ccrg.lida.framework; 12 | 13 | /** 14 | * Implementations should be added to the agent.xml configuration file by 15 | * canonical name. i.e. package name + class name 16 | * 17 | * @author Javier Snaider 18 | */ 19 | public interface ModuleListener { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/gui/FrameworkGuiController.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | /** 9 | * 10 | */ 11 | package edu.memphis.ccrg.lida.framework.gui; 12 | 13 | import java.util.Map; 14 | 15 | import edu.memphis.ccrg.lida.framework.Agent; 16 | import edu.memphis.ccrg.lida.framework.gui.commands.Command; 17 | 18 | /** 19 | * Controller for the {@link FrameworkGui}. An interface between the Gui and 20 | * {@link Agent} implementing the MVC pattern. 21 | * 22 | * @author Javier Snaider 23 | */ 24 | public interface FrameworkGuiController { 25 | 26 | /** 27 | * Executes a command specified by the name. This name corresponds to a 28 | * property in guiCommands.properties file. 29 | * 30 | * @param commandName 31 | * the name of the command, names must be defined in 32 | * guiCommands.properties 33 | * @param parameters 34 | * a Map of optional parameters for the command. 35 | * @return the result of the command. 36 | */ 37 | public Object executeCommand(String commandName, 38 | Map parameters); 39 | 40 | /** 41 | * Executes a command sent by the GUI 42 | * 43 | * @param command 44 | * the command to execute. 45 | * @return The result of the command. 46 | */ 47 | public Object executeCommand(Command command); 48 | 49 | /** 50 | * Sets the {@link Agent} this controller controls. This {@link Agent} 51 | * object represents the model. 52 | * 53 | * @param agent 54 | * {@link Agent} 55 | */ 56 | public void registerAgent(Agent agent); 57 | 58 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/gui/commands/AddPanelCommand.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.gui.commands; 9 | 10 | import edu.memphis.ccrg.lida.framework.Agent; 11 | import edu.memphis.ccrg.lida.framework.gui.FrameworkGui; 12 | import edu.memphis.ccrg.lida.framework.gui.panels.GuiPanel; 13 | 14 | /** 15 | * Command to add a {@link GuiPanel} to the {@link FrameworkGui} 16 | * 17 | * @author Tamas Madl 18 | */ 19 | public class AddPanelCommand extends CommandImpl { 20 | 21 | @Override 22 | public void execute(Agent agent) { 23 | java.awt.Container parent = (java.awt.Container) getParameter("parent"); 24 | javax.swing.JPanel panel = (javax.swing.JPanel) getParameter("panel"); 25 | 26 | if (parent != null) { 27 | boolean panelFound = false; 28 | for (java.awt.Component c : parent.getComponents()) { 29 | if (c.equals(panel)) { 30 | panelFound = true; 31 | // panel exists, remove it 32 | parent.remove(panel); 33 | break; 34 | } 35 | } 36 | if (!panelFound) { 37 | // panel doesn't exist, add it 38 | parent.add(panel); 39 | } 40 | parent.repaint(); 41 | } 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/gui/commands/AddTicksCommand.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.gui.commands; 9 | 10 | import edu.memphis.ccrg.lida.framework.Agent; 11 | 12 | /** 13 | * This command is used for the tick mode to add ticks for execution. A Integer 14 | * "ticks" parameter must be specified. 15 | * 16 | * @author Javier Snaider 17 | * 18 | */ 19 | public class AddTicksCommand extends CommandImpl { 20 | 21 | @Override 22 | public void execute(Agent agent) { 23 | Integer ticks = (Integer) getParameter("ticks"); 24 | if (ticks != null) { 25 | agent.getTaskManager().addTicksToExecute(ticks); 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/gui/commands/Command.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | /* 9 | * To change this template, choose Tools | Templates 10 | * and open the template in the editor. 11 | */ 12 | 13 | package edu.memphis.ccrg.lida.framework.gui.commands; 14 | 15 | import java.util.Map; 16 | 17 | import edu.memphis.ccrg.lida.framework.Agent; 18 | 19 | /** 20 | * A command is an encapsulation of an event from the Gui such as a button press 21 | * or a slider state change. 22 | * 23 | * Implementations should add themselves to guiCommands.properties. 24 | * 25 | * @author Javier Snaider 26 | */ 27 | public interface Command { 28 | 29 | /** 30 | * Executes this command performing the necessary actions in the model (the 31 | * {@link Agent}). 32 | * 33 | * @param agent 34 | * {@link Agent} Object 35 | */ 36 | public void execute(Agent agent); 37 | 38 | /** 39 | * Returns result of the command. 40 | * 41 | * @return the result of the command's execution 42 | */ 43 | public Object getResult(); 44 | 45 | /** 46 | * Sets optional parameters for command. 47 | * 48 | * @param parameters 49 | * parameters 50 | */ 51 | public void setParameters(Map parameters); 52 | 53 | /** 54 | * Set single parameter for command. 55 | * 56 | * @param name 57 | * name of parameter 58 | * @param value 59 | * default value to use if parameter cannot be found 60 | */ 61 | public void setParameter(String name, Object value); 62 | 63 | /** 64 | * Gets a parameter by name. 65 | * 66 | * @param name 67 | * retrieved parameter 68 | * @return the parameter 69 | */ 70 | public Object getParameter(String name); 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/gui/commands/CommandImpl.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.gui.commands; 9 | 10 | import java.util.HashMap; 11 | import java.util.Map; 12 | 13 | import edu.memphis.ccrg.lida.framework.Agent; 14 | 15 | /** 16 | * Abstract implementation of {@link Command}. Extend from this base class to 17 | * create new commands overriding {@link #execute(Agent)}. 18 | * 19 | * @author Javier Snaider 20 | * 21 | */ 22 | public abstract class CommandImpl implements Command { 23 | 24 | private Map parameters = new HashMap(); 25 | /** 26 | * Result of the command's execution. May be set during the execution of the 27 | * {@link #execute(Agent)} method. 28 | */ 29 | protected Object result; 30 | 31 | @Override 32 | public abstract void execute(Agent agent); 33 | 34 | @Override 35 | public Object getParameter(String name) { 36 | Object res = null; 37 | if (parameters != null) { 38 | res = parameters.get(name); 39 | } 40 | return res; 41 | } 42 | 43 | @Override 44 | public Object getResult() { 45 | return result; 46 | } 47 | 48 | @Override 49 | public void setParameter(String name, Object value) { 50 | parameters.put(name, value); 51 | } 52 | 53 | @Override 54 | public void setParameters(Map parameters) { 55 | this.parameters = parameters; 56 | } 57 | 58 | @Override 59 | public String toString() { 60 | return getClass().getSimpleName(); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/gui/commands/EnableTicksModeCommand.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.gui.commands; 9 | 10 | import edu.memphis.ccrg.lida.framework.Agent; 11 | 12 | /** 13 | * This command is used for enabling or disabling the tick mode. A Boolean 14 | * "enable" parameter must be specified. 15 | * 16 | * @author Javier Snaider 17 | * 18 | */ 19 | public class EnableTicksModeCommand extends CommandImpl { 20 | 21 | @Override 22 | public void execute(Agent agent) { 23 | Boolean b = (Boolean) getParameter("enable"); 24 | if (b != null) { 25 | agent.getTaskManager().setInIntervalMode(b); 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/gui/commands/PauseRunningThreadsCommand.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | /** 9 | * 10 | */ 11 | package edu.memphis.ccrg.lida.framework.gui.commands; 12 | 13 | import edu.memphis.ccrg.lida.framework.Agent; 14 | import edu.memphis.ccrg.lida.framework.tasks.FrameworkTask; 15 | import edu.memphis.ccrg.lida.framework.tasks.TaskManager; 16 | 17 | /** 18 | * Pauses all {@link FrameworkTask} using the {@link TaskManager} 19 | * 20 | * @author Javier Snaider 21 | * 22 | */ 23 | public class PauseRunningThreadsCommand extends CommandImpl { 24 | 25 | @Override 26 | public void execute(Agent agent) { 27 | agent.getTaskManager().pauseTasks(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/gui/commands/QuitAllCommand.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.gui.commands; 9 | 10 | import edu.memphis.ccrg.lida.framework.Agent; 11 | import edu.memphis.ccrg.lida.framework.tasks.TaskManager; 12 | 13 | /** 14 | * Stops all thread execution and quits the system. 15 | * 16 | * @author Javier Snaider 17 | * 18 | */ 19 | public class QuitAllCommand extends CommandImpl { 20 | 21 | @Override 22 | public void execute(Agent agent) { 23 | TaskManager tm = agent.getTaskManager(); 24 | tm.pauseTasks(); 25 | try { 26 | Thread.sleep(100); 27 | } catch (InterruptedException e) { 28 | e.printStackTrace(); 29 | } 30 | tm.stopRunning(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/gui/commands/ResetEnvironmentCommand.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.gui.commands; 9 | 10 | import edu.memphis.ccrg.lida.environment.Environment; 11 | import edu.memphis.ccrg.lida.framework.Agent; 12 | import edu.memphis.ccrg.lida.framework.FrameworkModule; 13 | import edu.memphis.ccrg.lida.framework.ModuleName; 14 | 15 | /** 16 | * Resets the {@link Environment} of the current application. 17 | * 18 | * @author Ryan Mccall 19 | * 20 | */ 21 | public class ResetEnvironmentCommand extends CommandImpl { 22 | 23 | @Override 24 | public void execute(Agent agent) { 25 | FrameworkModule environ = agent.getSubmodule(ModuleName.Environment); 26 | if (environ != null && environ instanceof Environment) { 27 | ((Environment) environ).resetState(); 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/gui/commands/ResumeRunningThreadsCommand.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.gui.commands; 9 | 10 | import edu.memphis.ccrg.lida.framework.Agent; 11 | 12 | /** 13 | * Resumes Tasks execution. 14 | * 15 | * @author Javier Snaider 16 | * 17 | */ 18 | public class ResumeRunningThreadsCommand extends CommandImpl { 19 | 20 | @Override 21 | public void execute(Agent agent) { 22 | agent.getTaskManager().resumeTasks(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/gui/commands/SetTimeScaleCommand.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.gui.commands; 9 | 10 | import edu.memphis.ccrg.lida.framework.Agent; 11 | 12 | /** 13 | * Sets the tickDuration of the system. 14 | * 15 | * A Integer "tickDuration" parameter must be specified. 16 | * 17 | * @author Javier Snaider 18 | * 19 | */ 20 | public class SetTimeScaleCommand extends CommandImpl { 21 | 22 | @Override 23 | public void execute(Agent agent) { 24 | Integer tickDuration = (Integer) getParameter("tickDuration"); 25 | if (tickDuration != null) { 26 | agent.getTaskManager().setTickDuration(tickDuration); 27 | } 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/gui/commands/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes related to GUI commands; the encapsulation of actions to be taken in the model (the Agent) 3 | which are generated in the GUI. 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/gui/events/FrameworkGuiEventListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | /* 9 | * To change this template, choose Tools | Templates 10 | * and open the template in the editor. 11 | */ 12 | 13 | package edu.memphis.ccrg.lida.framework.gui.events; 14 | 15 | /** 16 | * An object that listens for FrameworkGuiEvents, that is, data being sent from 17 | * the model (framework) to the GUI. 18 | * 19 | * @author Javier Snaider 20 | */ 21 | public interface FrameworkGuiEventListener { 22 | 23 | /** 24 | * Must be able to receive FrameworkGuiEvents 25 | * 26 | * @param event 27 | * GuiEvent 28 | */ 29 | public void receiveFrameworkGuiEvent(FrameworkGuiEvent event); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/gui/events/GuiEventProvider.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.gui.events; 9 | 10 | /** 11 | * A GuiContentProvider is a class that provides content to a GUI. The GUIs 12 | * listen to providers, following Observer pattern. 13 | * 14 | * @author Ryan J. McCall 15 | * 16 | */ 17 | public interface GuiEventProvider { 18 | 19 | /** 20 | * Must be able to register FrameworkGuiEvent listeners 21 | * 22 | * @param listener 23 | * receiver of GuiEvents, typically a GuiPanel 24 | */ 25 | public void addFrameworkGuiEventListener(FrameworkGuiEventListener listener); 26 | 27 | /** 28 | * This is a convenience method to send GUI events to listeners. 29 | * 30 | * @param event 31 | * GuiEvent 32 | */ 33 | public void sendEventToGui(FrameworkGuiEvent event); 34 | } 35 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/gui/events/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes related to GUI events -- encapsulations of events generated in the model (the agent) 3 | which are sent to the GUI. 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/gui/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes related to the framework's GUI and GUI controller. 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/gui/panels/GuiPanelImpl.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/gui/panels/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes related to GuiPanels which can be added to the framework's GUI to display particular information. 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/gui/utils/NodeIcon.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | /** 9 | * 10 | */ 11 | package edu.memphis.ccrg.lida.framework.gui.utils; 12 | 13 | import java.awt.Color; 14 | import java.awt.Component; 15 | import java.awt.Graphics; 16 | 17 | import javax.swing.Icon; 18 | 19 | import edu.memphis.ccrg.lida.framework.gui.panels.NodeStructurePanel; 20 | import edu.memphis.ccrg.lida.framework.shared.Link; 21 | import edu.memphis.ccrg.lida.framework.shared.Node; 22 | 23 | /** 24 | * Utility which {@link NodeStructurePanel} uses to represent {@link Node} and 25 | * {@link Link}. 26 | * 27 | * @author Javier Snaider 28 | * 29 | */ 30 | public class NodeIcon implements Icon { 31 | 32 | /** 33 | * Default node icon 34 | */ 35 | public static final Icon NODE_ICON = new NodeIcon(20, Color.red); 36 | /** 37 | * Default link icon 38 | */ 39 | public static final Icon LINK_ICON = new NodeIcon(5, Color.black); 40 | 41 | private int size; 42 | private Color color; 43 | 44 | /** 45 | * @param size 46 | * NodeIcon size 47 | * @param color 48 | * NodeIcon color 49 | */ 50 | public NodeIcon(int size, Color color) { 51 | this.color = color; 52 | this.size = size; 53 | } 54 | 55 | @Override 56 | public int getIconHeight() { 57 | return size; 58 | } 59 | 60 | @Override 61 | public int getIconWidth() { 62 | return size; 63 | } 64 | 65 | @Override 66 | public void paintIcon(Component c, Graphics g, int x, int y) { 67 | g.setColor(color); 68 | g.fillOval(x, y, size, size); 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/gui/utils/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains utility classes for the GUI. 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/initialization/AgentFactory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.initialization; 9 | 10 | import java.util.Properties; 11 | 12 | import edu.memphis.ccrg.lida.framework.Agent; 13 | 14 | /** 15 | * Factory for {@link Agent} objects. 16 | * 17 | * @author Javier Snaider 18 | */ 19 | public interface AgentFactory { 20 | 21 | /** 22 | * Creates and returns a {@link Agent} from specified {@link Properties} 23 | * 24 | * @param properties 25 | * Agent properties 26 | * @return Constructed {@link Agent} object 27 | */ 28 | public Agent getAgent(Properties properties); 29 | 30 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/initialization/FrameworkFormatter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.initialization; 9 | 10 | import java.text.MessageFormat; 11 | import java.util.logging.Formatter; 12 | import java.util.logging.Handler; 13 | import java.util.logging.LogManager; 14 | import java.util.logging.LogRecord; 15 | 16 | /** 17 | * Logger formatter for the framework that can be used with any {@link Handler}. 18 | * 19 | * @author Javier Snaider 20 | * @see LogManager 21 | */ 22 | public class FrameworkFormatter extends Formatter { 23 | 24 | @Override 25 | public String format(LogRecord logRecord) { 26 | String logMessages = new String(""); 27 | // String dateString=""; 28 | long actualTick = 0L; 29 | // String name; 30 | 31 | String message = logRecord.getMessage(); 32 | if (message != null) { 33 | MessageFormat mf = new MessageFormat(message); 34 | 35 | Object[] param = logRecord.getParameters(); 36 | if (param != null && param[0] instanceof Long) { 37 | actualTick = (Long) param[0]; 38 | } 39 | logMessages = String.format( 40 | "%010d :%010d :%-10s :%-60s \t-> %s %n", logRecord 41 | .getSequenceNumber(), actualTick, logRecord 42 | .getLevel(), logRecord.getLoggerName(), mf 43 | .format(logRecord.getParameters())); 44 | return logMessages; 45 | } 46 | return ""; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/initialization/FullyInitializable.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.initialization; 9 | 10 | import edu.memphis.ccrg.lida.framework.FrameworkModule; 11 | 12 | /** 13 | * An {@link Initializable} object e.g. an {@link FrameworkModule} that is 14 | * initialized by the AgentXmlFactory. 15 | * 16 | * @author Ryan J. McCall 17 | * @author Javier Snaider 18 | * 19 | * @see AgentXmlFactory 20 | * @see FrameworkModule 21 | */ 22 | public interface FullyInitializable extends Initializable { 23 | 24 | /** 25 | * Sets an associated FrameworkModule. 26 | * 27 | * @param m 28 | * the module to be associated. 29 | * @param usg 30 | * how module will be used 31 | * @see ModuleUsage 32 | */ 33 | public void setAssociatedModule(FrameworkModule m, String usg); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/initialization/Initializer.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.initialization; 9 | 10 | import java.util.Map; 11 | 12 | import edu.memphis.ccrg.lida.framework.Agent; 13 | import edu.memphis.ccrg.lida.framework.FrameworkModule; 14 | import edu.memphis.ccrg.lida.framework.tasks.FrameworkTask; 15 | 16 | /** 17 | * An initializer configures a {@link FullyInitializable}. 18 | * 19 | * @author Ryan J. McCall 20 | */ 21 | public interface Initializer { 22 | 23 | /** 24 | * Receives a particular {@link FullyInitializable} to configure. The 25 | * {@link Agent} object and a map of parameters can be used in the specific 26 | * initialization code. Named 'initModule' historically, however an 27 | * initializer need not initialize a {@link FrameworkModule}, for example a 28 | * {@link FrameworkTask} is also valid. 29 | * 30 | * @param obj 31 | * the {@link FullyInitializable} object being initialized 32 | * @param a 33 | * the {@link Agent} object 34 | * @param params 35 | * parameters to configure the {@link FullyInitializable} 36 | * 37 | */ 38 | public void initModule(FullyInitializable obj, Agent a, 39 | Map params); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/initialization/ModuleUsage.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.initialization; 9 | 10 | import edu.memphis.ccrg.lida.framework.FrameworkModule; 11 | 12 | /** 13 | * Specifies different ways a {@link FullyInitializable} will use an associated 14 | * module. 15 | * 16 | * @see FullyInitializable#setAssociatedModule(FrameworkModule, String) 17 | * @author Javier Snaider 18 | * 19 | */ 20 | @SuppressWarnings(value = { "all" }) 21 | public class ModuleUsage { 22 | // TODO dynamic enum like ModuleName 23 | 24 | public static final String NOT_SPECIFIED = "NOT_SPECIFIED"; 25 | public static final String TO_READ_FROM = "TO_READ_FROM"; 26 | public static final String TO_WRITE_TO = "TO_WRITE_TO"; 27 | public static final String TO_DELETE_FROM = "TO_DELETE_FROM"; 28 | public static final String TO_CHECK_FROM = "TO_CHECK_FROM"; 29 | public static final String TO_LISTEN_FROM = "TO_LISTEN_FROM"; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/initialization/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes involved in the run-time creation of the Agent and the initialization of the ElementFactory from various configuration files. 3 | Also includes classes which define the way various components of an Agent are configured. 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes which define the main structures of framework Agents. 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/shared/LinkCategory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.shared; 9 | 10 | import edu.memphis.ccrg.lida.pam.PamNode; 11 | 12 | /** 13 | * Specifies the category of a Link. 14 | * 15 | * @see PamNode 16 | * @see Link 17 | * @author Javier Snaider 18 | * @author Ryan J. McCall 19 | */ 20 | public interface LinkCategory { 21 | 22 | /** 23 | * @return readable label 24 | */ 25 | public String getLabel(); 26 | 27 | /** 28 | * @return category's id 29 | */ 30 | public int getId(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/shared/Linkable.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.shared; 9 | 10 | import edu.memphis.ccrg.lida.framework.initialization.Initializable; 11 | import edu.memphis.ccrg.lida.framework.shared.activation.Activatible; 12 | 13 | /** 14 | * A object that can have links attached to it. 15 | * 16 | * @author Javier Snaider 17 | * @author Ryan J. McCall 18 | */ 19 | public interface Linkable extends Activatible, Initializable { 20 | 21 | /** 22 | * Gets label. 23 | * 24 | * @return readable label 25 | */ 26 | public String getLabel(); 27 | 28 | /** 29 | * Gets extendedId. 30 | * 31 | * @return a general id for Linkables. 32 | */ 33 | public ExtendedId getExtendedId(); 34 | 35 | /** 36 | * Gets factory type 37 | * 38 | * @return the factory type of the Linkable 39 | * @see ElementFactory 40 | */ 41 | public String getFactoryType(); 42 | 43 | /** 44 | * Sets factory type 45 | * 46 | * @param t 47 | * the factory type of the Linkable 48 | * @see ElementFactory 49 | */ 50 | public void setFactoryType(String t); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/shared/NodeType.java: -------------------------------------------------------------------------------- 1 | package edu.memphis.ccrg.lida.framework.shared; 2 | 3 | /** 4 | * A marker of Node type. Different types are treated differently in 5 | * {@link NodeStructure}. This feature is not fully implemented in this 6 | * framework version. 7 | * 8 | * @author Ryan J. McCall 9 | */ 10 | public enum NodeType { 11 | 12 | /** 13 | * Catch-all type 14 | */ 15 | defaultType, 16 | /** 17 | * {@link Node}s that represent objects 18 | */ 19 | object, 20 | /** 21 | * {@link Node}s that represent events 22 | */ 23 | event, 24 | /** 25 | * {@link Node}s that represent built-in need feelings e.g. thirst, hunger 26 | */ 27 | needFeeling, 28 | /** 29 | * {@link Node}s that represent interpretive (appraisal) feelings, e.g. 30 | * sweet, sour 31 | */ 32 | interprativeFeeling 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/shared/RefractoryPeriod.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.shared; 9 | 10 | import edu.memphis.ccrg.lida.framework.tasks.TaskManager; 11 | 12 | /** 13 | * Implementors of this interface can have a refractory period. The unit of the 14 | * time period is in ticks, the unit of time in the framework. 15 | * 16 | * @see TaskManager 17 | * @author Ryan J. McCall 18 | */ 19 | public interface RefractoryPeriod { 20 | 21 | /** 22 | * Sets refractoryPeriod 23 | * 24 | * @param ticks 25 | * length of refractory period in ticks 26 | * @see TaskManager 27 | */ 28 | public void setRefractoryPeriod(int ticks); 29 | 30 | /** 31 | * Gets refractoryPeriod 32 | * 33 | * @return length of refractory period in ticks 34 | * @see TaskManager 35 | */ 36 | public int getRefractoryPeriod(); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/shared/Translatable.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | 9 | package edu.memphis.ccrg.lida.framework.shared; 10 | 11 | import cern.colt.bitvector.BitVector; 12 | 13 | /** 14 | * 15 | * @author Rodrigo Silva-Lugo 16 | */ 17 | public interface Translatable { 18 | 19 | /** 20 | * @param vector 21 | * BitVector 22 | */ 23 | public void setSdmId(BitVector vector); 24 | 25 | /** 26 | * @return BitVector 27 | */ 28 | public BitVector getSdmId(); 29 | } 30 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/shared/activation/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes which define activation attributes and operations related to these activations. 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/shared/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes related to common data structures used in the framework. 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/strategies/DecayStrategy.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.strategies; 9 | 10 | import java.util.Map; 11 | 12 | import edu.memphis.ccrg.lida.framework.shared.ElementFactory; 13 | 14 | /** 15 | * A strategy pattern for decaying Activatibles or Learnables 16 | * 17 | * Implementations should add themselves to {@link ElementFactory} via the 18 | * factoriesData.xml configuration file. 19 | * 20 | * @author Javier Snaider 21 | * @author Ryan J. McCall 22 | */ 23 | public interface DecayStrategy extends Strategy { 24 | 25 | /** 26 | * Decays the current activation according to some internal decay function. 27 | * 28 | * @param currentActivation 29 | * activation of the entity before decay. 30 | * @param ticks 31 | * The number of ticks to decay. 32 | * @param params 33 | * optional parameters 34 | * @return new activation 35 | */ 36 | public double decay(double currentActivation, long ticks, Object... params); 37 | 38 | /** 39 | * Decays the current activation according to some internal decay function. 40 | * 41 | * @param currentActivation 42 | * activation of the entity before decay. 43 | * @param ticks 44 | * how much time has passed since last decay 45 | * @param params 46 | * parameters 47 | * @return new activation amount 48 | */ 49 | public double decay(double currentActivation, long ticks, 50 | Map params); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/strategies/DefaultTotalActivationStrategy.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.strategies; 9 | 10 | /** 11 | * Default method to calculate total activation. Sums activations returning sum 12 | * or 1.0, whichever is lowest. 13 | * 14 | * @author Ryan J. McCall 15 | * 16 | */ 17 | public class DefaultTotalActivationStrategy extends StrategyImpl implements 18 | TotalActivationStrategy { 19 | 20 | @Override 21 | public double calculateTotalActivation(double baseLevelActivation, 22 | double currentActivation) { 23 | double sum = baseLevelActivation + currentActivation; 24 | return (sum > 1.0) ? 1.0 : sum; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/strategies/ExciteStrategy.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.strategies; 9 | 10 | import java.util.Map; 11 | 12 | import edu.memphis.ccrg.lida.framework.shared.ElementFactory; 13 | 14 | /** 15 | * A strategy pattern for exciting Activatibles or Learnables 16 | * 17 | * Implementations should add themselves to {@link ElementFactory} via the 18 | * factoriesData.xml configuration file. 19 | * 20 | * 21 | * @author Javier Snaider 22 | * @author Ryan J. McCall 23 | * 24 | */ 25 | public interface ExciteStrategy extends Strategy { 26 | 27 | /** 28 | * Excites the current activation according to some internal excite 29 | * function. 30 | * 31 | * @param currentActivation 32 | * activation of the entity before excite. 33 | * @param excitation 34 | * amount of activation to adds 35 | * @param params 36 | * parameters 37 | * @return new activation amount 38 | */ 39 | public double excite(double currentActivation, double excitation, 40 | Object... params); 41 | 42 | /** 43 | * Excites the current activation according to some internal excite 44 | * function. 45 | * 46 | * @param currentActivation 47 | * activation of the entity before excite. 48 | * @param excitation 49 | * amount of activation to adds 50 | * @param params 51 | * parameters 52 | * @return new activation amount 53 | */ 54 | public double excite(double currentActivation, double excitation, 55 | Map params); 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/strategies/NoDecayStrategy.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.strategies; 9 | 10 | import java.util.Map; 11 | 12 | /** 13 | * A {@link DecayStrategy} that never modifies the activation passed to it. 14 | * 15 | * @author Ryan J. McCall 16 | * @author Javier Snaider 17 | */ 18 | public class NoDecayStrategy extends StrategyImpl implements DecayStrategy { 19 | 20 | /** 21 | * Default constructor 22 | */ 23 | public NoDecayStrategy() { 24 | } 25 | 26 | /** 27 | * Decays the current activation according to some internal decay function. 28 | * 29 | * @param currentActivation 30 | * activation of the entity before decay. 31 | * @param ticks 32 | * The number of ticks to decay. 33 | * @param params 34 | * optional parameters: N/A 35 | * @return new activation 36 | */ 37 | @Override 38 | public double decay(double currentActivation, long ticks, Object... params) { 39 | return currentActivation; 40 | } 41 | 42 | /** 43 | * Decays the current activation according to some internal decay function. 44 | * 45 | * @param currentActivation 46 | * activation of the entity before decay. 47 | * @param ticks 48 | * how much time has passed since last decay 49 | * @param params 50 | * parameters: N/A 51 | * @return new activation amount 52 | */ 53 | @Override 54 | public double decay(double currentActivation, long ticks, 55 | Map params) { 56 | return currentActivation; 57 | } 58 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/strategies/NoExciteStrategy.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.strategies; 9 | 10 | import java.util.Map; 11 | 12 | /** 13 | * An {@link ExciteStrategy} that never modifies the activation passed to it. 14 | * 15 | * @author Ryan J. McCall 16 | * @author Javier Snaider 17 | */ 18 | public class NoExciteStrategy extends StrategyImpl implements ExciteStrategy { 19 | 20 | /** 21 | * Default constructor 22 | */ 23 | public NoExciteStrategy() { 24 | } 25 | 26 | /** 27 | * Excites the current activation according to some internal excite 28 | * function. 29 | * 30 | * @param currentActivation 31 | * activation of the entity before excite. 32 | * @param excitation 33 | * amount of activation to adds 34 | * @param params 35 | * parameters: N/A 36 | * @return new activation amount 37 | */ 38 | @Override 39 | public double excite(double currentActivation, double excitation, 40 | Object... params) { 41 | return currentActivation; 42 | } 43 | 44 | /** 45 | * Excites the current activation according to some internal excite 46 | * function. 47 | * 48 | * @param currentActivation 49 | * activation of the entity before excite. 50 | * @param excitation 51 | * amount of activation to adds 52 | * @param params 53 | * parameters: N/A 54 | * @return new activation amount 55 | */ 56 | @Override 57 | public double excite(double currentActivation, double excitation, 58 | Map params) { 59 | return currentActivation; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/strategies/Strategy.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | /** 9 | * 10 | */ 11 | package edu.memphis.ccrg.lida.framework.strategies; 12 | 13 | import edu.memphis.ccrg.lida.framework.initialization.Initializable; 14 | 15 | /** 16 | * Generic designation for all types of strategies such as decay, excite, etc. 17 | * 18 | * @author Javier Snaider 19 | */ 20 | public interface Strategy extends Initializable { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/strategies/StrategyImpl.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.strategies; 9 | 10 | import edu.memphis.ccrg.lida.framework.initialization.InitializableImpl; 11 | 12 | /** 13 | * Abstract implementation of {@link Strategy} 14 | * 15 | * @author Javier Snaider 16 | * @author Ryan J. McCall 17 | */ 18 | public abstract class StrategyImpl extends InitializableImpl implements 19 | Strategy { 20 | 21 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/strategies/TotalActivationStrategy.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.strategies; 9 | 10 | /** 11 | * A strategy that calculates total activation. 12 | * 13 | * @author Ryan J. McCall 14 | */ 15 | public interface TotalActivationStrategy extends Strategy { 16 | 17 | /** 18 | * Calculates and returns total activation. 19 | * 20 | * @param bla 21 | * Base-level activation 22 | * @param ca 23 | * current activation 24 | * @return calculated total activation 25 | */ 26 | public double calculateTotalActivation(double bla, double ca); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/strategies/WeightedTotalActivationStrategy.java: -------------------------------------------------------------------------------- 1 | package edu.memphis.ccrg.lida.framework.strategies; 2 | 3 | 4 | /** 5 | * Computes total activation as a weighted average of base-level and current. 6 | * @author Ryan J. McCall 7 | */ 8 | public class WeightedTotalActivationStrategy extends StrategyImpl implements TotalActivationStrategy { 9 | 10 | 11 | private static final double DEFAULT_BLA_WEIGHT = 0.1; 12 | private double blaWeight; 13 | 14 | @Override 15 | public void init(){ 16 | blaWeight = getParam("blaWeight",DEFAULT_BLA_WEIGHT); 17 | } 18 | 19 | @Override 20 | public double calculateTotalActivation(double baseLevelActivation, double currentActivation) { 21 | double sum = (blaWeight*baseLevelActivation + (1-blaWeight)*currentActivation)/2; 22 | return (sum > 1.0)? 1.0 : sum; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/strategies/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains the various strategies (implementors of the strategy design pattern) used in the framework to implement excitation, decay, etc. 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/tasks/Codelet.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | /** 9 | * 10 | */ 11 | package edu.memphis.ccrg.lida.framework.tasks; 12 | 13 | import edu.memphis.ccrg.lida.framework.shared.NodeStructure; 14 | import edu.memphis.ccrg.lida.workspace.workspacebuffers.WorkspaceBuffer; 15 | 16 | /** 17 | * A task that represents a demon-like processor. 18 | * 19 | * @author Javier Snaider 20 | * @author Ryan J. McCall 21 | */ 22 | public interface Codelet extends FrameworkTask { 23 | 24 | /** 25 | * @return the sought content 26 | */ 27 | public NodeStructure getSoughtContent(); 28 | 29 | /** 30 | * @param content 31 | * the content the codelet looks for. 32 | */ 33 | public void setSoughtContent(NodeStructure content); 34 | 35 | /** 36 | * Returns true if specified WorkspaceBuffer contains this codelet's sought 37 | * content. 38 | * 39 | * @param buffer 40 | * the WorkspaceBuffer to be checked for content 41 | * @return true, if successful 42 | */ 43 | public boolean bufferContainsSoughtContent(WorkspaceBuffer buffer); 44 | 45 | /** 46 | * Returns sought content and related content from specified 47 | * WorkspaceBuffer. 48 | * 49 | * @param buffer 50 | * the buffer 51 | * @return the workspace content 52 | */ 53 | public NodeStructure retrieveWorkspaceContent(WorkspaceBuffer buffer); 54 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/tasks/CodeletImpl.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.tasks; 9 | 10 | import edu.memphis.ccrg.lida.framework.shared.NodeStructure; 11 | import edu.memphis.ccrg.lida.framework.shared.NodeStructureImpl; 12 | 13 | /** 14 | * Abstract implementation of {@link Codelet}. 15 | * 16 | * @author Ryan J. McCall 17 | */ 18 | public abstract class CodeletImpl extends FrameworkTaskImpl implements Codelet { 19 | 20 | /** 21 | * Content which this codelet responds to. 22 | */ 23 | protected NodeStructure soughtContent = new NodeStructureImpl(); 24 | 25 | @Override 26 | public NodeStructure getSoughtContent() { 27 | return soughtContent; 28 | } 29 | 30 | @Override 31 | public void setSoughtContent(NodeStructure content) { 32 | soughtContent = content; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/tasks/TaskStatus.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.framework.tasks; 9 | 10 | /** 11 | * Enumeration of the possible statuses of FrameworkTasks. 12 | * 13 | * @author Javier Snaider. 14 | */ 15 | public enum TaskStatus { 16 | 17 | /** 18 | * FrameworkTask status value: Task is running 19 | */ 20 | RUNNING, 21 | 22 | /** 23 | * FrameworkTask status value: Task is finished, cannot be restarted, and 24 | * cannot have its TaskStatus changed again 25 | */ 26 | CANCELED, 27 | 28 | /** 29 | * FrameworkTask status value: Task is finished 30 | */ 31 | FINISHED, 32 | 33 | /** 34 | * FrameworkTask status value: Task has finished and has results to process 35 | */ 36 | FINISHED_WITH_RESULTS 37 | } 38 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/framework/tasks/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes related to the framework's tasks (small demon-like processes) and their management. 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/globalworkspace/BroadcastContent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.globalworkspace; 9 | 10 | /** 11 | * This interface serves as a mark for data which is sent in the conscious 12 | * broadcast. 13 | * 14 | * @author Javier Snaider 15 | */ 16 | public interface BroadcastContent { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/globalworkspace/BroadcastListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | /** 9 | * 10 | */ 11 | package edu.memphis.ccrg.lida.globalworkspace; 12 | 13 | import edu.memphis.ccrg.lida.framework.ModuleListener; 14 | 15 | /** 16 | * Modules that receive the conscious broadcast must implement this interface. 17 | * Implementers will receive each winning {@link Coalition} from the 18 | * {@link GlobalWorkspace}. 19 | * 20 | * @author Javier Snaider 21 | * @author Ryan J. McCall 22 | */ 23 | public interface BroadcastListener extends ModuleListener { 24 | 25 | /** 26 | * Listener must receive a broadcast of a the winning {@link Coalition} This 27 | * method should return as possible in order to not delay the rest of the 28 | * broadcasting. 29 | * 30 | * @param c 31 | * the {@link Coalition} that won the most recent competition for 32 | * consciousness 33 | */ 34 | public void receiveBroadcast(Coalition c); 35 | 36 | /** 37 | * A place-holder method to remind implementing classes that they should 38 | * implement learning. LIDA theory says receivers of the broadcast should 39 | * learn from it. This method will not be called directly by the 40 | * {@link GlobalWorkspace} and thus it should be managed by the receiving 41 | * module. 42 | * 43 | * @param c 44 | * the {@link Coalition} that won the most recent competition for 45 | * consciousness 46 | */ 47 | public void learn(Coalition c); 48 | 49 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/globalworkspace/Coalition.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | /** 9 | * 10 | */ 11 | package edu.memphis.ccrg.lida.globalworkspace; 12 | 13 | import edu.memphis.ccrg.lida.attentioncodelets.AttentionCodelet; 14 | import edu.memphis.ccrg.lida.framework.shared.activation.Activatible; 15 | 16 | /** 17 | * An encapsulation of perceptual content and an {@link AttentionCodelet} 18 | * {@link Coalition} objects are created and added to the 19 | * {@link GlobalWorkspace} by {@link AttentionCodelet} objects. 20 | * {@link Coalition} must overwrite correctly {@link Object#equals(Object)} and 21 | * {@link Object#hashCode()} methods. 22 | * 23 | * @author Javier Snaider 24 | * @author Ryan J. McCall 25 | */ 26 | public interface Coalition extends Activatible { 27 | 28 | /** 29 | * Gets the content of the coalition. 30 | * @return The {@link BroadcastContent} of the coalition 31 | */ 32 | public BroadcastContent getContent(); 33 | 34 | /** 35 | * Sets the content of the coalition. 36 | * @param c {@link BroadcastContent} 37 | */ 38 | public void setContent(BroadcastContent c); 39 | 40 | /** 41 | * Returns the {@link AttentionCodelet} that created this coalition 42 | * @return The {@link AttentionCodelet} that help form this coalition 43 | */ 44 | public AttentionCodelet getCreatingAttentionCodelet(); 45 | 46 | /** 47 | * Sets the {@link AttentionCodelet} that created this coalition. 48 | * @param c {@link AttentionCodelet} that created this coalition 49 | */ 50 | public void setCreatingAttentionCodelet(AttentionCodelet c); 51 | 52 | /** 53 | * Gets the id. 54 | * @return the unique id of the Coalition 55 | */ 56 | public int getId(); 57 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/globalworkspace/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes related to the GlobalWorkspace, the module responsible for selecting the most 3 | important part of an Agent's current understanding, at the particular moment, for broadcast to all BroadcastListeners. 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/globalworkspace/triggers/IndividualCoaltionActivationTrigger.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.globalworkspace.triggers; 9 | 10 | import java.util.Collection; 11 | import java.util.logging.Level; 12 | import java.util.logging.Logger; 13 | 14 | import edu.memphis.ccrg.lida.framework.tasks.TaskManager; 15 | import edu.memphis.ccrg.lida.globalworkspace.Coalition; 16 | import edu.memphis.ccrg.lida.globalworkspace.GlobalWorkspace; 17 | 18 | /** 19 | * A trigger that fires if any coalition is above a threshold. 20 | * 21 | * @author Javier Snaider 22 | * 23 | */ 24 | public class IndividualCoaltionActivationTrigger extends 25 | AggregateCoalitionActivationTrigger { 26 | 27 | private static final Logger logger = Logger 28 | .getLogger(IndividualCoaltionActivationTrigger.class 29 | .getCanonicalName()); 30 | 31 | /** 32 | * Triggers a broadcast if any {@link Coalition} object's activation is over 33 | * threshold. 34 | * 35 | * @param coalitions 36 | * {@link Coalition} objects current in the 37 | * {@link GlobalWorkspace} 38 | */ 39 | @Override 40 | public void checkForTriggerCondition(Collection coalitions) { 41 | for (Coalition c : coalitions) { 42 | if (c.getActivation() > threshold) { 43 | logger.log(Level.FINE, "Individual Activation trigger fires", 44 | TaskManager.getCurrentTick()); 45 | gw.triggerBroadcast(this); 46 | break; 47 | } 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/globalworkspace/triggers/NoCoalitionArrivingTrigger.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.globalworkspace.triggers; 9 | 10 | import java.util.Collection; 11 | import java.util.TimerTask; 12 | 13 | import edu.memphis.ccrg.lida.globalworkspace.Coalition; 14 | import edu.memphis.ccrg.lida.globalworkspace.GlobalWorkspace; 15 | 16 | /** 17 | * A trigger that fires when a certain number of ticks have passed without a new 18 | * {@link Coalition} being added to the {@link GlobalWorkspace}. Inherits most 19 | * of its fields and methods from its parent class 20 | * {@link NoBroadcastOccurringTrigger}. 21 | * 22 | * @author Javier Snaider 23 | * @see NoBroadcastOccurringTrigger 24 | */ 25 | public class NoCoalitionArrivingTrigger extends NoBroadcastOccurringTrigger { 26 | 27 | /** 28 | * Called each time a new coalition is added to the {@link GlobalWorkspace}. 29 | * Specifically for this trigger {@link NoBroadcastOccurringTrigger#reset()} 30 | * is called which resets the {@link TimerTask} object. Thus this trigger 31 | * fires when a certain number of ticks have passed without a new 32 | * {@link Coalition} entering the {@link GlobalWorkspace}. 33 | * 34 | * @param coalitions 35 | * {@link Coalition} objects the trigger can check 36 | */ 37 | @Override 38 | public void checkForTriggerCondition(Collection coalitions) { 39 | reset(); 40 | } 41 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/globalworkspace/triggers/TriggerListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.globalworkspace.triggers; 9 | 10 | import edu.memphis.ccrg.lida.globalworkspace.GlobalWorkspace; 11 | 12 | /** 13 | * This interface should be implemented by the class that wants to receive 14 | * {@link BroadcastTrigger} notifications. In general, it is the same class that 15 | * implements {@link GlobalWorkspace} interface. 16 | * 17 | * @author Javier Snaider 18 | */ 19 | public interface TriggerListener { 20 | 21 | /** 22 | * Listener must trigger a competition for consciousness and a conscious 23 | * broadcast of the winner 24 | * 25 | * @param t 26 | * trigger that is initiating the broadcast 27 | */ 28 | public void triggerBroadcast(BroadcastTrigger t); 29 | } 30 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/globalworkspace/triggers/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes related to the triggering of the competition for the global conscious broadcast. 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/motivation/pam/FeelingPamLinkImpl.java: -------------------------------------------------------------------------------- 1 | package edu.memphis.ccrg.lida.motivation.pam; 2 | 3 | import edu.memphis.ccrg.lida.motivation.shared.Valenceable; 4 | import edu.memphis.ccrg.lida.motivation.shared.ValenceableImpl; 5 | import edu.memphis.ccrg.lida.pam.PamLink; 6 | import edu.memphis.ccrg.lida.pam.PamLinkImpl; 7 | 8 | /** 9 | * A {@link PamLink} with a valence. 10 | * @author Ryan J McCall 11 | */ 12 | public class FeelingPamLinkImpl extends PamLinkImpl implements Valenceable { 13 | 14 | private ValenceableImpl valence = new ValenceableImpl(); 15 | 16 | @Override 17 | public int getValenceSign() { 18 | return valence.getValenceSign(); 19 | } 20 | 21 | @Override 22 | public void setValenceSign(int s) { 23 | valence.setValenceSign(s); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/motivation/pam/FeelingPamNodeImpl.java: -------------------------------------------------------------------------------- 1 | package edu.memphis.ccrg.lida.motivation.pam; 2 | 3 | import edu.memphis.ccrg.lida.motivation.shared.FeelingNode; 4 | import edu.memphis.ccrg.lida.motivation.shared.ValenceableImpl; 5 | import edu.memphis.ccrg.lida.pam.PamNode; 6 | import edu.memphis.ccrg.lida.pam.PamNodeImpl; 7 | 8 | /** 9 | * A {@link PamNode} with a valence and a flag signifying whether or not it is a drive feeling. 10 | * @author Ryan J McCall 11 | */ 12 | public class FeelingPamNodeImpl extends PamNodeImpl implements FeelingNode { 13 | 14 | private ValenceableImpl valence = new ValenceableImpl(); 15 | private boolean isDrive; 16 | 17 | @Override 18 | public int getValenceSign() { 19 | return valence.getValenceSign(); 20 | } 21 | 22 | @Override 23 | public void setValenceSign(int s) { 24 | valence.setValenceSign(s); 25 | } 26 | 27 | @Override 28 | public double getAffectiveValence() { 29 | return getValenceSign()*getTotalActivation(); 30 | } 31 | 32 | @Override 33 | public boolean isDrive() { 34 | return isDrive; 35 | } 36 | 37 | @Override 38 | public void setDrive(boolean b) { 39 | isDrive = b; 40 | } 41 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/motivation/pam/IncentiveSaliencePropagationTask.java: -------------------------------------------------------------------------------- 1 | package edu.memphis.ccrg.lida.motivation.pam; 2 | 3 | import edu.memphis.ccrg.lida.pam.PerceptualAssociativeMemory; 4 | import edu.memphis.ccrg.lida.pam.tasks.PropagationTask; 5 | 6 | /** 7 | * Task for the propagation of current incentive salience, originating from a drive feeling nodes, along an incentive salience link. 8 | * The key key difference with this link is that it transmits current incentive salience to its sink and adds a valence to the 9 | * excitation amount; 10 | * @author Ryan J McCall 11 | */ 12 | public class IncentiveSaliencePropagationTask extends PropagationTask { 13 | 14 | /** 15 | * @param tpr ticks per run 16 | * @param lnk a {@link FeelingPamLinkImpl} 17 | * @param a an excitation amount 18 | * @param pam the {@link PerceptualAssociativeMemory} module. 19 | */ 20 | public IncentiveSaliencePropagationTask(int tpr,FeelingPamLinkImpl lnk, 21 | double a,PerceptualAssociativeMemory pam) { 22 | super(tpr,lnk,a,pam); 23 | } 24 | 25 | @Override 26 | protected void runThisFrameworkTask() { 27 | link.exciteActivation(excitationAmount); 28 | // 29 | FeelingPamLinkImpl fLink = (FeelingPamLinkImpl) link; 30 | double propagatedIncentiveSalience = excitationAmount*fLink.getValenceSign()*fLink.getBaseLevelActivation(); 31 | sink.exciteIncentiveSalience(propagatedIncentiveSalience); 32 | // 33 | runPostExcitation(); 34 | } 35 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/motivation/proceduralmemory/MotivationProceduralMemoryInitializer.java: -------------------------------------------------------------------------------- 1 | package edu.memphis.ccrg.lida.motivation.proceduralmemory; 2 | 3 | import java.util.Map; 4 | import java.util.logging.Level; 5 | import java.util.logging.Logger; 6 | 7 | import edu.memphis.ccrg.lida.framework.Agent; 8 | import edu.memphis.ccrg.lida.framework.initialization.FullyInitializable; 9 | import edu.memphis.ccrg.lida.framework.initialization.GlobalInitializer; 10 | import edu.memphis.ccrg.lida.framework.initialization.Initializable; 11 | import edu.memphis.ccrg.lida.framework.initialization.Initializer; 12 | import edu.memphis.ccrg.lida.framework.shared.LinkCategory; 13 | import edu.memphis.ccrg.lida.framework.tasks.TaskManager; 14 | import edu.memphis.ccrg.lida.proceduralmemory.BasicProceduralMemoryInitializer; 15 | 16 | /** 17 | * An {@link Initializer} for the {@link MotivationProceduralMemory}. 18 | * Its only function is to give the Procedural Memory access to the temporal 19 | * {@link LinkCategory}. This must be done in an initializer because the LinkCategory may have not yet 20 | * been created when the procedural memory's {@link Initializable#init()} runs. 21 | * @author Ryan J McCall 22 | */ 23 | public class MotivationProceduralMemoryInitializer extends BasicProceduralMemoryInitializer implements Initializer { 24 | 25 | private static final Logger logger = Logger.getLogger(MotivationProceduralMemoryInitializer.class.getCanonicalName()); 26 | 27 | @Override 28 | public void initModule(FullyInitializable m, Agent a, Map params) { 29 | super.initModule(m, a, params); 30 | MotivationProceduralMemory pm = (MotivationProceduralMemory) m; 31 | String label = (String) params.get("linkCategory"); 32 | GlobalInitializer gi = GlobalInitializer.getInstance(); 33 | Object o = gi.getAttribute(label.trim()); 34 | if (o instanceof LinkCategory) { 35 | pm.setTemporalLinkCategory((LinkCategory) o); 36 | } else { 37 | logger.log(Level.WARNING, 38 | "Did not get a LinkCategory from GlobalInitializer using name {1}.", 39 | new Object[] {TaskManager.getCurrentTick(), label}); 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/motivation/shared/FeelingLinkImpl.java: -------------------------------------------------------------------------------- 1 | package edu.memphis.ccrg.lida.motivation.shared; 2 | 3 | import edu.memphis.ccrg.lida.framework.shared.Link; 4 | import edu.memphis.ccrg.lida.framework.shared.LinkImpl; 5 | 6 | /** 7 | * A {@link Link} having a valence. 8 | * @author Ryan J McCall 9 | */ 10 | public class FeelingLinkImpl extends LinkImpl implements Valenceable { 11 | 12 | private ValenceableImpl valence = new ValenceableImpl(); 13 | 14 | @Override 15 | public int getValenceSign() { 16 | return valence.getValenceSign(); 17 | } 18 | 19 | @Override 20 | public void setValenceSign(int s) { 21 | valence.setValenceSign(s); 22 | } 23 | 24 | @Override 25 | public void updateLinkValues(Link l){ 26 | super.updateLinkValues(l); 27 | if(l instanceof Valenceable){ 28 | Valenceable otherLink = (Valenceable) l; 29 | valence.setValenceSign(otherLink.getValenceSign()); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/motivation/shared/FeelingNode.java: -------------------------------------------------------------------------------- 1 | package edu.memphis.ccrg.lida.motivation.shared; 2 | 3 | import edu.memphis.ccrg.lida.framework.shared.Node; 4 | 5 | 6 | /** 7 | * A {@link Node} having a valence. Can be marked a drive feeling or not. 8 | * @author Ryan J McCall 9 | */ 10 | public interface FeelingNode extends Valenceable, Node { 11 | 12 | /** 13 | * Gets the current affective valence. 14 | * @return a double value representing the object's affective valence. 15 | */ 16 | public double getAffectiveValence(); 17 | 18 | /** 19 | * Returns whether this feeling is a drive, i.e., concerning the agent's internal state. 20 | * @return true if the feeling is a drive feeling 21 | */ 22 | public boolean isDrive(); 23 | 24 | /** 25 | * Sets the flag specifying whether this feeling is a drive, i.e., concerning the agent's internal state. 26 | * @param d true if the feeling is a drive feeling; false otherwise. 27 | */ 28 | public void setDrive(boolean d); 29 | } 30 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/motivation/shared/FeelingNodeImpl.java: -------------------------------------------------------------------------------- 1 | package edu.memphis.ccrg.lida.motivation.shared; 2 | 3 | import edu.memphis.ccrg.lida.framework.shared.Node; 4 | import edu.memphis.ccrg.lida.framework.shared.NodeImpl; 5 | 6 | 7 | /** 8 | * The default implementation of {@link FeelingNode}. 9 | * @author Ryan J. McCall 10 | */ 11 | public class FeelingNodeImpl extends NodeImpl implements FeelingNode { 12 | 13 | private ValenceableImpl valence = new ValenceableImpl(); 14 | private boolean isDrive; 15 | 16 | @Override 17 | public int getValenceSign() { 18 | return valence.getValenceSign(); 19 | } 20 | 21 | @Override 22 | public void setValenceSign(int s) { 23 | valence.setValenceSign(s); 24 | } 25 | 26 | @Override 27 | public double getAffectiveValence() { 28 | return getValenceSign()*getActivation(); 29 | } 30 | 31 | @Override 32 | public boolean isDrive() { 33 | return isDrive; 34 | } 35 | 36 | @Override 37 | public synchronized void setDrive(boolean b) { 38 | isDrive = b; 39 | } 40 | 41 | @Override 42 | public void updateNodeValues(Node n){ 43 | super.updateNodeValues(n); 44 | if (n instanceof FeelingNode) { 45 | FeelingNode otherNode = (FeelingNode) n; 46 | isDrive = otherNode.isDrive(); 47 | valence.setValenceSign(otherNode.getValenceSign()); 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/motivation/shared/Valenceable.java: -------------------------------------------------------------------------------- 1 | package edu.memphis.ccrg.lida.motivation.shared; 2 | 3 | /** 4 | * A representation of a valence, either positive or negative. 5 | * @author Ryan J. McCall 6 | */ 7 | public interface Valenceable { 8 | 9 | /** 10 | * Sets the sign of this feeling's valence. 11 | * Zero or positive set the sign to positive, otherwise the sign is set to negative. 12 | * @param s a valence sign code 13 | */ 14 | public void setValenceSign(int s); 15 | 16 | /** 17 | * Gets the valence sign. 18 | * @return 1 for a positive sign; -1 for a negative sign. 19 | */ 20 | public int getValenceSign(); 21 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/motivation/shared/ValenceableImpl.java: -------------------------------------------------------------------------------- 1 | package edu.memphis.ccrg.lida.motivation.shared; 2 | 3 | /** 4 | * The default implementation of {@link Valenceable}. 5 | * @author Ryan J. McCall 6 | */ 7 | public class ValenceableImpl implements Valenceable { 8 | 9 | private static final int POSITIVE_VALENCE_SIGN = 1; 10 | private static final int NEGATIVE_VALENCE_SIGN = -1; 11 | private int valenceSign = POSITIVE_VALENCE_SIGN; 12 | 13 | @Override 14 | public int getValenceSign() { 15 | return valenceSign; 16 | } 17 | 18 | @Override 19 | public synchronized void setValenceSign(int s) { 20 | if(s >= 0){ 21 | valenceSign = POSITIVE_VALENCE_SIGN; 22 | }else{ 23 | valenceSign = NEGATIVE_VALENCE_SIGN; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/motivation/workspace/FeelingStructureBuildingCodelet.java: -------------------------------------------------------------------------------- 1 | package edu.memphis.ccrg.lida.motivation.workspace; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collection; 5 | 6 | import edu.memphis.ccrg.lida.framework.shared.Node; 7 | import edu.memphis.ccrg.lida.framework.shared.NodeStructure; 8 | import edu.memphis.ccrg.lida.motivation.shared.FeelingNode; 9 | import edu.memphis.ccrg.lida.pam.PerceptualAssociativeMemoryImpl; 10 | import edu.memphis.ccrg.lida.workspace.structurebuildingcodelets.StructureBuildingCodeletImpl; 11 | import edu.memphis.ccrg.lida.workspace.workspacebuffers.WorkspaceBuffer; 12 | 13 | /** 14 | * Tries to associate feeling nodes with coincidentally active event nodes. 15 | * @author Ryan J. McCall 16 | */ 17 | public class FeelingStructureBuildingCodelet extends StructureBuildingCodeletImpl { 18 | 19 | @Override 20 | protected void runThisFrameworkTask() { 21 | NodeStructure bufferContent = writableBuffer.getBufferContent(null); 22 | Collection feelingNodes = new ArrayList(); 23 | Collection eventNodes = new ArrayList(); 24 | for(Node n: bufferContent.getNodes()){ 25 | if(n instanceof FeelingNode){ 26 | feelingNodes.add((FeelingNode) n); 27 | }else { 28 | eventNodes.add(n); 29 | } 30 | } 31 | for(Node feelingNode: feelingNodes){ 32 | for(Node eventNode: eventNodes){ 33 | //Add a link from Feeling to Max active node. 34 | //Runs the risk of connecting Feelings to non-event nodes if such nodes occur. 35 | //Activation is harmonic mean 36 | double linkActivation = 2*feelingNode.getActivation()*eventNode.getActivation()/(feelingNode.getActivation()+eventNode.getActivation()); 37 | bufferContent.addDefaultLink(feelingNode, eventNode, 38 | PerceptualAssociativeMemoryImpl.PARENT_LINK_CATEGORY, 39 | linkActivation, 0.0); 40 | } 41 | } 42 | } 43 | 44 | @Override 45 | public NodeStructure retrieveWorkspaceContent(WorkspaceBuffer buffer) { 46 | return null; 47 | } 48 | @Override 49 | public boolean bufferContainsSoughtContent(WorkspaceBuffer buffer) { 50 | return false; 51 | } 52 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/motivation/workspace/MotivationWorkspaceInitializer.java: -------------------------------------------------------------------------------- 1 | package edu.memphis.ccrg.lida.motivation.workspace; 2 | 3 | import java.util.Map; 4 | 5 | import edu.memphis.ccrg.lida.framework.Agent; 6 | import edu.memphis.ccrg.lida.framework.initialization.FullyInitializable; 7 | import edu.memphis.ccrg.lida.framework.initialization.GlobalInitializer; 8 | import edu.memphis.ccrg.lida.framework.initialization.Initializer; 9 | import edu.memphis.ccrg.lida.framework.shared.LinkCategory; 10 | 11 | /** 12 | * {@link Initializer} for the {@link MotivationWorkspace}. 13 | * @author Ryan J McCall 14 | * 15 | */ 16 | public class MotivationWorkspaceInitializer implements Initializer { 17 | 18 | @Override 19 | public void initModule(FullyInitializable m, Agent a, Map params) { 20 | MotivationWorkspace workspace = (MotivationWorkspace)m; 21 | String label = (String) params.get("linkCategory"); 22 | Object o = GlobalInitializer.getInstance().getAttribute(label.trim()); 23 | if (o instanceof LinkCategory) { 24 | workspace.setTemporalCategory((LinkCategory)o); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/pam/PamLink.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.pam; 9 | 10 | import edu.memphis.ccrg.lida.framework.shared.Link; 11 | 12 | /** 13 | * A {@link Link} in {@link PerceptualAssociativeMemory} 14 | * 15 | * @author Ryan J. McCall 16 | * 17 | */ 18 | public interface PamLink extends Link, PamLinkable { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/pam/PamLinkable.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.pam; 9 | 10 | import edu.memphis.ccrg.lida.framework.shared.Linkable; 11 | import edu.memphis.ccrg.lida.framework.shared.activation.Learnable; 12 | 13 | /** 14 | * A {@link Learnable} {@link Linkable}, a {@link PamNode} or {@link PamLink} 15 | * 16 | * @author Ryan J. McCall 17 | * @see PamNode 18 | * @see PamLink 19 | * @see PerceptualAssociativeMemory 20 | */ 21 | public interface PamLinkable extends Linkable, Learnable { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/pam/PamListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.pam; 9 | 10 | import edu.memphis.ccrg.lida.framework.ModuleListener; 11 | import edu.memphis.ccrg.lida.framework.shared.Link; 12 | import edu.memphis.ccrg.lida.framework.shared.Node; 13 | import edu.memphis.ccrg.lida.framework.shared.NodeStructure; 14 | 15 | /** 16 | * A PamListener receives percepts from {@link PerceptualAssociativeMemory} 17 | * asynchronously. 18 | * 19 | * @author Ryan J. McCall 20 | */ 21 | public interface PamListener extends ModuleListener { 22 | 23 | /** 24 | * Receive a {@link NodeStructure} percept. 25 | * 26 | * @param ns 27 | * a NodeStructure 28 | */ 29 | public void receivePercept(NodeStructure ns); 30 | 31 | /** 32 | * Receive a {@link Node} percept. 33 | * 34 | * @param n 35 | * a {@link Node} 36 | */ 37 | public void receivePercept(Node n); 38 | 39 | /** 40 | * Receive a {@link Link} percept. 41 | * 42 | * @param l 43 | * a {@link Link} 44 | */ 45 | public void receivePercept(Link l); 46 | 47 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/pam/PamNode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.pam; 9 | 10 | import edu.memphis.ccrg.lida.framework.shared.Link; 11 | import edu.memphis.ccrg.lida.framework.shared.LinkCategory; 12 | import edu.memphis.ccrg.lida.framework.shared.Node; 13 | 14 | /** 15 | * A PamNode is a {@link Node} which resides in 16 | * {@link PerceptualAssociativeMemory} and represents a feature or a concept. 17 | * PamNodes are involved in activation passing where Nodes are not. They can 18 | * represent the {@link LinkCategory} of a {@link Link}. 19 | * 20 | * @author Ryan J. McCall 21 | * @author Javier Snaider 22 | * @see PerceptualAssociativeMemory 23 | */ 24 | public interface PamNode extends Node, PamLinkable, LinkCategory { 25 | 26 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/pam/PropagationStrategy.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.pam; 9 | 10 | import java.util.Map; 11 | 12 | import edu.memphis.ccrg.lida.framework.strategies.Strategy; 13 | 14 | /** 15 | * A {@link Strategy} that calculates an activation to be propagated. 16 | * 17 | * @author Ryan J. McCall 18 | */ 19 | public interface PropagationStrategy extends Strategy { 20 | 21 | /** 22 | * Various parameters can be passed to this method for the calculation of 23 | * activation to propagate. 24 | * 25 | * @param params 26 | * Map of parameters 27 | * @return the calculated activation to propagate 28 | */ 29 | public double getActivationToPropagate(Map params); 30 | } 31 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/pam/UpscalePropagationStrategy.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.pam; 9 | 10 | import java.util.Map; 11 | import java.util.logging.Level; 12 | import java.util.logging.Logger; 13 | 14 | import edu.memphis.ccrg.lida.framework.strategies.StrategyImpl; 15 | import edu.memphis.ccrg.lida.framework.tasks.TaskManager; 16 | 17 | /** 18 | * Calculates a new activation using an upscale parameter. 19 | * 20 | * @author Ryan J. McCall 21 | */ 22 | public class UpscalePropagationStrategy extends StrategyImpl implements 23 | PropagationStrategy { 24 | 25 | private Logger logger = Logger.getLogger(UpscalePropagationStrategy.class 26 | .getCanonicalName()); 27 | 28 | /* 29 | * Calculate and return an activation to propagate. 30 | * 31 | * @param params the params 32 | * 33 | * @return the activation to propagate 34 | */ 35 | @Override 36 | public double getActivationToPropagate(Map params) { 37 | if (params.containsKey("totalActivation") 38 | && params.containsKey("upscale")) { 39 | return (Double) params.get("totalActivation") 40 | * (Double) params.get("upscale"); 41 | } else { 42 | logger.log(Level.WARNING, "Unable to obtain parameters", 43 | TaskManager.getCurrentTick()); 44 | return 0.0; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/pam/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes related to the definition of the Perceptual Associative Memory module and its default implementation. 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/pam/tasks/AddLinkToPerceptTask.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.pam.tasks; 9 | 10 | import edu.memphis.ccrg.lida.framework.shared.Link; 11 | import edu.memphis.ccrg.lida.framework.shared.Node; 12 | import edu.memphis.ccrg.lida.framework.tasks.FrameworkTaskImpl; 13 | import edu.memphis.ccrg.lida.pam.PamLink; 14 | import edu.memphis.ccrg.lida.pam.PerceptualAssociativeMemory; 15 | 16 | /** 17 | * A task to add a {@link PamLink} and its sink to the percept. 18 | * 19 | * @author Ryan J. McCall 20 | * @see ExcitationTask creates this task 21 | * @see PropagationTask creates this task 22 | */ 23 | public class AddLinkToPerceptTask extends FrameworkTaskImpl { 24 | 25 | private PerceptualAssociativeMemory pam; 26 | private Link link; 27 | 28 | /** 29 | * Default constructor 30 | * 31 | * @param link 32 | * {@link PamLink} 33 | * @param pam 34 | * {@link PerceptualAssociativeMemory} 35 | */ 36 | public AddLinkToPerceptTask(Link link, PerceptualAssociativeMemory pam) { 37 | this.pam = pam; 38 | this.link = link; 39 | } 40 | 41 | /** 42 | * Adds link's sink to the percept and tries to add the link as well then 43 | * finishes. 44 | */ 45 | @Override 46 | protected void runThisFrameworkTask() { 47 | pam.addToPercept((Node) link.getSink()); 48 | pam.addToPercept(link); 49 | cancel(); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/pam/tasks/AddNodeStructureToPerceptTask.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.pam.tasks; 9 | 10 | import edu.memphis.ccrg.lida.framework.shared.NodeStructure; 11 | import edu.memphis.ccrg.lida.framework.tasks.FrameworkTaskImpl; 12 | import edu.memphis.ccrg.lida.pam.PerceptualAssociativeMemory; 13 | 14 | /** 15 | * A task which adds a {@link NodeStructure} to the percept. 16 | * 17 | * @author Ryan J. McCall 18 | */ 19 | public class AddNodeStructureToPerceptTask extends FrameworkTaskImpl { 20 | 21 | private NodeStructure ns; 22 | private PerceptualAssociativeMemory pam; 23 | 24 | /** 25 | * Default constructor 26 | * 27 | * @param ns 28 | * {@link NodeStructure} 29 | * @param pam 30 | * {@link PerceptualAssociativeMemory} 31 | */ 32 | public AddNodeStructureToPerceptTask(NodeStructure ns, 33 | PerceptualAssociativeMemory pam) { 34 | this.ns = ns; 35 | this.pam = pam; 36 | } 37 | 38 | /** 39 | * Adds {@link NodeStructure} to the percept then finishes. 40 | */ 41 | @Override 42 | protected void runThisFrameworkTask() { 43 | pam.addToPercept(ns); 44 | cancel(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/pam/tasks/AddNodeToPerceptTask.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.pam.tasks; 9 | 10 | import edu.memphis.ccrg.lida.framework.shared.Node; 11 | import edu.memphis.ccrg.lida.framework.tasks.FrameworkTaskImpl; 12 | import edu.memphis.ccrg.lida.pam.PamNode; 13 | import edu.memphis.ccrg.lida.pam.PerceptualAssociativeMemory; 14 | 15 | /** 16 | * A task which adds a {@link PamNode} to the percept. 17 | * 18 | * @author Ryan J. McCall 19 | */ 20 | public class AddNodeToPerceptTask extends FrameworkTaskImpl { 21 | 22 | private Node node; 23 | private PerceptualAssociativeMemory pam; 24 | 25 | /** 26 | * Default constructor 27 | * 28 | * @param n 29 | * the {@link Node} to add 30 | * @param pam 31 | * {@link PerceptualAssociativeMemory} 32 | */ 33 | public AddNodeToPerceptTask(Node n, PerceptualAssociativeMemory pam) { 34 | node = n; 35 | this.pam = pam; 36 | } 37 | 38 | /** 39 | * Adds {@link Node} to the percept then finishes. 40 | */ 41 | @Override 42 | protected void runThisFrameworkTask() { 43 | pam.addToPercept(node); 44 | cancel(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/pam/tasks/DetectionAlgorithm.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.pam.tasks; 9 | 10 | import edu.memphis.ccrg.lida.framework.tasks.FrameworkTask; 11 | import edu.memphis.ccrg.lida.pam.PamLinkable; 12 | import edu.memphis.ccrg.lida.pam.PamNode; 13 | import edu.memphis.ccrg.lida.sensorymemory.SensoryMemory; 14 | 15 | /** 16 | * A process which detects a pattern (feature) in {@link SensoryMemory} content 17 | * and excites {@link PamNode}s representing that pattern. 18 | * 19 | * @author Javier Snaider 20 | * @author Ryan J. McCall 21 | * @see BasicDetectionAlgorithm 22 | */ 23 | public interface DetectionAlgorithm extends FrameworkTask { 24 | 25 | /** 26 | * Detects a feature. 27 | * 28 | * @return value from 0.0 to 1.0 representing the degree to which the 29 | * feature occurs. 30 | */ 31 | public double detect(); 32 | 33 | /** 34 | * Returns {@link PamLinkable} this algorithm can detect. 35 | * 36 | * @return the pam nodes 37 | */ 38 | public PamLinkable getPamLinkable(); 39 | 40 | /** 41 | * Adds {@link PamLinkable} that will be detected by this algorithm. 42 | * 43 | * @param linkable 44 | * s {@link PamLinkable} 45 | */ 46 | public void setPamLinkable(PamLinkable linkable); 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/pam/tasks/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes implementing several low-level processes of the default PerceptualAssociativeMemory. 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/proceduralmemory/Condition.java: -------------------------------------------------------------------------------- 1 | package edu.memphis.ccrg.lida.proceduralmemory; 2 | 3 | import edu.memphis.ccrg.lida.actionselection.Behavior; 4 | import edu.memphis.ccrg.lida.framework.shared.activation.Activatible; 5 | 6 | /** 7 | * A requirement for a {@link Behavior} to be selected. Implementors should 8 | * correctly override {@link Object#equals(Object)} and 9 | * {@link Object#hashCode()} since Conditions are used as keys in Maps. 10 | * 11 | * @author Javier Snaider 12 | */ 13 | public interface Condition extends Activatible { 14 | 15 | /** 16 | * Gets id. The return object must be unique and it must be able to use as a 17 | * map key i.e. {@link Object#equals(Object)} and {@link Object#hashCode()} 18 | * must be overwritten for this id. 19 | * 20 | * @return Condition's unique id 21 | */ 22 | public Object getConditionId(); 23 | } 24 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/proceduralmemory/ProceduralMemoryListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | 9 | package edu.memphis.ccrg.lida.proceduralmemory; 10 | 11 | import edu.memphis.ccrg.lida.actionselection.Behavior; 12 | import edu.memphis.ccrg.lida.framework.ModuleListener; 13 | 14 | /** 15 | * A procedural memory listener receives instantiated schemes which are 16 | * behaviors 17 | * 18 | * @author Ryan J. McCall 19 | */ 20 | public interface ProceduralMemoryListener extends ModuleListener { 21 | 22 | /** 23 | * Receive a {@link Behavior} 24 | * 25 | * @param behavior 26 | * - a stream, a partial order, of behaviors 27 | */ 28 | public void receiveBehavior(Behavior behavior); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/proceduralmemory/ProceduralUnit.java: -------------------------------------------------------------------------------- 1 | package edu.memphis.ccrg.lida.proceduralmemory; 2 | 3 | import java.util.Collection; 4 | 5 | import edu.memphis.ccrg.lida.actionselection.Action; 6 | import edu.memphis.ccrg.lida.actionselection.Behavior; 7 | import edu.memphis.ccrg.lida.framework.shared.ElementFactory; 8 | import edu.memphis.ccrg.lida.framework.shared.activation.Activatible; 9 | 10 | /** 11 | * An abstraction of the commonality between {@link Scheme} and {@link Behavior} 12 | * . 13 | * 14 | * @author Ryan J. McCall 15 | * @author Javier Snaider 16 | */ 17 | public interface ProceduralUnit extends Activatible { 18 | 19 | /** 20 | * Gets action. 21 | * 22 | * @return the {@link Action} this unit contains 23 | */ 24 | public Action getAction(); 25 | 26 | /** 27 | * Gets context conditions. 28 | * 29 | * @return the context's conditions 30 | */ 31 | public Collection getContextConditions(); 32 | 33 | /** 34 | * Gets adding list. 35 | * 36 | * @return the adding list 37 | */ 38 | public Collection getAddingList(); 39 | 40 | /** 41 | * Gets deleting list. 42 | * 43 | * @return the deleting list 44 | */ 45 | public Collection getDeletingList(); 46 | 47 | /** 48 | * Gets the label. 49 | * 50 | * @return label of the unit 51 | */ 52 | public String getLabel(); 53 | 54 | /** 55 | * Sets Scheme's label 56 | * 57 | * @param l 58 | * a String 59 | */ 60 | public void setLabel(String l); 61 | 62 | /** 63 | * Sets unique identifier for {@link Scheme}. Should be used by 64 | * {@link ElementFactory} only. 65 | * 66 | * @param id 67 | * unique identifier for this scheme 68 | */ 69 | public void setId(int id); 70 | 71 | /** 72 | * Gets scheme's id. 73 | * 74 | * @return unique identifier for this scheme 75 | */ 76 | public int getId(); 77 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/proceduralmemory/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes related to the definition of the Procedural Memory module and its default implementation. 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/sensorymemory/SensoryMemory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.sensorymemory; 9 | 10 | import java.util.Map; 11 | 12 | import edu.memphis.ccrg.lida.framework.FrameworkModule; 13 | 14 | /** 15 | * This is the interface to be implemented by sensory memory modules. 16 | * Implementing modules sense the environment, store the sensed data ,and 17 | * process it. 18 | * 19 | * @author Ryan J. McCall 20 | */ 21 | public interface SensoryMemory extends FrameworkModule { 22 | 23 | /** 24 | * Adds a listener to this memory. This listener constantly checks for 25 | * information being sent from this memory to other modules (Perceptual 26 | * Associative Memory and Sensory Motor Memory). 27 | * 28 | * @param l 29 | * the listener added to this memory 30 | */ 31 | public void addSensoryMemoryListener(SensoryMemoryListener l); 32 | 33 | /** 34 | * Runs all the sensors associated with this memory. The sensors get the 35 | * information from the environment and store in this memory for later 36 | * processing and passing to the perceptual memory module. 37 | */ 38 | public void runSensors(); 39 | 40 | /** 41 | * Returns content from this SensoryMemory. Intended to be used by feature 42 | * detectors to get specific parts of the sensory memory. 43 | * 44 | * @param modality 45 | * user may optionally use this parameter to specify modality. 46 | * @param params 47 | * optional parameters 48 | * @return content 49 | */ 50 | public Object getSensoryContent(String modality, Map params); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/sensorymemory/SensoryMemoryBackgroundTask.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.sensorymemory; 9 | 10 | import java.util.logging.Level; 11 | import java.util.logging.Logger; 12 | 13 | import edu.memphis.ccrg.lida.framework.FrameworkModule; 14 | import edu.memphis.ccrg.lida.framework.tasks.FrameworkTaskImpl; 15 | import edu.memphis.ccrg.lida.framework.tasks.TaskManager; 16 | 17 | /** 18 | * Task which operates a Sensory Memory. This class provides a general way to 19 | * control various type of sensory memory -- It is the meaning of "background" 20 | * here. 21 | * 22 | * @author Javier Snaider 23 | */ 24 | public class SensoryMemoryBackgroundTask extends FrameworkTaskImpl { 25 | 26 | private static final Logger logger = Logger 27 | .getLogger(SensoryMemoryBackgroundTask.class.getCanonicalName()); 28 | private SensoryMemory sm; 29 | 30 | /** 31 | * This method overrides setAssociatedModule() from class FrameworkTaskImpl 32 | * It sets a module passing parameter to SensoryMemory sm 33 | * 34 | * @param module 35 | * The module to be associated 36 | * @param moduleUsage 37 | * It is not used here 38 | */ 39 | @Override 40 | public void setAssociatedModule(FrameworkModule module, String moduleUsage) { 41 | if (module instanceof SensoryMemory) { 42 | sm = (SensoryMemory) module; 43 | } else { 44 | logger.log(Level.WARNING, "Cannot add module {1}", new Object[] { 45 | TaskManager.getCurrentTick(), module }); 46 | } 47 | } 48 | 49 | /** 50 | * This method overrides runThisFrameworkTask() from class FrameworkTaskImpl 51 | * It executes method runSensors()of SensoryMemory sm 52 | * 53 | */ 54 | @Override 55 | protected void runThisFrameworkTask() { 56 | sm.runSensors(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/sensorymemory/SensoryMemoryListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.sensorymemory; 9 | 10 | import edu.memphis.ccrg.lida.framework.ModuleListener; 11 | 12 | /** 13 | * This interface should be implemented for receiving and using information 14 | * coming from a {@link SensoryMemory} module. 15 | * 16 | * @author Ryan J. McCall 17 | * 18 | */ 19 | public interface SensoryMemoryListener extends ModuleListener { 20 | 21 | /** 22 | * This method is used to receive information from sensory memory. 23 | * Sensory-Motor Memory calls this method and receives the information of 24 | * sensory memory. 25 | * 26 | * @param content 27 | * an Object containing {@link SensoryMemory} content 28 | */ 29 | public void receiveSensoryMemoryContent(Object content); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/sensorymemory/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes related to the definition of the Sensory Memory module. 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/sensorymotormemory/SensoryMotorMemory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.sensorymotormemory; 9 | 10 | import edu.memphis.ccrg.lida.framework.FrameworkModule; 11 | 12 | /** 13 | * Sensory Motor Memory is a module which receives selected actions from 14 | * ActionSelection and content from SensoryMemory. It contains the algorithm for 15 | * a selected action. When it executes an algorithm it directly calls a method 16 | * in the environment (doesn't use a listener). 17 | * 18 | * @author Ryan J. McCall 19 | * @author Javier Snaider 20 | * 21 | */ 22 | public interface SensoryMotorMemory extends FrameworkModule { 23 | 24 | /** 25 | * Any non-environment communication should use listeners. 26 | * 27 | * @param l 28 | * SensoryMotorMemoryListener 29 | */ 30 | public void addSensoryMotorMemoryListener(SensoryMotorMemoryListener l); 31 | 32 | /** 33 | * Executes specified action algorithm 34 | * 35 | * @param command 36 | * algorithm to execute in the agent's actuators or directly in 37 | * the environment. 38 | */ 39 | public void sendActuatorCommand(Object command); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/sensorymotormemory/SensoryMotorMemoryListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.sensorymotormemory; 9 | 10 | import edu.memphis.ccrg.lida.framework.ModuleListener; 11 | 12 | /** 13 | * Listener of {@link SensoryMotorMemory} 14 | * 15 | * @author Ryan J. McCall 16 | */ 17 | public interface SensoryMotorMemoryListener extends ModuleListener { 18 | 19 | /** 20 | * @param command 21 | * Current command being executed. 22 | */ 23 | public void receiveActuatorCommand(Object command); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/sensorymotormemory/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes related to the definition of the Sensory Motor Memory module. 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/workspace/Workspace.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.workspace; 9 | 10 | import edu.memphis.ccrg.lida.episodicmemory.CueListener; 11 | import edu.memphis.ccrg.lida.framework.FrameworkModule; 12 | import edu.memphis.ccrg.lida.framework.shared.NodeStructure; 13 | 14 | /** 15 | * The workspace collection of submodules where Cues from episodic memories, the 16 | * recent contents of conscious, the perceptual buffer, and the current 17 | * situational model are stored. A workspace should be interfaceable with 18 | * codelets whose job is to operate on the contents of these submodules. 19 | * 20 | * @author Ryan J. McCall 21 | */ 22 | public interface Workspace extends FrameworkModule { 23 | 24 | /** 25 | * Add episodic memory that will listen for cues from the Workspace 26 | * 27 | * @param l 28 | * listener 29 | */ 30 | public void addCueListener(CueListener l); 31 | 32 | /** 33 | * Adds specified {@link WorkspaceListener} 34 | * 35 | * @param l 36 | * listener of this Workspace 37 | */ 38 | public void addWorkspaceListener(WorkspaceListener l); 39 | 40 | /** 41 | * Prompts this Workspace to cue episodic memories with content. 42 | * 43 | * @param ns 44 | * NodeStructure to cue with. 45 | */ 46 | public void cueEpisodicMemories(NodeStructure ns); 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/workspace/WorkspaceContent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.workspace; 9 | 10 | import edu.memphis.ccrg.lida.framework.shared.NodeStructure; 11 | 12 | /** 13 | * WorkspaceContent is a general name for the content of the workspace. 14 | * Currently it is a NodeStructure only. In the future it may include Sensory 15 | * Scene layers 16 | * 17 | * @author Ryan J. McCall 18 | */ 19 | public interface WorkspaceContent extends NodeStructure { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/workspace/WorkspaceListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.workspace; 9 | 10 | import edu.memphis.ccrg.lida.framework.ModuleListener; 11 | import edu.memphis.ccrg.lida.framework.ModuleName; 12 | 13 | /** 14 | * A workspace listener receives content from the workspace. The prime example 15 | * is PAM. 16 | * 17 | * @author Ryan J. McCall 18 | */ 19 | public interface WorkspaceListener extends ModuleListener { 20 | 21 | /** 22 | * Receive NodeStructure content from ModuleType originatingBuffer 23 | * 24 | * @param originatingBuffer 25 | * source of content 26 | * @param content 27 | * sent content 28 | */ 29 | public void receiveWorkspaceContent(ModuleName originatingBuffer, 30 | WorkspaceContent content); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/workspace/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes related to the definition of the Workspace module and its default implementation. 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/workspace/structurebuildingcodelets/StructureBuildingCodelet.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.workspace.structurebuildingcodelets; 9 | 10 | import edu.memphis.ccrg.lida.framework.tasks.Codelet; 11 | 12 | /** 13 | * Demon-like process operating on the workspace searching for particular 14 | * content which, when found, triggers its action producing its result. Has 15 | * workspace buffers it can access. 16 | * 17 | * @author Ryan J. McCall 18 | * 19 | */ 20 | public interface StructureBuildingCodelet extends Codelet { 21 | 22 | /** 23 | * Returns result of codelet's run 24 | * 25 | * @return Current information about the codelet's progress 26 | */ 27 | public Object getCodeletRunResult(); 28 | 29 | /** 30 | * Clears this codelet's fields in preparation for reuse. Idea is that the 31 | * same codelet object is reconfigured at runtime after it finishes to be 32 | * run as a different altogether codelet. 33 | */ 34 | public void reset(); 35 | 36 | } -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/workspace/structurebuildingcodelets/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes related to the definition, default implementation, and management of Structure-Building codelets. 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/workspace/workspacebuffers/BroadcastQueue.java: -------------------------------------------------------------------------------- 1 | package edu.memphis.ccrg.lida.workspace.workspacebuffers; 2 | 3 | import edu.memphis.ccrg.lida.globalworkspace.BroadcastListener; 4 | import edu.memphis.ccrg.lida.workspace.Workspace; 5 | import edu.memphis.ccrg.lida.workspace.WorkspaceContent; 6 | 7 | /** 8 | * A {@link WorkspaceBuffer} storing the recent contents of consciousness. It is 9 | * a submodule of the {@link Workspace}. 10 | * 11 | * @author Ryan J. McCall 12 | * @author Javier Snaider 13 | * 14 | */ 15 | public interface BroadcastQueue extends WorkspaceBuffer, BroadcastListener { 16 | 17 | /** 18 | * Returns content of specified position 19 | * 20 | * @param index 21 | * position in the queue 22 | * @return {@link WorkspaceContent} at index position or null 23 | */ 24 | public WorkspaceContent getPositionContent(int index); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/workspace/workspacebuffers/WorkspaceBuffer.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 The University of Memphis. All rights reserved. 3 | * This program and the accompanying materials are made available 4 | * under the terms of the LIDA Software Framework Non-Commercial License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://ccrg.cs.memphis.edu/assets/papers/2010/LIDA-framework-non-commercial-v1.0.pdf 7 | *******************************************************************************/ 8 | package edu.memphis.ccrg.lida.workspace.workspacebuffers; 9 | 10 | import java.util.Map; 11 | 12 | import edu.memphis.ccrg.lida.framework.FrameworkModule; 13 | import edu.memphis.ccrg.lida.workspace.WorkspaceContent; 14 | import edu.memphis.ccrg.lida.workspace.WorkspaceImpl; 15 | import edu.memphis.ccrg.lida.workspace.structurebuildingcodelets.StructureBuildingCodelet; 16 | 17 | /** 18 | * A submodule of the Workspace. Managed by {@link WorkspaceImpl}. 19 | * {@link StructureBuildingCodelet} read and write from them. 20 | * 21 | * @author Ryan J. McCall 22 | * @author Javier Snaider 23 | */ 24 | public interface WorkspaceBuffer extends FrameworkModule { 25 | 26 | /** 27 | * Gets buffer content based on specified parameters. 28 | * 29 | * @param params 30 | * optional parameters to specify what content is returned 31 | * @return {@link WorkspaceContent} 32 | */ 33 | public WorkspaceContent getBufferContent(Map params); 34 | 35 | /** 36 | * Adds specified content to this workspace buffer. 37 | * 38 | * @param content 39 | * {@link WorkspaceContent} to add 40 | */ 41 | public void addBufferContent(WorkspaceContent content); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/edu/memphis/ccrg/lida/workspace/workspacebuffers/package.html: -------------------------------------------------------------------------------- 1 | 2 | Contains classes related to the definition of of Workspace buffers and their default implementations. 3 | 4 | 5 | -------------------------------------------------------------------------------- /testData/shortagent.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 11 | 12 | 50 13 | 100 14 | edu.memphis.ccrg.lida.framework.tasks.TaskSpawnerImpl 15 | 16 | edu.memphis.ccrg.lida.pam.PerceptualAssociativeMemoryImpl 17 | .7 18 | defaultTS edu.memphis.ccrg.lida.example.framework.initialization.PamInitializer 19 | 20 | 21 | edu.memphis.ccrg.lida.workspace.WorkspaceImpl 22 | 23 | 24 | edu.memphis.ccrg.lida.workspace.workspacebuffers.WorkspaceBufferImpl 0.01 25 | defaultTS 26 | 27 | defaultTS CueBackgroundTask 15 0.4 28 | 29 | 30 | edu.memphis.ccrg.lida.pam.PamListener 31 | PerceptualAssociativeMemory 32 | Workspace 33 | 34 | 35 | --------------------------------------------------------------------------------