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
    • populateDiarcAgents

      public void populateDiarcAgents(ai.thinkingrobots.trade.TRADEServiceInfo service)
    • parseArgs

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

      public List<org.apache.commons.cli.Option> additionalUsageInfo()
      Description copied from class: DiarcComponent
      Override this method to define 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
    • updateDialogueHistoryFromString

      public void updateDialogueHistoryFromString(Symbol actor, Symbol addressee, String words)
    • 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)
    • registerForQuestionAskingNotifications

      public void registerForQuestionAskingNotifications(ai.thinkingrobots.trade.TRADEServiceInfo callback)
    • unregisterForQuestionAskingNotifications

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

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

      public Map<Variable,Symbol> waitForResponse(String questionString, List<Term> responseForms, Symbol speaker)
    • waitForResponse

      public Map<Variable,Symbol> waitForResponse(String questionString, List<Term> responseForms, Symbol speaker, Symbol addressee)
    • waitForResponse

      public Map<Variable,Symbol> waitForResponse(String questionString, List<Term> responseForms, Symbol speaker, Symbol addressee, long waitDuration)
      Parameters:
      questionString - String corresponding to question which was asked
      responseForms - List of possible semantic forms which are considered answers to the question
      speaker - The agent which had asked the question
      addressee - The user able to answer the question. A value of 'any' allows any user to answer the question
      waitDuration - duration this method will block until giving up. If a negative number, will block indefinitely
      Returns:
      Bindings from the answer, or an empty map if no answer was received in time or the question was overwritten/canceled
    • getMatchingQuestions

      public Map<Symbol,List<Question>> getMatchingQuestions(Symbol speaker, Symbol listener, Term answerSemantics)
    • answerQuestion

      public void answerQuestion(Question question, Term answerSemantics)
    • cancelWaitForResponse

      public void cancelWaitForResponse(String questionString, List<Term> responseForms, Symbol listener)
    • cancelWaitForResponse

      public void cancelWaitForResponse(String questionString, List<Term> responseForms, Symbol listener, Symbol speaker)
      Remove the question corresponding to the provided string and response semantics from the current question collection and signal the answer condition without setting response bindings
      Parameters:
      questionString - String corresponding to question which was asked
      responseForms - List of possible semantic forms required to match against the corresponding question
      listener - The agent which had asked the question
    • suspendWaitForResponse

      public List<Long> suspendWaitForResponse(Term responseForm, Symbol listener, boolean unlock)
    • suspendWaitForResponse

      public List<Long> suspendWaitForResponse(Term responseForm, Symbol listener, boolean unlock, Symbol speaker)
      Suspend the question(s) corresponding to the provided response semantics. Optionally unlock the answer to unblock waitForResponse call(s).
      Parameters:
      responseForm - semantic form to match against the current questions
      listener - The agent which had asked the question
      unlock - specify whether to unlock the suspended question's answer (practically causes the corresponding waitForResponse call to unblock if true, and not otherwise)
    • suspendWaitForResponse

      public List<Long> suspendWaitForResponse(List<Term> responseForms, Symbol listener, boolean unlock)
    • suspendWaitForResponse

      public List<Long> suspendWaitForResponse(List<Term> responseForms, Symbol listener, boolean unlock, Symbol speaker)
    • resumeWaitForResponse

      public List<Long> resumeWaitForResponse(Term responseForm, Symbol listener)
    • resumeWaitForResponse

      public List<Long> resumeWaitForResponse(Term responseForm, Symbol listener, Symbol speaker)
      Resume the previously suspended question(s) to allow them to match future question responses
      Parameters:
      responseForm - answer semantics required to match against the corresponding question
      listener - The agent which had asked the question
    • resumeWaitForResponse

      public List<Long> resumeWaitForResponse(List<Term> responseForms, Symbol listener)
    • resumeWaitForResponse

      public List<Long> resumeWaitForResponse(List<Term> responseForms, Symbol listener, Symbol speaker)
    • resumeWaitForResponse

      public boolean resumeWaitForResponse(long qid, Symbol listener)
    • isAgentWaitingForResponse

      public boolean isAgentWaitingForResponse(Symbol agent)
    • allowInstructionsDuringQAForAgent

      public void allowInstructionsDuringQAForAgent(Symbol agent)
    • removeAllowInstructionsDuringQAForAgent

      public void removeAllowInstructionsDuringQAForAgent(Symbol agent)
    • getLastQuestion

      public String getLastQuestion(Symbol agent)
    • getAllQuestions

      public List<String> getAllQuestions(Symbol agent)
    • getLastQuestionResponseForm

      public List<Term> getLastQuestionResponseForm(Symbol agent)
    • getAllQuestionResponseForms

      public List<List<Term>> getAllQuestionResponseForms(Symbol agent)
    • resetQuestionTimeout

      public void resetQuestionTimeout(List<Term> responseForms, Symbol speaker, Symbol addressee)