|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.memphis.ccrg.lida.framework.initialization.InitializableImpl
edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
edu.memphis.ccrg.lida.pam.PerceptualAssociativeMemoryImpl
public class PerceptualAssociativeMemoryImpl
Default implementation of PerceptualAssociativeMemory. Module
essentially concerned with PamNode and PamLinks, source of meaning in LIDA,
how they are activated and how they pass activation among themselves.
| Nested Class Summary | |
|---|---|
protected static class |
PerceptualAssociativeMemoryImpl.PamNodeStructure
Internal implementation of NodeStructureImpl. |
| Field Summary | |
|---|---|
static LinkCategory |
FEATURE
Primitive LinkCategory FEATURE |
static LinkCategory |
LATERAL
Primitive LinkCategory LATERAL |
protected java.util.Map<java.lang.String,PamNode> |
nodesByLabel
All PamNode objects currently in PerceptualAssociativeMemoryImpl indexed by their label. |
static LinkCategory |
NONE
Primitive LinkCategory NONE |
protected PerceptualAssociativeMemoryImpl.PamNodeStructure |
pamNodeStructure
A PerceptualAssociativeMemoryImpl.PamNodeStructure which contains all of the PamNode,
PamLink and their connections. |
static LinkCategory |
PARENT
Primitive LinkCategory PARENT |
| Fields inherited from class edu.memphis.ccrg.lida.framework.FrameworkModuleImpl |
|---|
taskSpawner |
| Constructor Summary | |
|---|---|
PerceptualAssociativeMemoryImpl()
Default constructor. |
|
| Method Summary | |
|---|---|
PamLink |
addDefaultLink(Link link)
Deprecated. |
PamLink |
addDefaultLink(Node src,
Linkable snk,
LinkCategory cat)
Adds a new PamLink of default type to PAM. |
java.util.Set<PamLink> |
addDefaultLinks(java.util.Set<? extends Link> links)
Deprecated. |
PamNode |
addDefaultNode(Node n)
Deprecated. |
PamNode |
addDefaultNode(java.lang.String label)
Adds a new PamNode of default type to PAM with specified label. |
java.util.Set<PamNode> |
addDefaultNodes(java.util.Set<? extends Node> nodes)
Deprecated. |
void |
addDetectionAlgorithm(DetectionAlgorithm detector)
Adds specified DetectionAlgorithm to be run. |
PamLink |
addLink(java.lang.String type,
Node src,
Linkable snk,
LinkCategory cat)
Adds a new PamLink of specified type to PAM. |
LinkCategory |
addLinkCategory(LinkCategory cat)
Adds a COPY of specified LinkCategory to this PerceptualAssociativeMemory. |
void |
addListener(ModuleListener l)
Override this method to add a listener to the module |
PamNode |
addNode(java.lang.String type,
java.lang.String label)
Adds a new PamNode of specified type to PAM with specified label. |
void |
addPamListener(PamListener pl)
Adds PamListener. |
void |
addToPercept(Link l)
Adds Link to the percept. |
void |
addToPercept(Node n)
Adds Node to the percept. |
void |
addToPercept(NodeStructure ns)
Adds a NodeStructure to the percept. |
boolean |
containsLink(ExtendedId id)
Contains link. |
boolean |
containsLink(Link l)
Returns true if this PAM contains specified PamLink. |
boolean |
containsNode(ExtendedId id)
Contains node. |
boolean |
containsNode(Node node)
Returns true if this PAM contains specified PamNode. |
void |
decayModule(long ticks)
Decay only this Module. |
double |
getDownscaleFactor()
Gets downscaleFactor |
int |
getExcitationTaskTicksPerRun()
|
Link |
getLink(ExtendedId eid)
|
java.util.Collection<LinkCategory> |
getLinkCategories()
Returns all categories in this Pam |
LinkCategory |
getLinkCategory(int id)
Returns LinkCategory with specified id. |
java.util.Collection<Link> |
getLinks()
Returns an unmodifiable collection of the PamLinks in this PAM as Links. |
java.lang.Object |
getModuleContent(java.lang.Object... params)
Intended to be called from the GUI. |
Node |
getNode(ExtendedId eid)
Returns the PamNode with specified ExtendedId or null |
Node |
getNode(int id)
Returns the PamNode with specified id from this PAM or null. |
Node |
getNode(java.lang.String label)
Returns the PamNode with specified label or null. |
java.util.Collection<Node> |
getNodes()
Returns an unmodifiable collection of the PamNodes in this PAM as Nodes. |
static double |
getPerceptThreshold()
Returns the perceptThreshold |
PropagationStrategy |
getPropagationStrategy()
Gets PropagationStrategy governing how activation is propagated in this PAM. |
int |
getPropagationTaskTicksPerRun()
|
double |
getUpscaleFactor()
Gets upscaleFactor |
void |
init()
Will set parameters with the following names: pam.upscale the scaling on the amount of activation passed upwards from Nodes of lower conceptual depth to those of higher depth pam.downscale the scaling on the amount of activation passed downwards from Nodes of higher conceptual depth to those of lower depth pam.perceptThreshold the amount of activation a Node or Link must have to be part of the percept (be sent to the Workspace) pam.excitationTicksPerRun the delay (in ticks) on the excitation of Nodes and Links after they receive some activation, default is 1 tick pam.propagationTicksPerRun the delay (in ticks) on the propagation of activation from a Node or Link, default is 1 tick pam.propagateActivationThreshold the amount of activation necessary to be propagated i.e. |
boolean |
isOverPerceptThreshold(PamLinkable l)
Returns whether PamLinkable is above percept threshold. |
void |
learn(Coalition coalition)
A place-holder method to remind implementing classes that they should implement learning. |
void |
propagateActivationToParents(PamNode pn)
Propagates activation from a PamNode to its parents. |
void |
receiveBroadcast(Coalition coalition)
Listener must receive a broadcast of a the winning Coalition
This method should return as possible in order to not delay the rest of the broadcasting. |
void |
receiveExcitation(PamLinkable pl,
double amount)
Excites specified PamLinkable an amount of activation. |
void |
receiveExcitation(java.util.Set<PamLinkable> linkables,
double amount)
Excites PamLinkable with an amount of activation. |
void |
receivePreafference(NodeStructure addList,
NodeStructure deleteList)
Listener receives preafference. |
void |
receiveWorkspaceContent(ModuleName originatingBuffer,
WorkspaceContent content)
Receive NodeStructure content from ModuleType originatingBuffer |
void |
setDownscaleFactor(double f)
Sets downscaleFactor |
void |
setPerceptThreshold(double t)
Sets perceptThreshold |
void |
setPropagationStrategy(PropagationStrategy b)
Sets PropagationStrategy governing how activation is propagated in this PAM. |
void |
setUpscaleFactor(double f)
Sets upscaleFactor |
| Methods inherited from class edu.memphis.ccrg.lida.framework.FrameworkModuleImpl |
|---|
addSubModule, containsSubmodule, containsSubmodule, getAssistingTaskSpawner, getModuleName, getSubmodule, getSubmodule, getSubmodules, setAssistingTaskSpawner, setAssociatedModule, setModuleName, taskManagerDecayModule, toString |
| Methods inherited from class edu.memphis.ccrg.lida.framework.initialization.InitializableImpl |
|---|
containsParameter, getParam, getParameters, init |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.memphis.ccrg.lida.framework.FrameworkModule |
|---|
addSubModule, containsSubmodule, containsSubmodule, getAssistingTaskSpawner, getModuleName, getSubmodule, getSubmodule, getSubmodules, setAssistingTaskSpawner, setModuleName, taskManagerDecayModule |
| Methods inherited from interface edu.memphis.ccrg.lida.framework.initialization.FullyInitializable |
|---|
setAssociatedModule |
| Methods inherited from interface edu.memphis.ccrg.lida.framework.initialization.Initializable |
|---|
containsParameter, getParam, getParameters, init |
| Field Detail |
|---|
protected PerceptualAssociativeMemoryImpl.PamNodeStructure pamNodeStructure
PerceptualAssociativeMemoryImpl.PamNodeStructure which contains all of the PamNode,
PamLink and their connections.
protected java.util.Map<java.lang.String,PamNode> nodesByLabel
PamNode objects currently in PerceptualAssociativeMemoryImpl indexed by their label.
public static LinkCategory NONE
LinkCategory NONE
public static LinkCategory LATERAL
LinkCategory LATERAL
public static LinkCategory PARENT
LinkCategory PARENT
public static LinkCategory FEATURE
LinkCategory FEATURE
| Constructor Detail |
|---|
public PerceptualAssociativeMemoryImpl()
| Method Detail |
|---|
public void init()
init in interface Initializableinit in class InitializableImplInitializablepublic void setPropagationStrategy(PropagationStrategy b)
PerceptualAssociativeMemoryPropagationStrategy governing how activation is propagated in this PAM.
setPropagationStrategy in interface PerceptualAssociativeMemoryb - PropagationStrategypublic PropagationStrategy getPropagationStrategy()
PerceptualAssociativeMemoryPropagationStrategy governing how activation is propagated in this PAM.
getPropagationStrategy in interface PerceptualAssociativeMemoryPropagationStrategypublic int getExcitationTaskTicksPerRun()
public int getPropagationTaskTicksPerRun()
@Deprecated public java.util.Set<PamNode> addDefaultNodes(java.util.Set<? extends Node> nodes)
PerceptualAssociativeMemory
addDefaultNodes in interface PerceptualAssociativeMemorynodes - nodes to add
@Deprecated public PamNode addDefaultNode(Node n)
PerceptualAssociativeMemoryPerceptualAssociativeMemory.
Node will be of Pam's default type.
addDefaultNode in interface PerceptualAssociativeMemoryn - PamNode
@Deprecated public java.util.Set<PamLink> addDefaultLinks(java.util.Set<? extends Link> links)
PerceptualAssociativeMemory
addDefaultLinks in interface PerceptualAssociativeMemorylinks - PamLinks to add
@Deprecated public PamLink addDefaultLink(Link link)
PerceptualAssociativeMemory
addDefaultLink in interface PerceptualAssociativeMemorylink - PamLink to add
public PamNode addDefaultNode(java.lang.String label)
PerceptualAssociativeMemoryPamNode of default type to PAM with specified label.
Label must be unique. If not, existing node with specified label is returned.
addDefaultNode in interface PerceptualAssociativeMemorylabel - the label of the new PamNode
PamNode added to PAM, the existing Node with specified label or null
public PamNode addNode(java.lang.String type,
java.lang.String label)
PerceptualAssociativeMemoryPamNode of specified type to PAM with specified label. Type should refer to a subclass of PamNodeImpl.
Label must be unique. If not, existing node with specified label is returned.
addNode in interface PerceptualAssociativeMemorytype - the type of the new PamNodelabel - the label of the new PamNode
PamNode added to PAM, the existing Node with specified label or null
public PamLink addDefaultLink(Node src,
Linkable snk,
LinkCategory cat)
PerceptualAssociativeMemoryPamLink of default type to PAM. If a link with the same attributes already exists
the existing link will be returned instead.
addDefaultLink in interface PerceptualAssociativeMemorysrc - the link's sourcesnk - the link's sinkcat - the link's category
public PamLink addLink(java.lang.String type,
Node src,
Linkable snk,
LinkCategory cat)
PerceptualAssociativeMemoryPamLink of specified type to PAM. Type should refer to a subclass of PamLinkImpl.
If a link with the same attributes already exists the existing link will be returned instead.
addLink in interface PerceptualAssociativeMemorytype - link's typesrc - the link's sourcesnk - the link's sinkcat - the link's category
public void addDetectionAlgorithm(DetectionAlgorithm detector)
PerceptualAssociativeMemoryDetectionAlgorithm to be run.
addDetectionAlgorithm in interface PerceptualAssociativeMemorydetector - DetectionAlgorithmpublic void addPamListener(PamListener pl)
PerceptualAssociativeMemoryPamListener.
addPamListener in interface PerceptualAssociativeMemorypl - listenerpublic void receiveBroadcast(Coalition coalition)
BroadcastListenerCoalition
This method should return as possible in order to not delay the rest of the broadcasting.
receiveBroadcast in interface BroadcastListenercoalition - the Coalition that won the most recent competition for consciousness
public void receiveWorkspaceContent(ModuleName originatingBuffer,
WorkspaceContent content)
WorkspaceListener
receiveWorkspaceContent in interface WorkspaceListeneroriginatingBuffer - source of contentcontent - sent content
public void receivePreafference(NodeStructure addList,
NodeStructure deleteList)
PreafferenceListener
receivePreafference in interface PreafferenceListeneraddList - expected additions in future perceptsdeleteList - expected deletions in future perceptspublic void learn(Coalition coalition)
BroadcastListenerGlobalWorkspace
and thus it should be managed by the receiving module.
learn in interface BroadcastListenercoalition - the Coalition that won the most recent competition for consciousnesspublic void decayModule(long ticks)
FrameworkModule
decayModule in interface FrameworkModuleticks - number of ticks to decay.
public void receiveExcitation(PamLinkable pl,
double amount)
PerceptualAssociativeMemoryPamLinkable an amount of activation.
receiveExcitation in interface PerceptualAssociativeMemorypl - Id of the PamLinkable receiving the activationamount - amount of activation to excite{@link BasicDetectionAlgorithm}
public void receiveExcitation(java.util.Set<PamLinkable> linkables,
double amount)
PerceptualAssociativeMemoryPamLinkable with an amount of activation.
receiveExcitation in interface PerceptualAssociativeMemorylinkables - Ids of PamLinkable to be excitedamount - amount of activationpublic void propagateActivationToParents(PamNode pn)
PerceptualAssociativeMemoryPamNode to its parents.
propagateActivationToParents in interface PerceptualAssociativeMemorypn - The PamNode to propagate activation from.ExcitationTask,
PropagationTaskpublic void addToPercept(NodeStructure ns)
PerceptualAssociativeMemory
addToPercept in interface PerceptualAssociativeMemoryns - NodeStructurepublic void addToPercept(Link l)
PerceptualAssociativeMemoryLink to the percept.
addToPercept in interface PerceptualAssociativeMemoryl - Link to addpublic void addToPercept(Node n)
PerceptualAssociativeMemoryNode to the percept.
addToPercept in interface PerceptualAssociativeMemoryn - Node to addpublic boolean containsNode(Node node)
PerceptualAssociativeMemory
containsNode in interface PerceptualAssociativeMemorynode - the node
public boolean containsNode(ExtendedId id)
PerceptualAssociativeMemory
containsNode in interface PerceptualAssociativeMemoryid - ExtendedId of sought node
public boolean containsLink(Link l)
PerceptualAssociativeMemory
containsLink in interface PerceptualAssociativeMemoryl - the link
public boolean containsLink(ExtendedId id)
PerceptualAssociativeMemory
containsLink in interface PerceptualAssociativeMemoryid - ExtendedId of sought link
public java.util.Collection<Node> getNodes()
PerceptualAssociativeMemoryPamNodes in this PAM as Nodes.
getNodes in interface PerceptualAssociativeMemorypublic java.util.Collection<Link> getLinks()
PerceptualAssociativeMemoryPamLinks in this PAM as Links.
getLinks in interface PerceptualAssociativeMemorypublic java.lang.Object getModuleContent(java.lang.Object... params)
FrameworkModuleImpl
getModuleContent in interface FrameworkModulegetModuleContent in class FrameworkModuleImplparams - parameters specifying what content will be returned
public void addListener(ModuleListener l)
FrameworkModuleImpl
addListener in interface FrameworkModuleaddListener in class FrameworkModuleImpll - - listener of this FrameworkModulepublic static double getPerceptThreshold()
PamLinkable to be instantiated into a
perceptpublic void setPerceptThreshold(double t)
PerceptualAssociativeMemory
setPerceptThreshold in interface PerceptualAssociativeMemoryt - threshold for a Linkable to become part of the perceptpublic boolean isOverPerceptThreshold(PamLinkable l)
PerceptualAssociativeMemory
isOverPerceptThreshold in interface PerceptualAssociativeMemoryl - a PamLinkable
public double getUpscaleFactor()
PerceptualAssociativeMemory
getUpscaleFactor in interface PerceptualAssociativeMemorypublic void setUpscaleFactor(double f)
PerceptualAssociativeMemory
setUpscaleFactor in interface PerceptualAssociativeMemoryf - scale factor for feed-forward activation propagationpublic double getDownscaleFactor()
PerceptualAssociativeMemory
getDownscaleFactor in interface PerceptualAssociativeMemorypublic void setDownscaleFactor(double f)
PerceptualAssociativeMemory
setDownscaleFactor in interface PerceptualAssociativeMemoryf - scale factor for top-down activation propagationpublic Link getLink(ExtendedId eid)
getLink in interface PerceptualAssociativeMemoryeid - link's eid
PamLink with specified id from this PAM or null.public Node getNode(ExtendedId eid)
PerceptualAssociativeMemoryPamNode with specified ExtendedId or null
getNode in interface PerceptualAssociativeMemoryeid - sought ExtendedId
public Node getNode(int id)
PerceptualAssociativeMemoryPamNode with specified id from this PAM or null.
getNode in interface PerceptualAssociativeMemoryid - the id
public java.util.Collection<LinkCategory> getLinkCategories()
PerceptualAssociativeMemory
getLinkCategories in interface PerceptualAssociativeMemoryLinkCategorypublic LinkCategory getLinkCategory(int id)
PerceptualAssociativeMemory
getLinkCategory in interface PerceptualAssociativeMemoryid - id of LinkCategory sought
public LinkCategory addLinkCategory(LinkCategory cat)
PerceptualAssociativeMemoryPerceptualAssociativeMemory.
Category must also be a node in order to be added. Node will be of Pam's default type.
addLinkCategory in interface PerceptualAssociativeMemorycat - LinkCategory
public Node getNode(java.lang.String label)
PerceptualAssociativeMemoryPamNode with specified label or null.
This method is intended to be used only during initialization.
getNode in interface PerceptualAssociativeMemorylabel - sought
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||