edu.memphis.ccrg.lida.workspace.structurebuildingcodelets
Class StructureBuildingCodeletModule

java.lang.Object
  extended by edu.memphis.ccrg.lida.framework.initialization.InitializableImpl
      extended by edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
          extended by edu.memphis.ccrg.lida.workspace.structurebuildingcodelets.StructureBuildingCodeletModule
All Implemented Interfaces:
CodeletManagerModule, FrameworkModule, FullyInitializable, Initializable

public class StructureBuildingCodeletModule
extends FrameworkModuleImpl
implements CodeletManagerModule

A module which maintains Codelets of workspace. This module manages Codelets and responds for sending events to framework GUI.

Author:
Ryan J. McCall

Field Summary
 
Fields inherited from class edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
taskSpawner
 
Constructor Summary
StructureBuildingCodeletModule()
          Default Constructor.
 
Method Summary
 void addCodelet(Codelet cod)
          Adds specified Codelet to this module to be run.
 void decayModule(long ticks)
          Decay only this Module.
 StructureBuildingCodelet getCodelet(java.lang.String codeletType)
          Returns a new Codelet of the specified type or null if this type is not supported.
 StructureBuildingCodelet getCodelet(java.lang.String type, java.util.Map<java.lang.String,java.lang.Object> params)
          Returns a new Codelet of the specified type or null if this type is not supported.
 StructureBuildingCodelet getDefaultCodelet()
          Returns a new Codelet of the default type of the Manager
 StructureBuildingCodelet getDefaultCodelet(java.util.Map<java.lang.String,java.lang.Object> params)
          Returns a new Codelet of the default type of the Manager
 java.lang.Object getModuleContent(java.lang.Object... params)
          Intended to be called from the GUI.
 void init()
          Will set parameters with the following names:

sbcModule.defaultCodeletType type of attention codelets obtained from this module
sbcModule.codeletActivation initial activation of codelets obtained from this module
sbcModule.codeletRemovalThreshold initial removal threshold for codelets obtained from this module
 void setAssociatedModule(FrameworkModule module, java.lang.String moduleUsage)
          Sets an associated FrameworkModule.
 void setDefaultCodeletType(java.lang.String type)
          Sets default codelet type used by this Manager.
 
Methods inherited from class edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
addListener, addSubModule, containsSubmodule, containsSubmodule, getAssistingTaskSpawner, getModuleName, getSubmodule, getSubmodule, getSubmodules, setAssistingTaskSpawner, setModuleName, taskManagerDecayModule, toString
 
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, wait, wait, wait
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.FrameworkModule
addListener, addSubModule, containsSubmodule, containsSubmodule, getAssistingTaskSpawner, getModuleName, getSubmodule, getSubmodule, getSubmodules, setAssistingTaskSpawner, setModuleName, taskManagerDecayModule
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.initialization.Initializable
containsParameter, getParam, getParameters, init
 

Constructor Detail

StructureBuildingCodeletModule

public StructureBuildingCodeletModule()
Default Constructor. Sets up the initial default StructureBuildingCodelet for the module.

Method Detail

init

public void init()
Will set parameters with the following names:

sbcModule.defaultCodeletType type of attention codelets obtained from this module
sbcModule.codeletActivation initial activation of codelets obtained from this module
sbcModule.codeletRemovalThreshold initial removal threshold for codelets obtained from this module

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

setDefaultCodeletType

public void setDefaultCodeletType(java.lang.String type)
Description copied from interface: CodeletManagerModule
Sets default codelet type used by this Manager.

Specified by:
setDefaultCodeletType in interface CodeletManagerModule
Parameters:
type - type name of codelet in the ElementFactory
See Also:
ElementFactory

setAssociatedModule

public void setAssociatedModule(FrameworkModule module,
                                java.lang.String moduleUsage)
Description copied from interface: FullyInitializable
Sets an associated FrameworkModule.

Specified by:
setAssociatedModule in interface FullyInitializable
Overrides:
setAssociatedModule in class FrameworkModuleImpl
Parameters:
module - the module to be associated.
moduleUsage - how module will be used
See Also:
ModuleUsage

getDefaultCodelet

public StructureBuildingCodelet getDefaultCodelet()
Description copied from interface: CodeletManagerModule
Returns a new Codelet of the default type of the Manager

Specified by:
getDefaultCodelet in interface CodeletManagerModule
Returns:
new default Codelet

getDefaultCodelet

public StructureBuildingCodelet getDefaultCodelet(java.util.Map<java.lang.String,java.lang.Object> params)
Description copied from interface: CodeletManagerModule
Returns a new Codelet of the default type of the Manager

Specified by:
getDefaultCodelet in interface CodeletManagerModule
Parameters:
params - Optional parameters or null
Returns:
new default Codelet

getCodelet

public StructureBuildingCodelet getCodelet(java.lang.String codeletType)
Description copied from interface: CodeletManagerModule
Returns a new Codelet of the specified type or null if this type is not supported.

Specified by:
getCodelet in interface CodeletManagerModule
Parameters:
codeletType - Codelet type
Returns:
new Codelet of specified type or null if type is not supported
See Also:
ElementFactory

getCodelet

public StructureBuildingCodelet getCodelet(java.lang.String type,
                                           java.util.Map<java.lang.String,java.lang.Object> params)
Description copied from interface: CodeletManagerModule
Returns a new Codelet of the specified type or null if this type is not supported.

Specified by:
getCodelet in interface CodeletManagerModule
Parameters:
type - Codelet type
params - Optional parameters or null
Returns:
new Codelet of specified type or null if type is not supported

addCodelet

public void addCodelet(Codelet cod)
Description copied from interface: CodeletManagerModule
Adds specified Codelet to this module to be run.

Specified by:
addCodelet in interface CodeletManagerModule
Parameters:
cod - Codelet to be added to run

getModuleContent

public java.lang.Object getModuleContent(java.lang.Object... params)
Description copied from class: FrameworkModuleImpl
Intended to be called from the GUI. Override this method to return particular module content based on params.

Specified by:
getModuleContent in interface FrameworkModule
Overrides:
getModuleContent in class FrameworkModuleImpl
Parameters:
params - parameters specifying what content will be returned
Returns:
Parameter-specified content of this module.

decayModule

public void decayModule(long ticks)
Description copied from interface: FrameworkModule
Decay only this Module.

Specified by:
decayModule in interface FrameworkModule
Parameters:
ticks - number of ticks to decay.