From dfa75f35fc7618a79293662a4b8054da02ea0c90 Mon Sep 17 00:00:00 2001 From: Patrick Hammer Date: Mon, 11 Dec 2023 00:48:11 +0100 Subject: [PATCH] Update: numeric term handling complete. precondition matters here, not op and index considerations --- src/Config.h | 2 +- src/Decision.c | 17 +++++++---------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/Config.h b/src/Config.h index d0d03462..b18119de 100755 --- a/src/Config.h +++ b/src/Config.h @@ -87,7 +87,7 @@ //If var intro should be allowed at all (includes sensorimotor!) #define ALLOW_VAR_INTRO true //Numeric term similarity distance scale (everything beyound distance leads to conf 0 analogy!) -#define SIMILARITY_DISTANCE 0.3 +#define SIMILARITY_DISTANCE 1.0 /*---------------------------------*/ /* Temporal compounding parameters */ diff --git a/src/Decision.c b/src/Decision.c index a97c29d9..28753fcd 100755 --- a/src/Decision.c +++ b/src/Decision.c @@ -323,17 +323,14 @@ Decision Decision_BestCandidate(Concept *goalconcept, Event *goal, long currentT { for(int k=0; kprecondition_beliefs[opk].itemsAmount; k++) { - if(!(opi == opk && k == j)) + Implication impk = goalconcept->precondition_beliefs[opk].array[k]; + Term left_side_with_opk = Term_ExtractSubterm(&impk.term, 1); + Term left_sidek = Narsese_GetPreconditionWithoutOp(&left_side_with_opk); + Substitution subs3 = Variable_UnifyWithAnalogy(cmatch->belief_spike.truth, &left_sidek, &cmatch->term); + if(subs3.success && subs3.truth.confidence > subs2.truth.confidence) { - Implication impk = goalconcept->precondition_beliefs[opk].array[k]; - Term left_side_with_opk = Term_ExtractSubterm(&impk.term, 1); - Term left_sidek = Narsese_GetPreconditionWithoutOp(&left_side_with_opk); - Substitution subs3 = Variable_UnifyWithAnalogy(cmatch->belief_spike.truth, &left_sidek, &cmatch->term); - if(subs3.success && subs3.truth.confidence > subs2.truth.confidence) - { - hasCloserPreconditionLink = true; - break; - } + hasCloserPreconditionLink = true; + break; } } if(hasCloserPreconditionLink)