edu.memphis.ccrg.lida.pam
Class PamNodeImpl

java.lang.Object
  extended by edu.memphis.ccrg.lida.framework.initialization.InitializableImpl
      extended by edu.memphis.ccrg.lida.framework.shared.activation.ActivatibleImpl
          extended by edu.memphis.ccrg.lida.framework.shared.NodeImpl
              extended by edu.memphis.ccrg.lida.pam.PamNodeImpl
All Implemented Interfaces:
Initializable, Activatible, Learnable, Linkable, LinkCategory, Node, PamLinkable, PamNode, Condition

public class PamNodeImpl
extends NodeImpl
implements PamNode

Default implementation of PamNode. A Learnable Node that overrides hashCode and equals. Has a private LearnableImpl to help implement all Learnable methods.

Author:
Ryan J. McCall

Field Summary
 
Fields inherited from class edu.memphis.ccrg.lida.framework.shared.NodeImpl
groundingPamNode
 
Fields inherited from interface edu.memphis.ccrg.lida.framework.shared.activation.Learnable
DEFAULT_BASE_LEVEL_ACTIVATION, DEFAULT_LEARNABLE_REMOVAL_THRESHOLD
 
Fields inherited from interface edu.memphis.ccrg.lida.framework.shared.activation.Activatible
DEFAULT_ACTIVATIBLE_REMOVAL_THRESHOLD, DEFAULT_ACTIVATION
 
Constructor Summary
PamNodeImpl()
          Default constructor
PamNodeImpl(PamNodeImpl pn)
          Deprecated. Use ElementFactory.getNode(Node, String) or similar method in ElementFactory instead.
 
Method Summary
 void decay(long ticks)
          decay the current activation using the decay strategy.
 void decayBaseLevelActivation(long ticks)
          decay the Base Level activation using the decay strategy.
 boolean equals(java.lang.Object o)
          This method compares this object with any kind of Node.
 void excite(double amount)
          The current activation of this node is increased using the excitation value as a parameter for the ExciteStrategy
 double getActivatibleRemovalThreshold()
          Gets activatibleRemovalThreshold
 double getActivation()
          Returns the current activation of this activatible
 double getBaseLevelActivation()
          Returns base level activation.
 DecayStrategy getBaseLevelDecayStrategy()
          Gets decay strategy for the Base Level activation
 ExciteStrategy getBaseLevelExciteStrategy()
          Gets BaseLevelExciteStrategy
 DecayStrategy getDecayStrategy()
          Gets the decay strategy
 ExciteStrategy getExciteStrategy()
          Gets the excite strategy
 double getLearnableRemovalThreshold()
          Gets learnableRemovalThreshold
 double getTotalActivation()
          Returns the total activation of this activatible
 TotalActivationStrategy getTotalActivationStrategy()
          Returns TotalActivationStrategy
 int hashCode()
           
 void init()
          Must call the init() of the internal Learnable.
 boolean isRemovable()
          Returns true if this Activatible is removable
 void reinforceBaseLevelActivation(double amount)
          The Base Level activation of this node is increased using the excitation value as a parameter for the ExciteStrategy.
 void setActivatibleRemovalThreshold(double threshold)
          Sets activatibleRemovalThreshold
 void setActivation(double a)
          Set the current activation.
 void setBaseLevelActivation(double amount)
          Set base level activation.
 void setBaseLevelDecayStrategy(DecayStrategy strategy)
          Sets decay strategy for the Base Level activation
 void setBaseLevelExciteStrategy(ExciteStrategy strategy)
          Sets BaseLevelExciteStrategy
 void setBaseLevelRemovalThreshold(double threshold)
          Sets learnableRemovalThreshold
 void setDecayStrategy(DecayStrategy strategy)
          Sets the decay strategy
 void setExciteStrategy(ExciteStrategy strategy)
          Sets the excite strategy
 void setTotalActivationStrategy(TotalActivationStrategy strategy)
          Sets TotalActivationStrategy
 void updateNodeValues(Node n)
          This default implementation of Node has all of its attributes updated by NodeStructureImpl or ElementFactory when nodes are updated.
 
Methods inherited from class edu.memphis.ccrg.lida.framework.shared.NodeImpl
getConditionId, getExtendedId, getFactoryType, getGroundingPamNode, getId, getLabel, setExtendedId, setFactoryType, setGroundingPamNode, setId, setLabel, toString
 
