Class DialogueConsultant

java.lang.Object
edu.tufts.hrilab.slug.dialogue.DialogueConsultant
All Implemented Interfaces:
ConsultantInterface

public class DialogueConsultant extends Object implements ConsultantInterface
  • Field Details

    • log

      protected final org.slf4j.Logger log
    • diaLog

      protected final DiaLog diaLog
  • Constructor Details

    • DialogueConsultant

      public DialogueConsultant(DiaLog d)
  • Method Details

    • getActivatedEntities

      public Map<Symbol,Double> getActivatedEntities()
      Description copied from interface: ConsultantInterface
      Get a list of currently highly salient entities that should be considered "activated."
      Specified by:
      getActivatedEntities in interface ConsultantInterface
      Returns:
      list of refIds and probability pairs
    • getKBName

      public String getKBName()
      Description copied from interface: ConsultantInterface
      Returns name of things handles by this consultant (e.g., "objects", "locations", etc).
      Specified by:
      getKBName in interface ConsultantInterface
      Returns:
      knowledge base name
    • getPropertiesHandled

      public List<Term> getPropertiesHandled()
      Description copied from interface: ConsultantInterface
      Returns a list of Properties handled by this component.
      Specified by:
      getPropertiesHandled in interface ConsultantInterface
      Returns:
      list of Properties.
    • getInitialDomain

      public List<Symbol> getInitialDomain(List<Term> query)
      Description copied from interface: ConsultantInterface
      Returns a list of currently known refIds (it takes a seq of Properties, to optionally do some pre-processing to return a list of relevant candidates).
      Specified by:
      getInitialDomain in interface ConsultantInterface
      Returns:
      list of currently known ids
    • process

      public Double process(Term constraint, Map<Variable,Symbol> bindings)
      Description copied from interface: ConsultantInterface
      Returns the probability that a property (aka constraint) holds for an entity (specified by a map of free-variable to refId bindings).

      TODO: rename method to something more descriptive. how about getProbability or checkProperty?

      Specified by:
      process in interface ConsultantInterface
      Parameters:
      constraint - Property to check
      bindings - Map of free variables to refIds
      Returns:
      probability value [0.0. 1.0]
    • createReferences

      public Map<Variable,Symbol> createReferences(List<Variable> vars)
      Description copied from interface: ConsultantInterface
      new representations are created for each free-variable and returned in the binding list.
      Specified by:
      createReferences in interface ConsultantInterface
      Parameters:
      vars - list of free-variables
      Returns:
      list of bindings
    • assertProperties

      public boolean assertProperties(Map<Variable,Symbol> bindings, Double prob, List<Term> properties)
      Description copied from interface: ConsultantInterface
      an attempt is made to bring the knowledge base in line with the provided bindings, list of properties, and probability value.
      Specified by:
      assertProperties in interface ConsultantInterface
      Parameters:
      bindings - list of bindings in tuple form (free-variable and refId pair)
      prob - probability value
      properties - list of Properties
      Returns:
      whether the updated was successful?
    • getAssertedProperties

      public List<Term> getAssertedProperties(Symbol refId)
      Description copied from interface: ConsultantInterface
      Get the list of properties that have been asserted for a given refId.
      Specified by:
      getAssertedProperties in interface ConsultantInterface
      Parameters:
      refId - reference resolution id
      Returns:
      list of Properties
    • assertProperties

      public boolean assertProperties(Symbol refId, List<Term> properties)
      Description copied from interface: ConsultantInterface
      Add properties to already existing object ref. Each property should contain a connection to the existing ref either by refId or refId's variable.
      Specified by:
      assertProperties in interface ConsultantInterface
      Returns:
    • convertToType

      public <U> U convertToType(Symbol refId, Class<U> type)
      Description copied from interface: ConsultantInterface
      Convert refId to target class. This is a way to map references onto Java-types. If it's not possible for a refId to be converted to the specified type, null is returned.
      Specified by:
      convertToType in interface ConsultantInterface
      Parameters:
      refId - - reference resolution ID (e.g.object_3)
      type - - target Java class type
      Returns:
    • convertToType

      public <U> U convertToType(Symbol refId, Class<U> type, List<? extends Term> constraints)
      Description copied from interface: ConsultantInterface
      Convert refId to target class using the specified constraints for to filter the results. This is a way to map references onto Java-types. If it's not possible for a refId to be converted to the specified type, null is returned.
      Specified by:
      convertToType in interface ConsultantInterface
      Returns:
    • registerForNewPropertyNotification

      public void registerForNewPropertyNotification(ai.thinkingrobots.trade.TRADEServiceInfo callback)
      Specified by:
      registerForNewPropertyNotification in interface ConsultantInterface
    • unregisterForNewPropertyNotification

      public void unregisterForNewPropertyNotification(ai.thinkingrobots.trade.TRADEServiceInfo callback)
      Specified by:
      unregisterForNewPropertyNotification in interface ConsultantInterface
    • notifyNewPropertySubscribers

      public void notifyNewPropertySubscribers()
      Specified by:
      notifyNewPropertySubscribers in interface ConsultantInterface