org.jactr.modules.pm.motor.managers
Class AbstractManager

java.lang.Object
  extended by org.jactr.modules.pm.motor.managers.AbstractManager
Direct Known Subclasses:
AbortionManager, ExecutionManager, PreparationManager, ProcessingManager

public abstract class AbstractManager
extends java.lang.Object

base class for the various processing managers that are used in the preparation, processing, and execution of motor commands. Generally each of the managers follow the same pattern. When a request comes in (on the model thread), it is initialize(IMovement, ChunkTypeRequest, double) first, which will verify that the request can proceed (no buffer jams), and posts an event that will expire after the end time has elapsed which will #finalize(IMovement) the processing on the model thread.
After initialize(IMovement, ChunkTypeRequest, double) has been called, an asynchronous #process(IMovement) call is made that will handle the configuration and communication with common reality.

Author:
harrison

Constructor Summary
AbstractManager(MotorManager manager, AbstractMotorModule module, java.lang.String stateSlot)
           
 
Method Summary
 void clear()
           
 IMovement getActiveMovement(org.commonreality.identifier.IIdentifier muscleId)
          return the active movement associated with this muscle.
 java.util.Collection<IMovement> getActiveMovements()
           
 java.lang.String getStateSlotName()
           
 boolean hasAbortedMovements()
           
 boolean hasActiveMovements()
           
 boolean isInterestedIn(org.commonreality.identifier.IIdentifier commandId)
           
 void setBlockClearStates(org.commonreality.efferent.IEfferentCommand.ActualState... states)
          when an active commands state changes to one of these the blocking timed event will be cleared.
 void setDriftStates(org.commonreality.efferent.IEfferentCommand.ActualState... states)
           
 void setEarlyTerminationStates(org.commonreality.efferent.IEfferentCommand.ActualState... states)
          when a command's state changes to any of these, the timed event will be aborted and a new one inserted that will fire immediately.
 boolean wasAborted(org.commonreality.identifier.IIdentifier muscleId)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractManager

public AbstractManager(MotorManager manager,
                       AbstractMotorModule module,
                       java.lang.String stateSlot)
Method Detail

getStateSlotName

public java.lang.String getStateSlotName()

setDriftStates

public void setDriftStates(org.commonreality.efferent.IEfferentCommand.ActualState... states)

setEarlyTerminationStates

public void setEarlyTerminationStates(org.commonreality.efferent.IEfferentCommand.ActualState... states)
when a command's state changes to any of these, the timed event will be aborted and a new one inserted that will fire immediately. This allows the system to respond to errors immediately.

Parameters:
states -

setBlockClearStates

public void setBlockClearStates(org.commonreality.efferent.IEfferentCommand.ActualState... states)
when an active commands state changes to one of these the blocking timed event will be cleared.

Parameters:
states -

isInterestedIn

public boolean isInterestedIn(org.commonreality.identifier.IIdentifier commandId)

clear

public void clear()

hasAbortedMovements

public boolean hasAbortedMovements()

wasAborted

public boolean wasAborted(org.commonreality.identifier.IIdentifier muscleId)

getActiveMovement

public IMovement getActiveMovement(org.commonreality.identifier.IIdentifier muscleId)
return the active movement associated with this muscle. An active movement is any movement that has started with initialize(IMovement, ChunkTypeRequest, double) and not yet reached #finalize(IMovement)

Parameters:
muscleId -
Returns:

getActiveMovements

public java.util.Collection<IMovement> getActiveMovements()

hasActiveMovements

public boolean hasActiveMovements()