|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jactr.core.module.AbstractModule
org.jactr.core.module.asynch.AbstractAsynchronousModule
org.jactr.modules.pm.AbstractPerceptualModule
org.jactr.modules.pm.motor.AbstractMotorModule
public abstract class AbstractMotorModule
abstract motor module that handles just about everything one needs. It uses a
combination of the default MotorManager (which handles all the logic
of communicating with common reality, as well as the movement lifecylce), the
DefaultCommandTranslator to route ChunkPattern movement
requests to specific ICommandTranslatorDelegates, and uses
IMotorTimeEquation to determine how long preparation and processing
phases last.
The ICommandTranslatorDelegates map ChunkPatterns and Strings
to specific muscles, as defined by IEfferentObjects, as well as
translating the ChunkPatterns into precise IEfferentCommands
which will be passed to common reality by the MotorManager. There
should be a unique ICommandTranslatorDelegate for each and every
movement chunktype defined.
One will notice that only preparation and processing times are directly
controled by the motor module. execution times can only be indirectly
specified since execution time is actually up to common reality and the
sensor that receives the command. It can be influenced by having the
ICommandTranslatorDelegate set the
MovementCommand.MOVEMENT_RATE property of the
IEfferentCommand.
If StrictSynchronizationEnabled is false, preparation and processing times
may not match ACT-R's predictions. If it is enabled, processing will block
until a response is received from CR. However, run times may still not be
consistent since the sensor may require more time than predicted by ACT-R.
| Field Summary | |
|---|---|
static java.lang.String |
COMPOUND_MOTOR_COMMAND_CHUNK_TYPE
|
static java.lang.String |
ENABLE_PARALLEL_MUSCLES_PARAM
|
| Fields inherited from interface org.jactr.modules.pm.motor.IMotorModule |
|---|
ABORT_CHUNK_TYPE, ABORTING_CHUNK, MOVEMENT_CHUNK_TYPE, MUSCLE_SLOT |
| Fields inherited from interface org.jactr.modules.pm.IPerceptualModule |
|---|
GREATER_THAN_CURRENT_CHUNK, HIGHEST_CHUNK, LESS_THAN_CURRENT_CHUNK, LOWEST_CHUNK |
| Fields inherited from interface org.jactr.core.module.asynch.IAsynchronousModule |
|---|
STRICT_SYNCHRONIZATION_PARAM |
| Constructor Summary | |
|---|---|
AbstractMotorModule(java.lang.String name)
|
|
| Method Summary | |
|---|---|
java.util.concurrent.Future<IMovement> |
abort(IMovement movement,
double requestTime)
|
void |
addListener(IMotorModuleListener listener,
java.util.concurrent.Executor executor)
|
java.util.concurrent.Future<IMovement> |
adjust(IMovement movement,
ChunkTypeRequest request,
double requestTime)
|
boolean |
canAbort(ChunkTypeRequest request)
|
boolean |
canAbort(IMovement movement)
|
boolean |
canAdjust(ChunkTypeRequest request)
|
boolean |
canAdjust(IMovement movement)
|
boolean |
canExecute(ChunkTypeRequest request)
|
boolean |
canPrepare(ChunkTypeRequest request)
return true if we could prepare this motor command |
void |
dispatch(MotorModuleEvent event)
|
java.util.concurrent.Future<IMovement> |
execute(IMovement movement,
double requestTime)
execute a motor movement. |
IChunkType |
getAbortChunkType()
|
IChunk |
getAbortingChunk()
|
MotorCommandManager |
getCommandManager()
|
ICommandTranslator |
getCommandTranslator()
responsible code snippet that translates ChunkPatterns into
IEfferentCommands |
IChunkType |
getCompoundCommandChunkType()
|
IMovement |
getLastMovement(org.commonreality.identifier.IIdentifier muscle)
returns the most recently prepared movement for the given muscle |
IChunkType |
getMovementChunkType()
the root movement type chunk |
MuscleStateManager |
getMuscleManager()
tracker and manager of muscle info |
java.lang.String |
getParameter(java.lang.String key)
return parameter value - null if not defined. |
IMotorTimeEquation |
getPreparationTimeEquation()
the IMotorTimeEquation that determines how long the preparation
of a motor movement lasts |
IMotorTimeEquation |
getProcessingTimeEquation()
the IMotorTimeEquation that determines how much time is spent
processing the movement. |
java.util.Collection<java.lang.String> |
getSetableParameters()
Return list of all parameters that can be set. |
boolean |
hasListeners()
|
void |
initialize()
this will be called after all the modules have been installed permitting the module to attach listeners to other modules. |
boolean |
isMuscleParallelismEnabled()
|
java.util.concurrent.Future<IMovement> |
prepare(ChunkTypeRequest pattern,
double requestTime,
boolean prepareOnly)
prepare a motor movement. |
void |
removeListener(IMotorModuleListener listener)
|
void |
reset()
reset the module. |
void |
reset(java.lang.String muscleName)
reset the state of a single muscle |
void |
setCommandTranslator(ICommandTranslator translator)
|
void |
setMuscleParallelismEnabled(boolean enable)
|
void |
setParameter(java.lang.String key,
java.lang.String value)
Set the named parameter |
void |
setPreparationTimeEquation(IMotorTimeEquation equation)
|
void |
setProcessingTimeEquation(IMotorTimeEquation equation)
|
| Methods inherited from class org.jactr.modules.pm.AbstractPerceptualModule |
|---|
dispose, getBusyChunk, getCommonRealityExecutor, getErrorChunk, getExecutor, getFreeChunk, getRequestedChunk, getSymbolGrounder, getUnrequestedChunk |
| Methods inherited from class org.jactr.core.module.asynch.AbstractAsynchronousModule |
|---|
getPossibleParameters, isStrictSynchronizationEnabled, setStrictSynchronizationEnabled, synchronizedTimedEvent |
| Methods inherited from class org.jactr.core.module.AbstractModule |
|---|
delayedFuture, getModel, getName, immediateFuture, immediateReturn, install, uninstall |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jactr.modules.pm.motor.IMotorModule |
|---|
getBuffer |
| Methods inherited from interface org.jactr.modules.pm.IPerceptualModule |
|---|
getCommonRealityExecutor, getSymbolGrounder |
| Methods inherited from interface org.jactr.core.module.asynch.IAsynchronousModule |
|---|
getExecutor, isStrictSynchronizationEnabled, setStrictSynchronizationEnabled, synchronizedTimedEvent |
| Methods inherited from interface org.jactr.core.module.IModule |
|---|
dispose, getModel, getName, install |
| Methods inherited from interface org.jactr.core.utils.IInstallable |
|---|
uninstall |
| Methods inherited from interface org.jactr.core.utils.parameter.IParameterized |
|---|
getPossibleParameters |
| Field Detail |
|---|
public static final java.lang.String ENABLE_PARALLEL_MUSCLES_PARAM
public static final java.lang.String COMPOUND_MOTOR_COMMAND_CHUNK_TYPE
| Constructor Detail |
|---|
public AbstractMotorModule(java.lang.String name)
| Method Detail |
|---|
public void setCommandTranslator(ICommandTranslator translator)
public ICommandTranslator getCommandTranslator()
IMotorModuleChunkPatterns into
IEfferentCommands
getCommandTranslator in interface IMotorModulepublic void setProcessingTimeEquation(IMotorTimeEquation equation)
public IMotorTimeEquation getProcessingTimeEquation()
IMotorModuleIMotorTimeEquation that determines how much time is spent
processing the movement. Actual equation times are determined by
individual IEfferentCommandTranslators.
getProcessingTimeEquation in interface IMotorModulepublic void setPreparationTimeEquation(IMotorTimeEquation equation)
public IMotorTimeEquation getPreparationTimeEquation()
IMotorModuleIMotorTimeEquation that determines how long the preparation
of a motor movement lasts
getPreparationTimeEquation in interface IMotorModulepublic IChunkType getMovementChunkType()
IMotorModule
getMovementChunkType in interface IMotorModulepublic IChunkType getAbortChunkType()
getAbortChunkType in interface IMotorModulepublic IChunk getAbortingChunk()
public IChunkType getCompoundCommandChunkType()
public void initialize()
IModule
initialize in interface IModuleinitialize in interface IInitializableinitialize in class AbstractPerceptualModulepublic boolean isMuscleParallelismEnabled()
public void setMuscleParallelismEnabled(boolean enable)
public boolean canPrepare(ChunkTypeRequest request)
IMotorModule
canPrepare in interface IMotorModule
public java.util.concurrent.Future<IMovement> prepare(ChunkTypeRequest pattern,
double requestTime,
boolean prepareOnly)
IMotorModuleIEfferentCommand with common reality
prepare in interface IMotorModulepublic boolean canExecute(ChunkTypeRequest request)
canExecute in interface IMotorModule
public java.util.concurrent.Future<IMovement> execute(IMovement movement,
double requestTime)
IMotorModule
execute in interface IMotorModulepublic boolean canAdjust(ChunkTypeRequest request)
canAdjust in interface IMotorModulepublic boolean canAdjust(IMovement movement)
canAdjust in interface IMotorModule
public java.util.concurrent.Future<IMovement> adjust(IMovement movement,
ChunkTypeRequest request,
double requestTime)
adjust in interface IMotorModulepublic boolean canAbort(ChunkTypeRequest request)
canAbort in interface IMotorModulepublic boolean canAbort(IMovement movement)
canAbort in interface IMotorModule
public java.util.concurrent.Future<IMovement> abort(IMovement movement,
double requestTime)
abort in interface IMotorModulepublic void reset()
IModule
reset in interface IModulereset in interface IMotorModulepublic void reset(java.lang.String muscleName)
IMotorModule
reset in interface IMotorModulepublic IMovement getLastMovement(org.commonreality.identifier.IIdentifier muscle)
IMotorModule
getLastMovement in interface IMotorModulemuscle - if null, return the last movement regardless of the muscle
public MotorCommandManager getCommandManager()
getCommandManager in interface IMotorModulepublic MuscleStateManager getMuscleManager()
IMotorModule
getMuscleManager in interface IMotorModulepublic java.util.Collection<java.lang.String> getSetableParameters()
IParameterized
getSetableParameters in interface IParameterizedgetSetableParameters in class AbstractAsynchronousModule
public void setParameter(java.lang.String key,
java.lang.String value)
IParameterized
setParameter in interface IParameterizedsetParameter in class AbstractAsynchronousModulepublic java.lang.String getParameter(java.lang.String key)
IParameterized
getParameter in interface IParameterizedgetParameter in class AbstractAsynchronousModulekey - Description of the Parameter
public void addListener(IMotorModuleListener listener,
java.util.concurrent.Executor executor)
addListener in interface IMotorModulepublic boolean hasListeners()
hasListeners in interface IMotorModulepublic void removeListener(IMotorModuleListener listener)
removeListener in interface IMotorModulepublic void dispatch(MotorModuleEvent event)
dispatch in interface IMotorModule
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||