Hello Lidefons,
are you asking about the relationship of the feature detectors to the
rest of the LIDA Framework?
in the init() mehod you need to set up your parameters for interacting
with the Framework. those parameters should agreee with the
definitions in the agent.xml file, under the section: <module
name="PerceptualAssociativeMemory">.
then the result of running the feature detector needs to be a node
that can drive an attention codlet defined under the section: <module
name="AttentionModule">.
this drives the action of releasing the button in sensory motor
memory, under the section: <module name="SensoryMotorMemory">.
so, my feature detector looks like:
/
*******************************************************************************
*******************************************************************************/
package myagent.featuredetectors;
import java.util.HashMap;
import java.util.Map;
import edu.memphis.ccrg.lida.pam.tasks.BasicDetectionAlgorithm;
public class NoShapeFeatureDetector extends BasicDetectionAlgorithm {
private int backgroundColor = 0xFFFFFFFF;
private Map<String, Object> smParams = new HashMap<String,
Object>();
@Override
public void init() {
super.init();
smParams.put("mode","all");
backgroundColor = (Integer) getParam("backgroundColor",
0xFFFFFFFF);
}
@Override
public double detect() {
int[] layer = (int[])
sensoryMemory.getSensoryContent("visual",smParams);
for(int i=0;i<layer.length;i++){
if(layer[i]!=backgroundColor){
return 0.0;
}
}
return 1.0;
}
}
and the agent.xml declarations look like:
...
<module name="PerceptualAssociativeMemory">
...
<initialTasks>
...
<task name="EmptyDetector">
<tasktype>NoShapeDetector</tasktype>
<ticksperrun>3</ticksperrun>
<param name="backgroundColor" type="int">-1</
param>
<param name="node" type="string">empty</param>
</task>
</initialTasks>
<initializerclass>edu.memphis.ccrg.lida.pam.BasicPamInitializer</
initializerclass>
</module>
and
<module name="AttentionModule">
<class>edu.memphis.ccrg.lida.attentioncodelets.AttentionCodeletModule</
class>
<associatedmodule>Workspace</associatedmodule>
<associatedmodule>GlobalWorkspace</associatedmodule>
<taskspawner>defaultTS</taskspawner>
<initialTasks>
...
<task name="EmptyCodelet">
<tasktype>BasicAttentionCodelet</tasktype>
<ticksperrun>5</ticksperrun>
<param name="nodes" type="string">empty</param>
<param name="refractoryPeriod" type="int">30</
param>
<param name="initialActivation" type="double">1.0</
param>
</task>
</initialTasks>
</module>
and
<module name="SensoryMotorMemory">
<class>edu.memphis.ccrg.lida.sensorymotormemory.BasicSensoryMotorMemory</
class>
<associatedmodule>Environment</associatedmodule>
<param name="smm.1">action.pressOne,algorithm.press1</
param>
<param name="smm.2">action.pressTwo,algorithm.press2</
param>
<param name="smm.3">action.releasePress,algorithm.releasePress</
param>
<taskspawner>defaultTS</taskspawner>
<initializerclass>edu.memphis.ccrg.lida.sensorymotormemory.BasicSensoryMotorMemoryInitializer</
initializerclass>
</module>
finally, NoShapeDector (feature detector) needs to be identified in
the <tasks> section of FactoryData.xml:
...
<tasks>
...
<task name="NoShapeDetector">
<class>myagent.featuredetectors.NoShapeFeatureDetector</class>
<ticksperrun>5</ticksperrun>
<associatedmodule>SensoryMemory</associatedmodule>
<associatedmodule>PerceptualAssociativeMemory</associatedmodule>
<param name="backgroundColor" type="int">-1</param>
<param name="node" type="string">empty</param>
</task>
...
does this help?
delbert
> > Ildefons- Hide quoted text -
>
> - Show quoted text -