edu.memphis.ccrg.lida.framework.shared.activation
Class LearnableImpl

java.lang.Object
  extended by edu.memphis.ccrg.lida.framework.shared.activation.ActivatibleImpl
      extended by edu.memphis.ccrg.lida.framework.shared.activation.LearnableImpl
All Implemented Interfaces:
Activatible, Learnable, java.io.Serializable
Direct Known Subclasses:
FrameworkTaskImpl, SchemeImpl

public class LearnableImpl
extends ActivatibleImpl
implements Learnable

Default implementation of Learnable.

Author:
Javier Snaider, Ryan J. McCall
See Also:
Serialized Form

Field Summary
 
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
LearnableImpl()
          Constructs a new instance with default values.
LearnableImpl(double activation, double activatibleRemovalThreshold, double baseLevelActivation, double learnableRemovalThreshold, ExciteStrategy exciteStrategy, DecayStrategy decayStrategy, ExciteStrategy baseLevelExciteStrategy, DecayStrategy baseLevelDecayStrategy, TotalActivationStrategy taStrategy)
          Constructs a new instance with specified attributes
LearnableImpl(LearnableImpl l)
          Copy constructor
 
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.
 double getBaseLevelActivation()
          Returns base level activation.
 DecayStrategy getBaseLevelDecayStrategy()
          Gets decay strategy for the Base Level activation
 ExciteStrategy getBaseLevelExciteStrategy()
          Gets BaseLevelExciteStrategy
 double getLearnableRemovalThreshold()
          Gets learnableRemovalThreshold
 double getTotalActivation()
          Returns the total activation of this activatible
 TotalActivationStrategy getTotalActivationStrategy()
          Returns TotalActivationStrategy
 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 setBaseLevelActivation(double activation)
          Set base level activation.
 void setBaseLevelDecayStrategy(DecayStrategy baseLevelDecayStrategy)
          Sets decay strategy for the Base Level activation
 void setBaseLevelExciteStrategy(ExciteStrategy baseLevelExciteStrategy)
          Sets BaseLevelExciteStrategy
 void setBaseLevelRemovalThreshold(double threshold)
          Sets learnableRemovalThreshold
 void setTotalActivationStrategy(TotalActivationStrategy totalActivationStrategy)
          Sets TotalActivationStrategy
 
Methods inherited from class edu.memphis.ccrg.lida.framework.shared.activation.ActivatibleImpl
excite, getActivatibleRemovalThreshold, getActivation, getDecayStrategy, getExciteStrategy, setActivatibleRemovalThreshold, setActivation, setDecayStrategy, setExciteStrategy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.shared.activation.Activatible
excite, getActivatibleRemovalThreshold, getActivation, getDecayStrategy, getExciteStrategy, setActivatibleRemovalThreshold, setActivation, setDecayStrategy, setExciteStrategy
 

Constructor Detail

LearnableImpl

public LearnableImpl()
Constructs a new instance with default values.


LearnableImpl

public LearnableImpl(LearnableImpl l)
Copy constructor

Parameters:
l - LearnableImpl

LearnableImpl

public LearnableImpl(double activation,
                     double activatibleRemovalThreshold,
                     double baseLevelActivation,
                     double learnableRemovalThreshold,
                     ExciteStrategy exciteStrategy,
                     DecayStrategy decayStrategy,
                     ExciteStrategy baseLevelExciteStrategy,
                     DecayStrategy baseLevelDecayStrategy,
                     TotalActivationStrategy taStrategy)
Constructs a new instance with specified attributes

Parameters:
activation - current activation
activatibleRemovalThreshold - activation threshold needed for this instance to remain active
baseLevelActivation - base-level activation for learning
learnableRemovalThreshold - base-level activation needed for this instance to remain active
exciteStrategy - ExciteStrategy for exciting ActivatibleImpl activation.
decayStrategy - DecayStrategy for decaying ActivatibleImpl activation.
baseLevelExciteStrategy - ExciteStrategy for reinforcing LearnableImpl base-level activation.
baseLevelDecayStrategy - DecayStrategy for decaying LearnableImpl base-level activation.
taStrategy - TotalActivationStrategy how this instance will calculate its total activation.
Method Detail

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

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

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.

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

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

getBaseLevelExciteStrategy

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

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

setBaseLevelExciteStrategy

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

Specified by:
setBaseLevelExciteStrategy in interface Learnable
Parameters:
baseLevelExciteStrategy - the Excite strategy for the current 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.

setBaseLevelDecayStrategy

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

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

setBaseLevelActivation

public void setBaseLevelActivation(double activation)
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:
activation - new base level activation amount

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.

getLearnableRemovalThreshold

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

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

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

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 totalActivationStrategy)
Description copied from interface: Learnable
Sets TotalActivationStrategy

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