Class ReferenceResolutionComponent
java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.slug.refResolution.ReferenceResolutionComponent
-
Field Summary
FieldsFields inherited from class edu.tufts.hrilab.diarc.DiarcComponent
executionLoopCycleTime, shouldRunExecutionLoop
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
assertProperties
(Symbol ref, List<Term> properties) generateRE
(Symbol ref) generate referring expression (list of descriptor bindings) for a given ref_id<E> E
getEntityForReference
(Symbol ref, Class<E> entityJavaType) <E> E
getEntityForReference
(Symbol ref, Class<E> entityJavaType, List<Term> constraints) getProperties
(Symbol ref) protected void
init()
Perform any component initialization.void
newConsultantCallback
(ai.thinkingrobots.trade.TRADEServiceInfo tsi) Calls down to the resolver to update information about consultants after a new consultant is added.observeProperties
(Symbol actor, Term query) positReference
(Symbol actor, Term propertiesList) Posits a hypothetical reference that has all of the properties in properties.positReference
(List<Term> properties) Posits a hypothetical reference that has all the properties in properties.resolveReferences
(Utterance utterance) Attempts to resolve references in the Utterance.protected void
Any component that needs particular shutdown logic needs to override this method andvoid
void
Callback for a new property being added to a consultant.Methods inherited from class edu.tufts.hrilab.diarc.DiarcComponent
additionalUsageInfo, createInstance, createInstance, createInstance, createInstance, executionLoop, getMyGroupConstraints, getMyGroups, getMyService, getMyServices, main, parseArgs, shutdown
-
Field Details
-
log
protected final org.slf4j.Logger log
-
-
Constructor Details
-
ReferenceResolutionComponent
public ReferenceResolutionComponent()
-
-
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 classDiarcComponent
-
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 classDiarcComponent
-
newConsultantCallback
public void newConsultantCallback(ai.thinkingrobots.trade.TRADEServiceInfo tsi) Calls down to the resolver to update information about consultants after a new consultant is added. Additionally, registers for notifications from consultants for when new properties are added to the consultant.- Parameters:
tsi
- TRADEServiceInfo provided by caller.
-
updateResolverPropertiesHandled
public void updateResolverPropertiesHandled()Callback for a new property being added to a consultant. -
resolveReferences
Attempts to resolve references in the Utterance.- Returns:
- returns Utterance with resolved reference (can still contain unresolved references)
-
generateRE
generate referring expression (list of descriptor bindings) for a given ref_id- Parameters:
ref
- reference to get bindings for- Returns:
- map of descriptor bindings for use in NLG
-
getProperties
-
getEntityForReference
-
getEntityForReference
-
updateFOC
-
assertProperties
-
positReference
Posits a hypothetical reference that has all the properties in properties.- Parameters:
properties
- list of properties for hypothetical reference- Returns:
- the posited reference
-
positReference
Posits a hypothetical reference that has all of the properties in properties. This is a convince method so that it can easily be called during action learning.- Parameters:
propertiesList
- wrapper predicate whose args are a list of properties used to posit the reference- Returns:
- true if there is a consultant that can handle all of the members of properties
-
observeProperties
-