org.jactr.core.module.declarative.four.learning
Class DefaultDeclarativeLearningModule4

java.lang.Object
  extended by org.jactr.core.module.AbstractModule
      extended by org.jactr.core.module.declarative.four.learning.DefaultDeclarativeLearningModule4
All Implemented Interfaces:
IDeclarativeLearningModule4, IModule, ILearningModule, IInitializable, IInstallable, IParameterized

public class DefaultDeclarativeLearningModule4
extends AbstractModule
implements IDeclarativeLearningModule4, IParameterized

default declarative learning module. learning is accomplished by attaching listeners to chunks and buffers. For instance, we attach a listener to all chunks so we know when they are accessed (used for base level learning). we also listen to all slot changes so that associative links can be adjusted accordingly. And we listen to the procedural module so that we know which production fired, binding to which chunks so that the associative links can be updated

Author:
developer

Field Summary
 
Fields inherited from interface org.jactr.core.module.declarative.four.learning.IDeclarativeLearningModule4
ASSOCIATIVE_LEARNING_RATE, BASE_LEVEL_LEARNING_RATE, OPTIMIZED_LEARNING
 
Constructor Summary
DefaultDeclarativeLearningModule4()
           
 
Method Summary
 void dispose()
          release any resources.
 double getAssociativeLearning()
           
 IBaseLevelActivationEquation getBaseLevelActivationEquation()
           
 double getBaseLevelLearning()
           
 int getOptimizationLevel()
           
 java.lang.String getParameter(java.lang.String key)
          return parameter value - null if not defined.
 java.util.Collection<java.lang.String> getPossibleParameters()
          Return all parameters that can be read
 java.util.Collection<java.lang.String> getSetableParameters()
          Return list of all parameters that can be set.
 void initialize()
          this will be called after all the modules have been installed permitting the module to attach listeners to other modules.
 void install(IModel model)
          called from the model during IModel.install(IModule).
 boolean isAssociativeLearningEnabled()
           
 boolean isBaseLevelLearningEnabled()
           
 boolean isLearningEnabled()
           
 void setAssociativeLearning(double learningRate)
           
 void setBaseLevelActivationEquation(IBaseLevelActivationEquation equation)
           
 void setBaseLevelLearning(double learningRate)
           
 void setLearningEnabled(boolean enable)
           
 void setOptimizationLevel(int level)
           
 void setParameter(java.lang.String key, java.lang.String value)
          Set the named parameter
 
Methods inherited from class org.jactr.core.module.AbstractModule
delayedFuture, getExecutor, getModel, getName, getSafeName, immediateFuture, immediateReturn, uninstall
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jactr.core.module.IModule
getModel, getName
 
Methods inherited from interface org.jactr.core.utils.IInstallable
uninstall
 

Constructor Detail

DefaultDeclarativeLearningModule4

public DefaultDeclarativeLearningModule4()
Method Detail

install

public void install(IModel model)
Description copied from interface: IModule
called from the model during IModel.install(IModule). The module should handle any nondependent initialization here. Since no chunks will have been installed yet, the module should make not attempt to make reference to any until just before the model runs. Likewise, you should not install listeners into modules that this one is dependent upon until initialize() is called.

Specified by:
install in interface IModule
Specified by:
install in interface IInstallable
Overrides:
install in class AbstractModule
See Also:
IInstallable.install(org.jactr.core.model.IModel)

dispose

public void dispose()
Description copied from interface: IModule
release any resources. this should only be called by the model during its own dispose method (assuming that this module is still installed) and should not result in the propogation of ANY events. The module should dispose of all its resources, including buffers

Specified by:
dispose in interface IModule
Overrides:
dispose in class AbstractModule

getOptimizationLevel

public int getOptimizationLevel()
Specified by:
getOptimizationLevel in interface IDeclarativeLearningModule4

setOptimizationLevel

public void setOptimizationLevel(int level)

getAssociativeLearning

public double getAssociativeLearning()
Specified by:
getAssociativeLearning in interface IDeclarativeLearningModule4
Returns:

getBaseLevelLearning

public double getBaseLevelLearning()
Specified by:
getBaseLevelLearning in interface IDeclarativeLearningModule4
Returns:

isAssociativeLearningEnabled

public boolean isAssociativeLearningEnabled()
Specified by:
isAssociativeLearningEnabled in interface IDeclarativeLearningModule4
Returns:

isBaseLevelLearningEnabled

public boolean isBaseLevelLearningEnabled()
Specified by:
isBaseLevelLearningEnabled in interface IDeclarativeLearningModule4
Returns:

setAssociativeLearning

public void setAssociativeLearning(double learningRate)

setBaseLevelLearning

public void setBaseLevelLearning(double learningRate)

isLearningEnabled

public boolean isLearningEnabled()
Specified by:
isLearningEnabled in interface ILearningModule

setLearningEnabled

public void setLearningEnabled(boolean enable)
Specified by:
setLearningEnabled in interface ILearningModule

initialize

public void initialize()
Description copied from interface: IModule
this will be called after all the modules have been installed permitting the module to attach listeners to other modules. if you want to get access to chunks,types, or productions before the model runs, attach a model listener and do that during the modelStarted call

Specified by:
initialize in interface IModule
Specified by:
initialize in interface IInitializable
Specified by:
initialize in class AbstractModule

getBaseLevelActivationEquation

public IBaseLevelActivationEquation getBaseLevelActivationEquation()
Specified by:
getBaseLevelActivationEquation in interface IDeclarativeLearningModule4
See Also:
IDeclarativeLearningModule4.getBaseLevelActivationEquation()

setBaseLevelActivationEquation

public void setBaseLevelActivationEquation(IBaseLevelActivationEquation equation)
See Also:
org.jactr.core.module.declarative.four.learning.IDeclarativeLearningModule4#setBaseLevelActivationEquation(org.jactr.core.module.declarative.four.learning.IBaseLevelActivationEquation)

getParameter

public java.lang.String getParameter(java.lang.String key)
Description copied from interface: IParameterized
return parameter value - null if not defined.

Specified by:
getParameter in interface IParameterized
Parameters:
key - Description of the Parameter
Returns:
The parameter value
See Also:
IParameterized.getParameter(java.lang.String)

getPossibleParameters

public java.util.Collection<java.lang.String> getPossibleParameters()
Description copied from interface: IParameterized
Return all parameters that can be read

Specified by:
getPossibleParameters in interface IParameterized
Returns:
The possibleParameters value
See Also:
IParameterized.getPossibleParameters()

getSetableParameters

public java.util.Collection<java.lang.String> getSetableParameters()
Description copied from interface: IParameterized
Return list of all parameters that can be set.

Specified by:
getSetableParameters in interface IParameterized
Returns:
The setableParameters value
See Also:
IParameterized.getSetableParameters()

setParameter

public void setParameter(java.lang.String key,
                         java.lang.String value)
Description copied from interface: IParameterized
Set the named parameter

Specified by:
setParameter in interface IParameterized
See Also:
IParameterized.setParameter(java.lang.String, java.lang.String)