Class VisionConsultant
java.lang.Object
edu.tufts.hrilab.consultant.Consultant<VisionReference>
edu.tufts.hrilab.vision.consultant.VisionConsultant
- All Implemented Interfaces:
ConsultantInterface,VisionConsultantInterface
- Direct Known Subclasses:
MockVisionConsultant,RealVisionConsultant
public abstract class VisionConsultant
extends Consultant<VisionReference>
implements VisionConsultantInterface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected VisionInterfaceTo give the consultant access to vision api methods and the STM.protected final Map<Long,Set<VisionReference>> Map from typeId to VisionReference.Fields inherited from class edu.tufts.hrilab.consultant.Consultant
defaultProperties, kbName, log, propertiesHandled, refConstructor, references, refNumber -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanassertProperties(Symbol refId, List<Term> properties) Add properties to already existing object ref.booleanan attempt is made to bring the knowledge base in line with the provided bindings, list of properties, and probability value.convertToGrasps(MemoryObject mo, List<? extends Term> constraints) protected <U> UconvertToType(Object object, Class<U> type) getInitialDomain(List<Term> query) 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).Get all POWER references known to vision.getReferences(Long typeId) Get POWER reference for vision type ID.getReferences(List<Term> properties) Get POWER reference that contain all specified properties.getTokenIds(Symbol objectRef) Get token IDs for an object reference.Get tokens for an object reference.Get the underlying vision typeId associated with the object reference.getVariable(Symbol objectRef) Get free-variable for specified object reference.voidloadReferencesFromFile(String filename) Load pre-defined vision references from file via JSON.<U> UlocalConvertToType(Symbol refId, Class<U> type) <U> UlocalConvertToType(Symbol refId, Class<U> type, List<? extends Term> constraints) booleanremoveReference(Symbol objectRef) This method should probably be removed.voidbooleanwriteReferencesToFile(String filename) Write vision references to file using JSON.Methods inherited from class edu.tufts.hrilab.consultant.Consultant
addPropertiesHandled, addReference, convertToType, convertToType, createReference, createReferences, getActivatedEntities, getAssertedProperties, getKBName, getNextReferenceId, getPropertiesHandled, getReference, getReferenceSummaries, getReferencesWithAllProperties, getReferencesWithAnyProperties, notifyNewPropertySubscribers, process, registerForNewPropertyNotification, retractProperties, stripQuotesFromMorpheme, unregisterForNewPropertyNotificationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.tufts.hrilab.interfaces.ConsultantInterface
convertToType, convertToType, createReferences, getActivatedEntities, getAssertedProperties, getKBName, getPropertiesHandled, notifyNewPropertySubscribers, process, registerForNewPropertyNotification, unregisterForNewPropertyNotification
-
Field Details
-
visionTypes
Map from typeId to VisionReference. -
visionComponent
To give the consultant access to vision api methods and the STM.
-
-
Constructor Details
-
VisionConsultant
-
-
Method Details
-
writeReferencesToFile
Write vision references to file using JSON.- Parameters:
filename-- Returns:
-
loadReferencesFromFile
Load pre-defined vision references from file via JSON.- Parameters:
filename-
-
assertProperties
Description copied from interface:ConsultantInterfacean attempt is made to bring the knowledge base in line with the provided bindings, list of properties, and probability value.- Specified by:
assertPropertiesin interfaceConsultantInterface- Overrides:
assertPropertiesin classConsultant<VisionReference>- Parameters:
bindings- list of bindings in tuple form (free-variable and refId pair)prob- probability valueproperties- list of Properties- Returns:
- whether the updated was successful?
-
assertProperties
Description copied from interface:ConsultantInterfaceAdd 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:
assertPropertiesin interfaceConsultantInterface- Overrides:
assertPropertiesin classConsultant<VisionReference>- Returns:
-
getInitialDomain
Description copied from interface:ConsultantInterfaceReturns 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:
getInitialDomainin interfaceConsultantInterface- Overrides:
getInitialDomainin classConsultant<VisionReference>- Returns:
- list of currently known ids
-
setTypeId
-
getTypeId
Description copied from interface:VisionConsultantInterfaceGet the underlying vision typeId associated with the object reference.- Specified by:
getTypeIdin interfaceVisionConsultantInterface- Returns:
-
getTokens
Description copied from interface:VisionConsultantInterfaceGet tokens for an object reference. For now, this method just calls the getTokens method that takes in a typeId. In the future, this should probably not automatically start a visual search, but instead look through LTM which currently doesn't exist.- Specified by:
getTokensin interfaceVisionConsultantInterface- Returns:
-
getTokenIds
Description copied from interface:VisionConsultantInterfaceGet token IDs for an object reference. For now, this method just calls the getTokenIds method that takes in a typeId. In the future, this should probably not automatically start a visual search, but instead look through LTM which currently doesn't exist.- Specified by:
getTokenIdsin interfaceVisionConsultantInterface- Returns:
-
removeReference
This method should probably be removed. Only added for object learning hack in AvailableLearners.- Parameters:
objectRef-- Returns:
-
getReferences
Get POWER reference for vision type ID.- Parameters:
typeId-- Returns:
-
getReferences
Get all POWER references known to vision.- Returns:
-
getReferences
Get POWER reference that contain all specified properties.- Parameters:
properties-- Returns:
-
getVariable
Get free-variable for specified object reference.- Parameters:
objectRef-- Returns:
-
localConvertToType
- Specified by:
localConvertToTypein classConsultant<VisionReference>
-
localConvertToType
- Specified by:
localConvertToTypein classConsultant<VisionReference>
-
convertToGrasps
-
convertToType
-