Methods inherited from class edu.memphis.ccrg.lida.framework.initialization.InitializableImpl
containsParameter, getParam, getParameters, init
 
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.Node
getGroundingPamNode, getId, getLabel, setGroundingPamNode, setId, setLabel
 
Methods inherited from interface edu.memphis.ccrg.lida.proceduralmemory.Condition
getConditionId
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.shared.Linkable
getExtendedId, getFactoryType, setFactoryType
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.shared.LinkCategory
getId, getLabel
 

Constructor Detail

PamNodeImpl

public PamNodeImpl()
Default constructor


PamNodeImpl

@Deprecated
public PamNodeImpl(PamNodeImpl pn)
Deprecated. Use ElementFactory.getNode(Node, String) or similar method in ElementFactory instead.

Copy constructor

Parameters:
pn - source PamNodeImpl
Method Detail

init

public void init()
Must call the init() of the internal Learnable.

Specified by:
init in interface Initializable
Overrides:
init in class InitializableImpl
See Also:
LearnableImpl.init(), ElementFactory.getNode(String, String, String, String, double, double)

updateNodeValues

public void updateNodeValues(Node n)
Description copied from class: NodeImpl
This default implementation of Node has all of its attributes updated by NodeStructureImpl or ElementFactory when nodes are updated. Therefore this class does not have to implement this method. Any subclass with specific class members (e.g. PamNodeImpl) should however override this method.

Specified by:
updateNodeValues in interface Node
Overrides:
updateNodeValues in class NodeImpl
Parameters:
n - Node whose values are used to update with.
See Also:
updateNodeValues(Node), NodeStructureImpl.addNode(Node, String)

equals

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

Overrides:
equals in class NodeImpl
Parameters:
o - Object

hashCode

public int hashCode()
Overrides:
hashCode in class NodeImpl

getActivation

public double getActivation()
Description copied from interface: Activatible
Returns the current activation of this activatible

Specified by:
getActivation in interface Activatible
Overrides:
getActivation in class ActivatibleImpl
Returns:
the current activation.

setActivation

public void setActivation(double a)
Description copied from interface: Activatible
Set the current activation. Used for initialization, not during regular execution, use excite instead.

Specified by:
setActivation in interface Activatible
Overrides:
setActivation in class ActivatibleImpl
Parameters:
a - new activation

getTotalActivation

public double getTotalActivation()
Description copied from interface: Activatible
Returns the total activation of this activatible

Specified by:
getTotalActivation in interface Activatible
Overrides:
getTotalActivation in class ActivatibleImpl
Returns:
The total activation. It should return the current activation if no base activation is used.

excite

public void excite(double amount)
Description copied from interface: Activatible
The current activation of this node is increased using the excitation value as a parameter for the ExciteStrategy

Specified by:
excite in interface Activatible
Overrides:
excite in class ActivatibleImpl
Parameters:
amount - the value to be used to increase the current activation of this node

setExciteStrategy

public void setExciteStrategy(ExciteStrategy strategy)
Description copied from interface: Activatible
Sets the excite strategy

Specified by:
setExciteStrategy in interface Activatible
Overrides:
setExciteStrategy in class ActivatibleImpl
Parameters:
strategy - the Excite strategy for the current activation.

getExciteStrategy

public ExciteStrategy getExciteStrategy()
Description copied from interface: Activatible
Gets the excite strategy

Specified by:
getExciteStrategy in interface Activatible
Overrides:
getExciteStrategy in class ActivatibleImpl
Returns:
the excite strategy

decay

public void decay(long ticks)
Description copied from interface: Activatible
decay the current activation using the decay strategy. The decay depends on the time since the last decaying. It is indicated by the parameter ticks.

Specified by:
decay in interface Activatible
Overrides:
decay in class ActivatibleImpl
Parameters:
ticks - the number of ticks to decay

setDecayStrategy

public void setDecayStrategy(DecayStrategy strategy)
Description copied from interface: Activatible
Sets the decay strategy

Specified by:
setDecayStrategy in interface Activatible
Overrides:
setDecayStrategy in class ActivatibleImpl
Parameters:
strategy - the decay strategy for the current activation.

getDecayStrategy

public DecayStrategy getDecayStrategy()
Description copied from interface: Activatible
Gets the decay strategy

Specified by:
getDecayStrategy in interface Activatible
Overrides:
getDecayStrategy in class ActivatibleImpl
Returns:
the decay strategy.

setActivatibleRemovalThreshold

public void setActivatibleRemovalThreshold(double threshold)
Description copied from interface: Activatible
Sets activatibleRemovalThreshold

