edu.memphis.ccrg.lida.framework.shared
Class NodeImpl

java.lang.Object
  extended by edu.memphis.ccrg.lida.framework.shared.activation.ActivatibleImpl
      extended by edu.memphis.ccrg.lida.framework.shared.NodeImpl
All Implemented Interfaces:
Initializable, Activatible, Linkable, Node, java.io.Serializable
Direct Known Subclasses:
PamNodeImpl

public class NodeImpl
extends ActivatibleImpl
implements Node

Default Node Implementation

Author:
Javier Snaider
See Also:
Serialized Form

Field Summary
protected  PamNode groundingPamNode
          PamNode in PerceptualAssociativeMemory which grounds this Node
 
Fields inherited from interface edu.memphis.ccrg.lida.framework.shared.activation.Activatible
DEFAULT_ACTIVATIBLE_REMOVAL_THRESHOLD, DEFAULT_ACTIVATION
 
Constructor Summary
NodeImpl()
          Default constructor
NodeImpl(NodeImpl n)
          Copy constructor
 
Method Summary
 boolean equals(java.lang.Object o)
          This method compares this object with any kind of Node.
 double getDesirability()
          Returns desirability of this node.
 ExtendedId getExtendedId()
          Gets extendedId.
 PamNode getGroundingPamNode()
          Returns the grounding PamNode.
 int getId()
          Returns Node's id
 java.lang.String getLabel()
          Gets label.
 java.lang.Object getParam(java.lang.String name, java.lang.Object defaultValue)
          A convenience method to read parameters from the Map of properties set with the init() method.
 int hashCode()
           
 void init()
          This is a convenience method to initialize this Object.
 void init(java.util.Map<java.lang.String,?> params)
          This method initializes the module with parameters specified in agent.xml
 void setDesirability(double d)
          Set node desirability.
 void setExtendedId(ExtendedId eid)
          Convenience method to set Node's ExtendedId.
 void setGroundingPamNode(PamNode n)
          Used by factory to set the underlying PamNode for this node
 void setId(int id)
          Sets Node's id
 void setLabel(java.lang.String label)
          Sets label
 java.lang.String toString()
           
 void updateNodeValues(Node n)
          Updates the values of this NodeImpl based on the passed in Node.
 
Methods inherited from class edu.memphis.ccrg.lida.framework.shared.activation.ActivatibleImpl
decay, excite, getActivatibleRemovalThreshold, getActivation, getDecayStrategy, getExciteStrategy, getTotalActivation, isRemovable, setActivatibleRemovalThreshold, setActivation, setDecayStrategy, setExciteStrategy
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.shared.activation.Activatible
decay, excite, getActivatibleRemovalThreshold, getActivation, getDecayStrategy, getExciteStrategy, getTotalActivation, isRemovable, setActivatibleRemovalThreshold, setActivation, setDecayStrategy, setExciteStrategy
 

Field Detail

groundingPamNode

protected PamNode groundingPamNode
PamNode in PerceptualAssociativeMemory which grounds this Node

Constructor Detail

NodeImpl

public NodeImpl()
Default constructor


NodeImpl

public NodeImpl(NodeImpl n)
Copy constructor

Parameters:
n - source NodeImpl
Method Detail

getExtendedId

public ExtendedId getExtendedId()
Description copied from interface: Linkable
Gets extendedId.

Specified by:
getExtendedId in interface Linkable
Returns:
a general id for Linkables.

getId

public int getId()
Description copied from interface: Node
Returns Node's id

Specified by:
getId in interface Node
Returns:
unique id

setId

public void setId(int id)
Description copied from interface: Node
Sets Node's id

Specified by:
setId in interface Node
Parameters:
id - unique id

setExtendedId

public void setExtendedId(ExtendedId eid)
Convenience method to set Node's ExtendedId. Also sets node's id.

Parameters:
eid - ExtendedId

getLabel

public java.lang.String getLabel()
Description copied from interface: Linkable
Gets label.

Specified by:
getLabel in interface Linkable
Specified by:
getLabel in interface Node
Returns:
readable label

setLabel

public void setLabel(java.lang.String label)
Description copied from interface: Node
Sets label

Specified by:
setLabel in interface Node
Parameters:
label - readable label

getGroundingPamNode

public PamNode getGroundingPamNode()
Description copied from interface: Node
Returns the grounding PamNode.

Specified by:
getGroundingPamNode in interface Node
Returns:
PamNode, in PAM, underlying this node.

setGroundingPamNode

public void setGroundingPamNode(PamNode n)
Description copied from interface: Node
Used by factory to set the underlying PamNode for this node

Specified by:
setGroundingPamNode in interface Node
Parameters:
n - PamNode

equals

public boolean equals(java.lang.Object o)
This method compares this object with any kind of Node. returns true if the id of both are the same.

Overrides:
equals in class java.lang.Object
Parameters:
o - Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getDesirability

public double getDesirability()
Description copied from interface: Node
Returns desirability of this node.

Specified by:
getDesirability in interface Node
Returns:
a double signifying the degree to which this node is a goal of the agent

setDesirability

public void setDesirability(double d)
Description copied from interface: Node
Set node desirability.

Specified by:
setDesirability in interface Node
Parameters:
d - degree to which this node is a goal of the agent

init

public void init(java.util.Map<java.lang.String,?> params)
Description copied from interface: Initializable
This method initializes the module with parameters specified in agent.xml

Specified by:
init in interface Initializable
Parameters:
params - Map of parameters indexed by String names

init

public void init()
Description copied from interface: Initializable
This is a convenience method to initialize this Object. It is called from init(Map parameters). Subclasses can overwrite this method in order to initialize this Object. But make sure to call super.init(); at the beginning of the implementation of this method.

Specified by:
init in interface Initializable

getParam

public java.lang.Object getParam(java.lang.String name,
                                 java.lang.Object defaultValue)
Description copied from interface: Initializable
A convenience method to read parameters from the Map of properties set with the init() method.

Specified by:
getParam in interface Initializable
Parameters:
name - the parameter name
defaultValue - the default value to be returned if the parameter doesn't exist.
Returns:
the value of the parameter or the default value.

updateNodeValues

public void updateNodeValues(Node n)
Updates the values of this NodeImpl based on the passed in Node. Node must be a NodeImpl. Does not copy superclass attributes, e.g. ActivatibleImpl, only those of this class.

Specified by:
updateNodeValues in interface Node
Parameters:
n - Node whose values are used to update with.