org.jactr.modules.pm.motor.command
Class DefaultCommandTranslator

java.lang.Object
  extended by org.jactr.modules.pm.motor.command.DefaultCommandTranslator
All Implemented Interfaces:
ICommandTranslator

public class DefaultCommandTranslator
extends java.lang.Object
implements ICommandTranslator


Constructor Summary
DefaultCommandTranslator()
           
 
Method Summary
 void add(ICommandTranslatorDelegate delegate)
           
 void adjust(ChunkTypeRequest request, org.commonreality.object.delta.DeltaTracker tracker, org.commonreality.efferent.IEfferentCommand command, IModel model)
          adjust a command midflight
 java.util.Collection<ICommandTranslatorDelegate> getDelegates()
           
 org.commonreality.object.IEfferentObject getMuscle(ChunkTypeRequest request, IModel model)
          translates a set of slot values into a IEfferentObject that represents a muscle defined within the pattern.
 org.commonreality.object.IEfferentObject getMuscle(java.lang.String muscleName, IModel model)
          translate a string name into an IEfferentObject that represents the muscle.
 void remove(ICommandTranslatorDelegate delegate)
           
 org.commonreality.efferent.IEfferentCommand translate(ChunkTypeRequest request, org.commonreality.object.IEfferentObject muscle, IModel model)
          translate a ChunkPattern into an appropriate IEfferentCommand.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCommandTranslator

public DefaultCommandTranslator()
Method Detail

add

public void add(ICommandTranslatorDelegate delegate)

remove

public void remove(ICommandTranslatorDelegate delegate)

getDelegates

public java.util.Collection<ICommandTranslatorDelegate> getDelegates()

getMuscle

public org.commonreality.object.IEfferentObject getMuscle(ChunkTypeRequest request,
                                                          IModel model)
                                                   throws java.lang.IllegalArgumentException
Description copied from interface: ICommandTranslator
translates a set of slot values into a IEfferentObject that represents a muscle defined within the pattern. Since many ACT-R movement commands use multiple slots to define a muscle, this collapses them. (i.e. translates hand right finger index into right-index). In addition to the returned IEfferentObject this method should also ensure that the slots used to define the muscle are nulled out and the muscle slot is specified.

Specified by:
getMuscle in interface ICommandTranslator
Returns:
Throws:
java.lang.IllegalArgumentException

translate

public org.commonreality.efferent.IEfferentCommand translate(ChunkTypeRequest request,
                                                             org.commonreality.object.IEfferentObject muscle,
                                                             IModel model)
                                                      throws java.lang.IllegalArgumentException
Description copied from interface: ICommandTranslator
translate a ChunkPattern into an appropriate IEfferentCommand. By setting the MovementCommand.MOVEMENT_RATE, the translator may provide a hint to common reality regarding the actual execution time of the movement.

Specified by:
translate in interface ICommandTranslator
Returns:
Throws:
java.lang.IllegalArgumentException

adjust

public void adjust(ChunkTypeRequest request,
                   org.commonreality.object.delta.DeltaTracker tracker,
                   org.commonreality.efferent.IEfferentCommand command,
                   IModel model)
            throws java.lang.IllegalArgumentException,
                   javax.naming.OperationNotSupportedException
Description copied from interface: ICommandTranslator
adjust a command midflight

Specified by:
adjust in interface ICommandTranslator
Throws:
java.lang.IllegalArgumentException
javax.naming.OperationNotSupportedException

getMuscle

public org.commonreality.object.IEfferentObject getMuscle(java.lang.String muscleName,
                                                          IModel model)
                                                   throws java.lang.IllegalArgumentException
Description copied from interface: ICommandTranslator
translate a string name into an IEfferentObject that represents the muscle. This is called during a buffer query that has been scoped on a specific muscle group

Specified by:
getMuscle in interface ICommandTranslator
Returns:
Throws:
java.lang.IllegalArgumentException - if no muscle is found