Hi guys!
I've run into a performance problem.
When I run the backward chainer with this query:
(GetLink
(VariableList
(TypedVariableLink (VariableNode "picker") (TypeNode "ConceptNode"))
(TypedVariableLink (VariableNode "human") (TypeNode "ConceptNode"))
(TypedVariableLink (VariableNode "place1") (TypeNode "ConceptNode"))
(TypedVariableLink (VariableNode "origin") (TypeNode "ConceptNode"))
(TypedVariableLink (VariableNode "destination") (TypeNode
"ConceptNode")))
(AndLink
(InheritanceLink (VariableNode "picker") (VariableNode "human"))
(StateLink (ListLink (VariableNode "picker") (PredicateNode "called
robot")) (ConceptNode "FALSE"))
(StateLink (ListLink (VariableNode "picker") (PredicateNode
"seen_picking")) (ConceptNode "FALSE"))
(StateLink (ListLink (VariableNode "picker") (PredicateNode
"movement")) (ConceptNode "APPROACHING"))
(StateLink (VariableNode "picker") (VariableNode "place1"))
(EvaluationLink (PredicateNode "leads_to") (ListLink (VariableNode
"place1") (VariableNode "origin")))
(StateLink (ConceptNode "Thorvald_001") (VariableNode "origin"))
(EvaluationLink (PredicateNode "leads_to") (ListLink (VariableNode
"origin") (VariableNode "destination")))
)
)
It takes only 0.004 seconds on my database.
But if I run the same query without the encompassing GetLink
(AndLink
(InheritanceLink (VariableNode "picker") (VariableNode "human"))
(StateLink (ListLink (VariableNode "picker") (PredicateNode "called
robot")) (ConceptNode "FALSE"))
(StateLink (ListLink (VariableNode "picker") (PredicateNode
"seen_picking")) (ConceptNode "FALSE"))
(StateLink (ListLink (VariableNode "picker") (PredicateNode
"movement")) (ConceptNode "APPROACHING"))
(StateLink (VariableNode "picker") (VariableNode "place1"))
(EvaluationLink (PredicateNode "leads_to") (ListLink (VariableNode
"place1") (VariableNode "origin")))
(StateLink (ConceptNode "Thorvald_001") (VariableNode "origin"))
(EvaluationLink (PredicateNode "leads_to") (ListLink (VariableNode
"origin") (VariableNode "destination")))
)
It takes a whooping 5 seconds. No idea why.
My intuition is that this is a bug. I assume we have to solve whatever is
in the outgoing set of the GetLink in order to return the result for the
GetLink and so the outgoing set can be computed in less than 0.004 seconds.
Anyway, it seems I have to forgo the use of the GetLink because I have to
add another condition
(AbsentLink (StateLink (VariableNode "person2"), (VariableNode
"destination")))
to make sure that there is nobody at the destination and the waypoint is
free. And adding this only works if I don't use the wrapping GetLink, my
guess is that adding the GetLink doesn't give any results because there is
no grounding for (VariableNode "person2") if there is nobody at the
waypoint.
The 5 seconds are way too long for my application though.
Is there a way to exclude a variable from being considered by the GetLink?
I tried to exclude it from the GetLink's VariableList, but that didn't work.
Thanks for your help!
Best regards,
Alex
--
You received this message because you are subscribed to the Google Groups
"opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/opencog/41de6c82-bf49-4dc0-bc3f-9773ac3973ad%40googlegroups.com.