|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.memphis.ccrg.lida.framework.shared.activation.ActivatibleImpl
edu.memphis.ccrg.lida.framework.shared.activation.LearnableImpl
edu.memphis.ccrg.lida.framework.tasks.FrameworkTaskImpl
public abstract class FrameworkTaskImpl
This class implements the FrameworkTask Interface. This class should be used as the base class for all FrameworkTasks.
Field Summary | |
---|---|
protected TaskStatus |
status
TaskStatus of this task |
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 | |
---|---|
FrameworkTaskImpl()
Constructs a FrameworkTaskImpl with default ticksPerRun |
|
FrameworkTaskImpl(int ticksPerRun)
Constructs a FrameworkTaskImpl with specified ticksPerRun |
|
FrameworkTaskImpl(int ticksPerRun,
TaskSpawner ts)
Constructs a FrameworkTaskImpl with default ticksPerRun and specified
controlling TaskSpawner |
Method Summary | |
---|---|
FrameworkTask |
call()
This method should not be called directly nor should it be overridden. |
boolean |
equals(java.lang.Object o)
|
TaskSpawner |
getControllingTaskSpawner()
Gets TaskSpawner that controls this FrameworkTask. |
long |
getNextTicksPerRun()
Gets nextTicksPerRun |
java.lang.Object |
getParam(java.lang.String name,
java.lang.Object defaultValue)
A convenience method to read parameters from the Map of properties set with the init() method. |
long |
getScheduledTick()
Returns the tick when this task is scheduled to run next. |
long |
getTaskId()
Each FrameworkTask is meant to have a unique id that is set at the time of creation. |
TaskStatus |
getTaskStatus()
Returns status |
int |
getTicksPerRun()
Gets ticksPerRun |
int |
hashCode()
|
void |
init()
This is a convenience method to initialize Tasks. |
void |
init(java.util.Map<java.lang.String,?> parameters)
This method initializes the module with parameters specified in agent.xml |
protected abstract void |
runThisFrameworkTask()
To be overridden by extending classes. |
void |
setAssociatedModule(FrameworkModule module,
java.lang.String moduleUsage)
Subclasses may override this method. |
void |
setControllingTaskSpawner(TaskSpawner controllingTS)
Sets TaskSpawner that controls this FrameworkTask. |
void |
setNextTicksPerRun(long nextTicksPerRun)
Sets nextTicksPerRun |
void |
setScheduledTick(long scheduledTick)
Sets tick when this task will be run next. |
void |
setTaskStatus(TaskStatus status)
Sets task status. |
void |
setTicksPerRun(int ticks)
Sets ticksPerRun |
void |
stopRunning()
Tells this FrameworkTask to shutdown. |
java.lang.String |
toString()
|
Methods inherited from class edu.memphis.ccrg.lida.framework.shared.activation.LearnableImpl |
---|
decay, decayBaseLevelActivation, getBaseLevelActivation, getBaseLevelDecayStrategy, getBaseLevelExciteStrategy, getLearnableRemovalThreshold, getTotalActivation, getTotalActivationStrategy, isRemovable, reinforceBaseLevelActivation, setBaseLevelActivation, setBaseLevelDecayStrategy, setBaseLevelExciteStrategy, setBaseLevelRemovalThreshold, setTotalActivationStrategy |
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, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface edu.memphis.ccrg.lida.framework.shared.activation.Learnable |
---|
decayBaseLevelActivation, getBaseLevelActivation, getBaseLevelDecayStrategy, getBaseLevelExciteStrategy, getLearnableRemovalThreshold, getTotalActivationStrategy, reinforceBaseLevelActivation, setBaseLevelActivation, setBaseLevelDecayStrategy, setBaseLevelExciteStrategy, setBaseLevelRemovalThreshold, setTotalActivationStrategy |
Methods inherited from interface edu.memphis.ccrg.lida.framework.shared.activation.Activatible |
---|
decay, excite, getActivatibleRemovalThreshold, getActivation, getDecayStrategy, getExciteStrategy, getTotalActivation, isRemovable, setActivatibleRemovalThreshold, setActivation, setDecayStrategy, setExciteStrategy |
Field Detail |
---|
protected TaskStatus status
TaskStatus
of this task
Constructor Detail |
---|
public FrameworkTaskImpl()
FrameworkTaskImpl
with default ticksPerRun
public FrameworkTaskImpl(int ticksPerRun)
FrameworkTaskImpl
with specified ticksPerRun
ticksPerRun
- task's run frequencypublic FrameworkTaskImpl(int ticksPerRun, TaskSpawner ts)
FrameworkTaskImpl
with default ticksPerRun and specified
controlling TaskSpawner
ticksPerRun
- task's run frequencyts
- controlling TaskSpawner
Method Detail |
---|
public long getScheduledTick()
FrameworkTask
getScheduledTick
in interface FrameworkTask
public void setScheduledTick(long scheduledTick)
FrameworkTask
setScheduledTick
in interface FrameworkTask
scheduledTick
- tick to schedule this taskTaskManager
public FrameworkTask call()
runThisFrameworkTask()
instead.
call
in interface java.util.concurrent.Callable<FrameworkTask>
Callable.call()
protected abstract void runThisFrameworkTask()
public void setTaskStatus(TaskStatus status)
FrameworkTask
FrameworkTask.stopRunning()
to
cancel the task.
setTaskStatus
in interface FrameworkTask
status
- the new task statuspublic TaskStatus getTaskStatus()
FrameworkTask
getTaskStatus
in interface FrameworkTask
public long getTaskId()
FrameworkTask
getTaskId
in interface FrameworkTask
public int getTicksPerRun()
FrameworkTask
getTicksPerRun
in interface FrameworkTask
public void setTicksPerRun(int ticks)
FrameworkTask
setTicksPerRun
in interface FrameworkTask
ticks
- number of ticks that will occur between executions of this taskchange ticksPerRun for the next run only
public void stopRunning()
FrameworkTask
stopRunning
in interface FrameworkTask
public void init(java.util.Map<java.lang.String,?> parameters)
Initializable
init
in interface Initializable
parameters
- Map of parameters indexed by String namespublic void init()
init
in interface Initializable
public java.lang.Object getParam(java.lang.String name, java.lang.Object defaultValue)
Initializable
getParam
in interface Initializable
name
- the parameter namedefaultValue
- the default value to be returned if the parameter doesn't exist.
public TaskSpawner getControllingTaskSpawner()
FrameworkTask
getControllingTaskSpawner
in interface FrameworkTask
public void setControllingTaskSpawner(TaskSpawner controllingTS)
FrameworkTask
setControllingTaskSpawner
in interface FrameworkTask
controllingTS
- the TaskSpawnerpublic long getNextTicksPerRun()
FrameworkTask
getNextTicksPerRun
in interface FrameworkTask
FrameworkTask
.public void setNextTicksPerRun(long nextTicksPerRun)
FrameworkTask
setNextTicksPerRun
in interface FrameworkTask
nextTicksPerRun
- number of ticks that must pass before for the next, and only the next, execution of this
FrameworkTask.to set the permanent (default) number
of ticksPerRun
public void setAssociatedModule(FrameworkModule module, java.lang.String moduleUsage)
setAssociatedModule
in interface FullyInitializable
module
- the module to be associated.moduleUsage
- how module will be used @see ModuleUsagepublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |