Skip to content

Commit

Permalink
DigitClass40
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrock4t committed Jan 11, 2022
1 parent b7552af commit 88ba7d0
Show file tree
Hide file tree
Showing 6 changed files with 311 additions and 336 deletions.
10 changes: 5 additions & 5 deletions Config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"k": 0.18764168442840437,
"T": 0.75,
"k": 1,
"T": 0.65,
"FOCUSX": 1.0305365040669583,
"FOCUSY": 0.8437127611721296,
"PROJECTION_DECAY_DESIRE": 0.95,
Expand All @@ -13,11 +13,11 @@

"TAU_WORKING_CYCLE_DURATION": 25,

"POSITIVE_THRESHOLD": 0.55,
"POSITIVE_THRESHOLD": 0.51,
"NEGATIVE_THRESHOLD": 0.5,

"MEMORY_CONCEPT_CAPACITY": 200000,
"EVENT_BUFFER_CAPACITY": 8,
"MEMORY_CONCEPT_CAPACITY": 210000,
"EVENT_BUFFER_CAPACITY": 10,
"GLOBAL_BUFFER_CAPACITY": 1000,
"CONCEPT_LINK_CAPACITY": 100,
"NUMBER_OF_ATTEMPTS_TO_SEARCH_FOR_SEMANTICALLY_RELATED_CONCEPT": 3,
Expand Down
8 changes: 4 additions & 4 deletions NALInferenceRules/HelperFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ def stamp_and_print_inference_rule(sentence, inference_rule, parent_sentences):
parent_strings.append("other " + str(parent.value))


if inference_rule is F_Deduction and isinstance(sentence, NALGrammar.Sentences.Judgment) and sentence.statement.is_first_order():
Global.Global.debug_print(sentence.stamp.derived_by
+ " derived " + sentence.get_formatted_string()
+ " by parents " + str(parent_strings))
# if inference_rule is F_Deduction and isinstance(sentence, NALGrammar.Sentences.Judgment) and sentence.statement.is_first_order():
# Global.Global.debug_print(sentence.stamp.derived_by
# + " derived " + sentence.get_formatted_string()
# + " by parents " + str(parent_strings))

def premise_result_type(j1,j2):
"""
Expand Down
41 changes: 10 additions & 31 deletions NARS.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,40 +120,16 @@ def do_working_cycle(self):
# OBSERVE
#self.Observe()
# todo begin spatial take vvv
vision_sentences = self.vision_buffer.take()

radii = [1]
vision_sentences = []
for radius in radii:
vision_sentences += self.vision_buffer.take(pool=False,radius=radius)
vision_sentences += self.vision_buffer.take(pool=True,radius=radius)

# single array

# for vision_sentence in vision_sentences:
# if vision_sentence is not None:
# self.global_buffer.PUT_NEW(NARSDataStructures.Other.Task(vision_sentence))


# multi-event conjunction

for vision_sentence in vision_sentences:
for last_vision_sentence in self.last_vision_sentences:
if vision_sentence is not None \
and last_vision_sentence is not None:
if vision_sentence.statement == last_vision_sentence.statement: continue

result_statement = NALGrammar.Terms.CompoundTerm([vision_sentence.statement,
last_vision_sentence.statement],
NALSyntax.TermConnector.Conjunction)
value = NALInferenceRules.TruthValueFunctions.F_Intersection(vision_sentence.value.frequency,
vision_sentence.value.confidence,
last_vision_sentence.value.frequency,
last_vision_sentence.value.confidence)

value = NALGrammar.Values.TruthValue(frequency=value.frequency,
confidence=value.confidence)
result = NALGrammar.Sentences.Judgment(statement=result_statement,
value=value,
occurrence_time=Global.Global.get_current_cycle_number())
self.global_buffer.PUT_NEW(NARSDataStructures.Other.Task(result))

self.last_vision_sentences = vision_sentences
if vision_sentence is not None:
self.global_buffer.PUT_NEW(NARSDataStructures.Other.Task(vision_sentence))

# todo end spatial take ^^

Expand Down Expand Up @@ -423,10 +399,13 @@ def process_judgment_task(self, task: NARSDataStructures.Other.Task):
# only put non-derived atomic events in temporal module for now
Global.Global.NARS.temporal_module.PUT_NEW(task)

if isinstance(task.sentence.statement, NALGrammar.Terms.SpatialTerm): return

if isinstance(j.statement, NALGrammar.Terms.CompoundTerm)\
and j.statement.connector == NALSyntax.TermConnector.Negation:
j = NALInferenceRules.Immediate.Negation(j)


task_statement_concept_item = self.memory.peek_concept_item(j.statement)
if task_statement_concept_item is None: return

Expand Down
Loading

0 comments on commit 88ba7d0

Please sign in to comment.