Class CognexConsultant
java.lang.Object
edu.tufts.hrilab.consultant.Consultant<CognexReference>
edu.tufts.hrilab.cognex.consultant.CognexConsultant
- All Implemented Interfaces:
ConsultantInterface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringGroup identifier to be prepended to reference namesFields inherited from class edu.tufts.hrilab.consultant.Consultant
defaultProperties, kbName, log, propertiesHandled, refConstructor, refNumber -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDetectionType(Symbol descriptor, Symbol jobName) Adds a binding between the human descriptor and the name of the job on the cognex, these doesn't necessarily need to be the same.voidaddReference(CognexReference newRef) Add new reference from some source (file or learning) to the consultantbooleanassertProperties(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.voidbindCognexResult(CognexReference ref, CognexResult result, int indexIntoCognexResult) createCognexRef(CognexJob job, List<Term> additionalProps) createCogRefWithProperty(Symbol jobDescriptor, Term property) createCogRefWithProps(CognexJob j, List<Term> additionalProperties) Get a list of currently highly salient entities that should be considered "activated."Returns the CognexJob able to detect the given reference, if it exists.getCognexJobForDescriptor(Symbol descriptor) getCognexReferenceForID(Symbol refId) getJobForDescriptor(String descriptor) protected SymbolGenerates the new refId based on the refNumber counter, and increments.<U> UlocalConvertToType(Symbol refId, Class<U> type) The local implementation of convertToType.<U> UlocalConvertToType(Symbol refId, Class<U> type, List<? extends Term> constraints) The local implementation of convertToType.removeReference(Symbol refId) Remove known reference from the consultant.Methods inherited from class edu.tufts.hrilab.consultant.Consultant
addPropertiesHandled, convertToType, convertToType, createReference, createReferences, getAllReferences, getAssertedProperties, getInitialDomain, getKBName, 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, getAssertedProperties, getInitialDomain, getKBName, getPropertiesHandled, notifyNewPropertySubscribers, process, registerForNewPropertyNotification, unregisterForNewPropertyNotification
-
Field Details
-
availableJobs
-
boundJobs
-
lessSalientRefIds
-
groupNames
Group identifier to be prepended to reference names
-
-
Constructor Details
-
CognexConsultant
public CognexConsultant() -
CognexConsultant
-
-
Method Details
-
localConvertToType
Description copied from class:ConsultantThe local implementation of convertToType.- Specified by:
localConvertToTypein classConsultant<CognexReference>- Type Parameters:
U- target Java class template type (any)- Parameters:
refId- reference resolution ID (e.g.object_3)type- target Java class type- Returns:
- instance of specified target Java class
-
localConvertToType
Description copied from class:ConsultantThe local implementation of convertToType.- Specified by:
localConvertToTypein classConsultant<CognexReference>- Type Parameters:
U- target Java class template type (any)- Parameters:
refId- reference resolution ID (e.g.object_3)type- target Java class typeconstraints- first-order-logic predicate constraints- Returns:
- instance of specified target Java class
-
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<CognexReference>- 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 reference either by refId or refId's variable.- Specified by:
assertPropertiesin interfaceConsultantInterface- Overrides:
assertPropertiesin classConsultant<CognexReference>- Parameters:
refId- referenceproperties- reference properties- Returns:
- if property was successfully added to reference refId
-
addDetectionType
Adds a binding between the human descriptor and the name of the job on the cognex, these doesn't necessarily need to be the same. The system should know about all of the job names, but it doesn't have to know about the human producable descriptors?Once the binding is done it adds the proerty to the consultant. TODO:brad is there a way we could just get the jobs from the Cognex at start up? thT would make this a lot easier.
- Parameters:
descriptor- human provided descriptorjobName- name of job on the Cognex that is used to detect the thing associated with the provided descriptor
-
createCogRefWithProps
-
createCognexRef
-
getJobForDescriptor
- Parameters:
descriptor-- Returns:
-
removeReference
Description copied from class:ConsultantRemove known reference from the consultant.- Overrides:
removeReferencein classConsultant<CognexReference>- Parameters:
refId- unique reference ID- Returns:
- removed Reference or null if it doesn't exist
-
getNextReferenceId
Generates the new refId based on the refNumber counter, and increments. Informs all other consultants with the same kbName of the current ref being allocated to attempt to maintain sync and avoid duplicating refs.- Overrides:
getNextReferenceIdin classConsultant<CognexReference>- Returns:
-
addReference
Description copied from class:ConsultantAdd new reference from some source (file or learning) to the consultant- Overrides:
addReferencein classConsultant<CognexReference>- Parameters:
newRef- new reference to add
-
getActivatedEntities
Description copied from interface:ConsultantInterfaceGet a list of currently highly salient entities that should be considered "activated."- Specified by:
getActivatedEntitiesin interfaceConsultantInterface- Overrides:
getActivatedEntitiesin classConsultant<CognexReference>- Returns:
- list of refIds and probability pairs
-
createCogRefWithProperty
-
getCognexJobForDescriptor
-
bindCognexResult
-
getCognexJobForCognexReference
Returns the CognexJob able to detect the given reference, if it exists.- Parameters:
ref- The CognexReference to fetch the matching CognexJob of.- Returns:
- The CognexJob associated with this reference.
-
getCognexReferenceForID
-