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

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.activation.LearnableImpl
All Implemented Interfaces:
Initializable, Activatible, Learnable
Direct Known Subclasses:
FrameworkTaskImpl, SchemeImpl

public class LearnableImpl
extends ActivatibleImpl
implements Learnable

Default implementation of Learnable.

Author:
Javier Snaider, Ryan J. McCall

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)
          Deprecated. This functionality is subsumed by ElementFactory.
LearnableImpl(LearnableImpl l)
          Deprecated. This functionality is subsumed by ElementFactory.
 
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
 void init()
          If this method is overridden, this init() must be called first! i.e.
 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 a)
          Set base level activation.
 void setBaseLevelDecayStrategy(DecayStrategy s)
          Sets decay strategy for the Base Level activation
 void setBaseLevelExciteStrategy(ExciteStrategy s)
          Sets BaseLevelExciteStrategy
 void setBaseLevelRemovalThreshold(double t)
          Sets learnableRemovalThreshold
 void setTotalActivationStrategy(TotalActivationStrategy s)
          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 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, 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
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.initialization.Initializable
containsParameter, getParam, getParameters, init
 

Constructor Detail

LearnableImpl

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


LearnableImpl

@Deprecated
public LearnableImpl(LearnableImpl l)
Deprecated. This functionality is subsumed by ElementFactory.

Copy constructor.

Parameters:
l - LearnableImpl

LearnableImpl

@Deprecated
public LearnableImpl(double activation,
                                double activatibleRemovalThreshold,
                                double baseLevelActivation,
                                double learnableRemovalThreshold,
                                ExciteStrategy exciteStrategy,
                                DecayStrategy decayStrategy,
                                ExciteStrategy baseLevelExciteStrategy,
                                DecayStrategy baseLevelDecayStrategy,
                                TotalActivationStrategy taStrategy)
Deprecated. This functionality is subsumed by ElementFactory.

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

init

public void init()
If this method is overridden, this init() must be called first! i.e. super.init(); Will set parameters with the following names:

learnable.baseLevelActivation initial base-level activation
learnable.baseLevelRemovalThreshold initial removal threshold
learnable.baseLevelDecayStrategy name of base-level decay strategy
learnable.baseLevelExciteStrategy name of base-level excite strategy
learnable.totalActivationStrategy name of total activation strategy

If any parameter is not specified its default value will be used.

Specified by:
init in interface Initializable
Overrides:
init in class InitializableImpl
See Also:
Initializable

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

Specified by:
setBaseLevelExciteStrategy in interface Learnable
Parameters:
s - 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 s)
Description copied from interface: Learnable
Sets decay strategy for the Base Level activation

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

setBaseLevelActivation

public void setBaseLevelActivation(double a)
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:
a - 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 t)
Description copied from interface: Learnable
Sets learnableRemovalThreshold

Specified by:
setBaseLevelRemovalThreshold in interface Learnable
Parameters:
t - 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 s)
Description copied from interface: Learnable
Sets TotalActivationStrategy

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