edu.memphis.ccrg.lida.pam
Class PamLinkImpl

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.LinkImpl
              extended by edu.memphis.ccrg.lida.pam.PamLinkImpl
All Implemented Interfaces:
Initializable, Activatible, Learnable, Link, Linkable, PamLink, PamLinkable

public class PamLinkImpl
extends LinkImpl
implements PamLink

Default implementation of PamLink.

Author:
Ryan J. McCall

Field Summary
 
Fields inherited from class edu.memphis.ccrg.lida.framework.shared.LinkImpl
groundingPamLink
 
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
PamLinkImpl()
          Default constructor Only ElementFactory should be creating this Object.
PamLinkImpl(PamLinkImpl pl)
          Deprecated. Use ElementFactory.getLink(String, Node, Linkable, LinkCategory, String, String, double, double) 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 obj)
          This method compares this LinkImpl with any kind of Link.
 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 activation)
          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 updateLinkValues(Link link)
          This default implementation of Link has all of its attributes updated by NodeStructureImpl when links are updated.
 
Methods inherited from class edu.memphis.ccrg.lida.framework.shared.LinkImpl
getCategory, getExtendedId, getFactoryType, getGroundingPamLink, getLabel, getSink, getSource, isSimpleLink, setCategory, setFactoryType, setGroundingPamLink, setSink, setSource, 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.Link
getCategory, getGroundingPamLink, getSink, getSource, isSimpleLink, setCategory, setGroundingPamLink, setSink, setSource
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.shared.Linkable
getExtendedId, getFactoryType, getLabel, setFactoryType
 

Constructor Detail

PamLinkImpl

public PamLinkImpl()
Default constructor Only ElementFactory should be creating this Object.


PamLinkImpl

@Deprecated
public PamLinkImpl(PamLinkImpl pl)
Deprecated. Use ElementFactory.getLink(String, Node, Linkable, LinkCategory, String, String, double, double) instead.

Copy constructor

Parameters:
pl - source PamLinkImpl
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.getLink(String, edu.memphis.ccrg.lida.framework.shared.Node, edu.memphis.ccrg.lida.framework.shared.Linkable, edu.memphis.ccrg.lida.framework.shared.LinkCategory, String, String, double, double)

updateLinkValues

public void updateLinkValues(Link link)
Description copied from class: LinkImpl
This default implementation of Link has all of its attributes updated by NodeStructureImpl when links are updated. Therefore this class does not have to implement this method. Any subclass with specific class members (e.g. PamLinkImpl) should however override this method.

Specified by:
updateLinkValues in interface Link
Overrides:
updateLinkValues in class LinkImpl
Parameters:
link - Link whose values are used to update with.
See Also:
updateLinkValues(Link), NodeStructureImpl.addLink(Link, String), NodeStructureImpl.getNewLink(Link, String, Node, Linkable, LinkCategory)

equals

public boolean equals(java.lang.Object obj)
Description copied from class: LinkImpl
This method compares this LinkImpl with any kind of Link. Two Links are equal if and only if they have the same id.

Overrides:
equals in class LinkImpl

hashCode

public int hashCode()
Overrides:
hashCode in class LinkImpl

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 activation)
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:
activation - 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.