hmi.elckerlyc
Interface Planner

All Known Subinterfaces:
SpeechPlanner
All Known Implementing Classes:
AbstractPlanner, AnimationPlanner, AudioPlanner, FacePlanner, InterruptPlanner, TextPlanner, TTSPlanner, WaitPlanner

public interface Planner

Elckerlyc planner. Each planner can add BML behaviors to a plan and is able to resolve their unknown time constraints

Author:
Herwin van Welbergen

Method Summary
 List<SyncAndTimePeg> addBehaviour(BMLBlockPeg bbPeg, Behaviour b, List<TimePegAndConstraint> sac, PlanUnit planElement)
          Adds a behavior to the plan.
 void addExceptionListener(BMLExceptionListener el)
           
 void addFeedbackListener(BMLFeedbackListener fb)
           
 void clearAll(double time)
          Removes all behaviors from the plan
 Set<String> getBehaviours(String bmlId)
           
 double getEndTime(String behId, String bmlId)
           
 List<BMLFeedbackListener> getFeedbackListeners()
           
 Set<String> getInvalidBehaviours()
          Checks if the behavior plan is still consistent (e.g. after modifying the timing of some TimePegs).
 Player getPlayer()
          Returns the Player for this planner. useful for, e.g., resetting the player of any planner (see BMLRealizer.reset).
 List<Class<? extends Behaviour>> getSupportedBehaviours()
           
 List<Class<? extends Behaviour>> getSupportedDescriptionExtensions()
           
 void interruptBehaviour(String behaviourId, String bmlId, double globalTime)
          Interrupts the behavior, sending the appropiate feedback callbacks if the behavior was running, just removes it otherwise.
 void interruptBehaviourBlock(String bmlId, double globalTime)
          Interrupt all behaviors in a bml block This stops the behavior an removes it from the plan
 void removeAllExceptionListeners()
           
 void removeAllFeedbackListeners()
           
 void removeBehaviour(String behaviourId, String bmlId)
          Removes behavior with behaviourId and bmlId from the plan Callback behavior is unspecified
 void removeFeedbackListener(BMLFeedbackListener fb)
           
 void reset()
          Resets the player, that is: stops running behavior and returns the player to its startup state (default pose etc) This does not clear any behaviours from the plans.
 PlanUnit resolveSynchs(BMLBlockPeg bbPeg, Behaviour b, List<TimePegAndConstraint> sac)
          Resolves TimePegs for behavior b, given some known time pegs and constraints
 void setBMLBlockState(String bmlId, PlanUnitState state)
           
 void setParameterValue(String behId, String bmlId, String paramId, float value)
           
 void setParameterValue(String behId, String bmlId, String paramId, String value)
           
 void shutdown()
          Clean up resources constructed with the planner (e.g. for native stuff, spawned threads, ...).
 

Method Detail

getPlayer

Player getPlayer()
Returns the Player for this planner. useful for, e.g., resetting the player of any planner (see BMLRealizer.reset).


addBehaviour

List<SyncAndTimePeg> addBehaviour(BMLBlockPeg bbPeg,
                                  Behaviour b,
                                  List<TimePegAndConstraint> sac,
                                  PlanUnit planElement)
                                  throws BehaviourPlanningException
Adds a behavior to the plan. All timepegs in sac must be resolved.

Parameters:
planElement - planElement obtained from resolveSynchs, null to create a new planElement
Returns:
a list of all syncs of the behavior and their linked TimePegs
Throws:
BehaviourPlanningException - if no behavior satisfying sac can be constructed

resolveSynchs

PlanUnit resolveSynchs(BMLBlockPeg bbPeg,
                       Behaviour b,
                       List<TimePegAndConstraint> sac)
                       throws BehaviourPlanningException
Resolves TimePegs for behavior b, given some known time pegs and constraints

Parameters:
b - the behavior
sac - the provided time pegs and constraints, missing constraints are filled out by this method
Returns:
the object to be placed in the plan (a TimedMotionUnit, SpeechUnit, ...)
Throws:
BehaviourPlanningException - if no behavior satisfying sac can be constructed

clearAll

void clearAll(double time)
Removes all behaviors from the plan


reset

void reset()
Resets the player, that is: stops running behavior and returns the player to its startup state (default pose etc) This does not clear any behaviours from the plans.


getInvalidBehaviours

Set<String> getInvalidBehaviours()
Checks if the behavior plan is still consistent (e.g. after modifying the timing of some TimePegs). Returns id's of behaviors with invalid timing


removeBehaviour

void removeBehaviour(String behaviourId,
                     String bmlId)
Removes behavior with behaviourId and bmlId from the plan Callback behavior is unspecified


interruptBehaviour

void interruptBehaviour(String behaviourId,
                        String bmlId,
                        double globalTime)
Interrupts the behavior, sending the appropiate feedback callbacks if the behavior was running, just removes it otherwise.


interruptBehaviourBlock

void interruptBehaviourBlock(String bmlId,
                             double globalTime)
Interrupt all behaviors in a bml block This stops the behavior an removes it from the plan


getSupportedBehaviours

List<Class<? extends Behaviour>> getSupportedBehaviours()

getSupportedDescriptionExtensions

List<Class<? extends Behaviour>> getSupportedDescriptionExtensions()

removeFeedbackListener

void removeFeedbackListener(BMLFeedbackListener fb)

removeAllFeedbackListeners

void removeAllFeedbackListeners()

addFeedbackListener

void addFeedbackListener(BMLFeedbackListener fb)

getFeedbackListeners

List<BMLFeedbackListener> getFeedbackListeners()
Returns:
an unmodifiable view of the registered feedback listeners

removeAllExceptionListeners

void removeAllExceptionListeners()

addExceptionListener

void addExceptionListener(BMLExceptionListener el)

setBMLBlockState

void setBMLBlockState(String bmlId,
                      PlanUnitState state)

getBehaviours

Set<String> getBehaviours(String bmlId)

getEndTime

double getEndTime(String behId,
                  String bmlId)

setParameterValue

void setParameterValue(String behId,
                       String bmlId,
                       String paramId,
                       float value)

setParameterValue

void setParameterValue(String behId,
                       String bmlId,
                       String paramId,
                       String value)

shutdown

void shutdown()
Clean up resources constructed with the planner (e.g. for native stuff, spawned threads, ...). A planner should not be (re)used after shutting it down.