Class DialogueComponent

java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.slug.dialogue.DialogueComponent

public class DialogueComponent extends DiarcComponent
  • Constructor Details

    • DialogueComponent

      public DialogueComponent()
  • Method Details

    • init

      protected void init()
      Description copied from class: DiarcComponent
      Perform any component initialization. This should not be used for setting local fields to default values as was the case in DIARC. This method is called after the constructor, and after parseArgs. Setting default values should be done in field declaration or in the constructor.
      Overrides:
      init in class DiarcComponent
    • parseArgs

      public void parseArgs(org.apache.commons.cli.CommandLine cmdLine)
      Description copied from class: DiarcComponent
      Called directly after construction to pass runtime values that will override default values. This should parse all the options that additionalUsageInfo provides.zs
      Overrides:
      parseArgs in class DiarcComponent
    • additionalUsageInfo

      public List<org.apache.commons.cli.Option> additionalUsageInfo()
      Description copied from class: DiarcComponent
      Command line options available in sub-class. This should be paired with a parseArgs implementation.
      Overrides:
      additionalUsageInfo in class DiarcComponent
      Returns:
    • shutdownComponent

      protected void shutdownComponent()
      Description copied from class: DiarcComponent
      Any component that needs particular shutdown logic needs to override this method and
      Overrides:
      shutdownComponent in class DiarcComponent
    • updateDialogueHistory

      public void updateDialogueHistory(Utterance utt)
    • getDialogueHistory

      public List<Utterance> getDialogueHistory()
    • registerForDialogueHistoryNotifications

      public void registerForDialogueHistoryNotifications(ai.thinkingrobots.trade.TRADEServiceInfo callback)
    • unregisterForDialogueHistoryNotifications

      public void unregisterForDialogueHistoryNotifications(ai.thinkingrobots.trade.TRADEServiceInfo callback)
    • isRepeatedPredicate

      public boolean isRepeatedPredicate(Predicate word, Symbol listener, Predicate state, int recency)
    • waitForResponse

      public Map<Variable,Symbol> waitForResponse(Predicate responseForm)
    • waitForResponse

      public Map<Variable,Symbol> waitForResponse(Predicate responseForm, long waitDuration)
      Parameters:
      responseForm - answer semantics which this method will block until receiving
      waitDuration - duration this method will block until giving up. If a negative number, will block indefinitely
      Returns:
      Bindings from the answer, or null if no answer was received in time
    • isQuestionResponse

      public boolean isQuestionResponse(Symbol speaker, Symbol listener, Term semantics)
      Determines if the semantics of a given utterance are an answer to any currently active questions
      Parameters:
      speaker - currently not used
      listener - currently not used
      semantics - answer semantics provided by the interlocutor
      Returns:
    • answerQuestion

      public void answerQuestion(Symbol speaker, Symbol listener, Term answerSemantics)
      Search currently 'active' questions from one that matches answerSemantics. Get the relevant bindings from the answer, save them and unlock the question thread.
      Parameters:
      speaker - currently not used
      listener - currently not used
      answerSemantics - answer semantics provided by the interlocutor
    • cancelWaitForResponse

      public void cancelWaitForResponse(Term responseForm)
      Remove the answer corresponding to the provided semantics from the current or suspended question collections and signal the answer condition
      Parameters:
      responseForm - answer semantics required to match against the corresponding question
    • suspendWaitForResponse

      public void suspendWaitForResponse(Term responseForm)
      Transfer the answer corresponding to the provided semantics from the current question collection to the suspended one and signal the answer condition
      Parameters:
      responseForm - answer semantics required to match against the corresponding question
    • resumeWaitForResponse

      public void resumeWaitForResponse(Term responseForm)
      Put the previously cached answer back into the current questions collection for consideration
      Parameters:
      responseForm - answer semantics required to match against the corresponding question