Specified by:
setActivatibleRemovalThreshold in interface Activatible
Overrides:
setActivatibleRemovalThreshold in class ActivatibleImpl
Parameters:
threshold - threshold for removal of this activatible

getActivatibleRemovalThreshold

public double getActivatibleRemovalThreshold()
Description copied from interface: Activatible
Gets activatibleRemovalThreshold

Specified by:
getActivatibleRemovalThreshold in interface Activatible
Overrides:
getActivatibleRemovalThreshold in class ActivatibleImpl
Returns:
threshold for removal of this activatible

isRemovable

public boolean isRemovable()
Description copied from interface: Activatible
Returns true if this Activatible is removable

Specified by:
isRemovable in interface Activatible
Overrides:
isRemovable in class ActivatibleImpl
Returns:
true if activation is less than activatibleRemovalThreshold

getBaseLevelActivation

public double getBaseLevelActivation()
Description copied from interface: Learnable
Returns base level activation.

Specified by:
getBaseLevelActivation in interface Learnable
Returns:
activation representing the degree this Learnable has been learned.

setBaseLevelActivation

public void setBaseLevelActivation(double amount)
Description copied from interface: Learnable
Set base level activation. Used for initialization, not during regular execution, use Learnable.reinforceBaseLevelActivation(double) instead.

Specified by:
setBaseLevelActivation in interface Learnable
Parameters:
amount - new base level activation amount

reinforceBaseLevelActivation

public void reinforceBaseLevelActivation(double amount)
Description copied from interface: Learnable
The Base Level activation of this node is increased using the excitation value as a parameter for the ExciteStrategy. This is primarily used for learning.

Specified by:
reinforceBaseLevelActivation in interface Learnable
Parameters:
amount - the value to be used to increase the Base Level activation of this node

setBaseLevelExciteStrategy

public void setBaseLevelExciteStrategy(ExciteStrategy strategy)
Description copied from interface: Learnable
Sets BaseLevelExciteStrategy

Specified by:
setBaseLevelExciteStrategy in interface Learnable
Parameters:
strategy - the Excite strategy for the current activation.

getBaseLevelExciteStrategy

public ExciteStrategy getBaseLevelExciteStrategy()
Description copied from interface: Learnable
Gets BaseLevelExciteStrategy

Specified by:
getBaseLevelExciteStrategy in interface Learnable
Returns:
the excite strategy

decayBaseLevelActivation

public void decayBaseLevelActivation(long ticks)
Description copied from interface: Learnable
decay the Base Level activation using the decay strategy. The decay depends on the time since the last decaying. It is indicated by the parameter ticks.

Specified by:
decayBaseLevelActivation in interface Learnable
Parameters:
ticks - the number of ticks to decay

setBaseLevelDecayStrategy

public void setBaseLevelDecayStrategy(DecayStrategy strategy)
Description copied from interface: Learnable
Sets decay strategy for the Base Level activation

Specified by:
setBaseLevelDecayStrategy in interface Learnable
Parameters:
strategy - the decay strategy for the Base Level activation.

getBaseLevelDecayStrategy

public DecayStrategy getBaseLevelDecayStrategy()
Description copied from interface: Learnable
Gets decay strategy for the Base Level activation

Specified by:
getBaseLevelDecayStrategy in interface Learnable
Returns:
the decay strategy for the Base Level activation.

setBaseLevelRemovalThreshold

public void setBaseLevelRemovalThreshold(double threshold)
Description copied from interface: Learnable
Sets learnableRemovalThreshold

Specified by:
setBaseLevelRemovalThreshold in interface Learnable
Parameters:
threshold - threshold for removal of this Learnable

getLearnableRemovalThreshold

public double getLearnableRemovalThreshold()
Description copied from interface: Learnable
Gets learnableRemovalThreshold

Specified by:
getLearnableRemovalThreshold in interface Learnable
Returns:
threshold for removal of this learnable

getTotalActivationStrategy

public TotalActivationStrategy getTotalActivationStrategy()
Description copied from interface: Learnable
Returns TotalActivationStrategy

Specified by:
getTotalActivationStrategy in interface Learnable
Returns:
Strategy this Learnable uses to calculate total activation.

setTotalActivationStrategy

public void setTotalActivationStrategy(TotalActivationStrategy strategy)
Description copied from interface: Learnable
Sets TotalActivationStrategy

Specified by:
setTotalActivationStrategy in interface Learnable
Parameters:
strategy - Strategy this Learnable uses to calculate total activation.