Skip to content

Commit

Permalink
Update: numeric term handling complete. precondition matters here, no…
Browse files Browse the repository at this point in the history
…t op and index considerations
  • Loading branch information
patham9 committed Dec 10, 2023
1 parent a75d16f commit dfa75f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
17 changes: 7 additions & 10 deletions src/Decision.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,17 +323,14 @@ Decision Decision_BestCandidate(Concept *goalconcept, Event *goal, long currentT
{
for(int k=0; k<goalconcept->precondition_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)
Expand Down

0 comments on commit dfa75f3

Please sign in to comment.