From 693f81d2ef70818ececcf9af5d7aa128053a927b Mon Sep 17 00:00:00 2001
From: "Christopher J. MacLellan" <christopher.maclellan@drexel.edu>
Date: Fri, 6 May 2022 14:43:08 -0500
Subject: [PATCH] updated run script to restrict range of inputs, updated
 knowledge to just have conceptual knowledge, working out pseudo code for rule
 updating.

---
 sandbox/fractions/run_TACT_agent_fractions.py | 26 ++++---------------
 tutorenvs/fractions.py                        |  8 +++---
 2 files changed, 9 insertions(+), 25 deletions(-)

diff --git a/sandbox/fractions/run_TACT_agent_fractions.py b/sandbox/fractions/run_TACT_agent_fractions.py
index c680bfb..379accf 100644
--- a/sandbox/fractions/run_TACT_agent_fractions.py
+++ b/sandbox/fractions/run_TACT_agent_fractions.py
@@ -1,4 +1,4 @@
-from apprentice.agents.glen_agent import GlenAgent
+from apprentice.agents.tact_agent import TACTAgent
 from apprentice.working_memory.representation import Sai
 
 from tutorenvs.fractions import FractionArithSymbolic
@@ -136,27 +136,11 @@ if __name__ == "__main__":
         Filter(lambda v1: is_number(v1)) &
         Fact(id=V('id2'), value=V('v1')) &
         Filter(lambda id1, id2: id1 < id2))
-    def equals(id1, v1, id2, v2):
+    def equals(id1, id2):
         return [Fact(relation='equality', first=id1, second=id2)]
 
-
-
-    @Production(
-        Fact(id=V('id1'), value=V('n1')) &
-        Filter(lambda n1: is_number(n1)) &
-        Fact(id=V('id2'), value=V('n2')) &
-        Filter(lambda n2: is_number(n2)) &
-        Fact(id=V('id3'), value=V('n3')) &
-        Filter(lambda n3: is_number(n3)) &
-        Filter(lambda n1, n2, n3: str(int(n1) + int(n2) + int(n3)) == '22'))
-    def beep(n1, n2):
-        print("FOUND pair of numbers that sum to 2")
-        return []
-        return [Sai(selection='answer_denom', action="UpdateField",
-                   inputs={'value': '22'})]
-
-    agent = GlenAgent(skills=[# correct_doneSAI, multiply, add, copySAI, 
-        beep])
-    # agent = GlenAgent(skills=[multiply, copy])
+    agent = TACTAgent(concepts=[equals],
+                      skills=[])
+                      # skills=[correct_doneSAI, add, multiply, copySAI])
 
     run_training(agent, n=500)
diff --git a/tutorenvs/fractions.py b/tutorenvs/fractions.py
index e16c734..7c15fef 100644
--- a/tutorenvs/fractions.py
+++ b/tutorenvs/fractions.py
@@ -155,10 +155,10 @@ class FractionArithSymbolic:
         return state_output
 
     def set_random_problem(self):
-        num1 = str(randint(1, 15))
-        num2 = str(randint(1, 15))
-        denom1 = str(randint(2, 15))
-        denom2 = str(randint(2, 15))
+        num1 = str(randint(1, 1))
+        num2 = str(randint(1, 1))
+        denom1 = str(randint(2, 2))
+        denom2 = str(randint(2, 2))
         operator = choice(['+', '*'])
         # operator = choice(['*'])
 
-- 
GitLab