summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiclas Dobbertin <niclas.dobbertin@mailbox.org>2024-07-12 12:37:15 +0200
committerNiclas Dobbertin <niclas.dobbertin@mailbox.org>2024-07-12 12:37:15 +0200
commitf520b7a6e163ab4e88ae51598ecef80cdad3e19d (patch)
treed98b1a27de950f0252ba8e751877129896a01e67
parente0eb227cd77550d7f34521406b8ab77017183134 (diff)
add overall procedure
-rw-r--r--modeling/model_env.py56
-rw-r--r--modeling/model_init.py2
-rw-r--r--modeling/prod_numbers.py5
-rw-r--r--modeling/prod_vis.py8
-rw-r--r--modeling/productions_math.py27
5 files changed, 67 insertions, 31 deletions
diff --git a/modeling/model_env.py b/modeling/model_env.py
index fd262c6..c548e99 100644
--- a/modeling/model_env.py
+++ b/modeling/model_env.py
@@ -6,7 +6,7 @@ def generate_environments():
screen = {}
generate_variables(screen)
- # generate_procedures(screen)
+ generate_procedures(screen)
envs.append(screen)
@@ -14,29 +14,39 @@ def generate_environments():
def generate_procedures(screen):
- screen["Procedure1"] = {"text": "proc1", "position": (400, 100)}
- screen["Procedure2"] = {"text": "proc2", "position": (400, 200)}
- screen["Procedure3"] = {"text": "proc3", "position": (400, 300)}
- screen["Procedure4"] = {"text": "proc4", "position": (400, 400)}
- screen["Procedure5"] = {"text": "proc5", "position": (400, 500)}
- screen["ProcedureOverall"] = {"text": "proc_overall", "position": (400, 500)}
+ procs = ["procs1", "procs2", "procs3", "procs4", "procs5", "procs6"]
+ screen["Procedure1"] = {"text": procs[0], "position": (0, 100)}
+ screen["Procedure2"] = {"text": procs[1], "position": (0, 200)}
+ screen["Procedure3"] = {"text": procs[2], "position": (0, 300)}
+ screen["Procedure4"] = {"text": procs[3], "position": (0, 400)}
+ screen["Procedure5"] = {"text": procs[4], "position": (0, 500)}
+ screen["ProcedureOverall"] = {"text": "proc_overall", "position": (0, 600)}
+
+ screen["Answers"] = {"text": "Answers", "position": (100, 0)}
+ screen["Answer1"] = {"text": 1, "position": (100, 100)}
+ screen["Answer2"] = {"text": 2, "position": (100, 200)}
+ screen["Answer3"] = {"text": 3, "position": (100, 300)}
+ screen["Answer4"] = {"text": 4, "position": (100, 400)}
+ screen["Answer5"] = {"text": 5, "position": (100, 500)}
+
+ screen["AnswerOverall"] = {"text": "proc_overall", "position": (100, 600)}
def generate_variables(screen):
# Variables
- screen["Algen"] = {"text": "Algen", "position": (100, 100)}
- screen["AlgenVar"] = {"text": "3", "position": (100, 200)}
- screen["Mineralien"] = {"text": "Mineralien", "position": (200, 100)}
- screen["MineralienVar"] = {"text": "9", "position": (200, 200)}
-
- screen["Gifte"] = {"text": "Gifte", "position": (300, 100)}
- screen["GifteVar1"] = {"text": "3", "position": (300, 200)}
- screen["GifteVar2"] = {"text": "1", "position": (300, 300)}
- screen["GifteVar3"] = {"text": "8", "position": (300, 400)}
- screen["GifteVar4"] = {"text": "6", "position": (300, 500)}
-
- screen["Sandstein"] = {"text": "Sandstein", "position": (400, 100)}
- screen["SandsteinVar1"] = {"text": "3", "position": (400, 200)}
- screen["SandsteinVar2"] = {"text": "4", "position": (400, 300)}
- screen["SandsteinVar3"] = {"text": "5", "position": (400, 400)}
- screen["SandsteinVar4"] = {"text": "6", "position": (400, 500)}
+ screen["Algen"] = {"text": "Algen", "position": (400, 100)}
+ screen["AlgenVar"] = {"text": "3", "position": (400, 200)}
+ screen["Mineralien"] = {"text": "Mineralien", "position": (500, 100)}
+ screen["MineralienVar"] = {"text": "9", "position": (500, 200)}
+
+ screen["Gifte"] = {"text": "Gifte", "position": (600, 100)}
+ screen["GifteVar1"] = {"text": "3", "position": (600, 200)}
+ screen["GifteVar2"] = {"text": "1", "position": (600, 300)}
+ screen["GifteVar3"] = {"text": "8", "position": (600, 400)}
+ screen["GifteVar4"] = {"text": "6", "position": (600, 500)}
+
+ screen["Sandstein"] = {"text": "Sandstein", "position": (700, 100)}
+ screen["SandsteinVar1"] = {"text": "3", "position": (700, 200)}
+ screen["SandsteinVar2"] = {"text": "4", "position": (700, 300)}
+ screen["SandsteinVar3"] = {"text": "5", "position": (700, 400)}
+ screen["SandsteinVar4"] = {"text": "6", "position": (700, 500)}
diff --git a/modeling/model_init.py b/modeling/model_init.py
index d135007..66e74b1 100644
--- a/modeling/model_init.py
+++ b/modeling/model_init.py
@@ -187,7 +187,7 @@ def init():
op1="sub",
arg1_1=100,
arg1_1_idx=0,
- arg1_2="results",
+ arg1_2="Answers",
arg1_2_idx="max",
op2="add",
arg2_1="result1",
diff --git a/modeling/prod_numbers.py b/modeling/prod_numbers.py
index 0316691..5115f30 100644
--- a/modeling/prod_numbers.py
+++ b/modeling/prod_numbers.py
@@ -10,6 +10,7 @@ def number(Model):
isa math_goal
arg1 =num
ones1 None
+ expand_slot None
?retrieval>
state free
buffer empty
@@ -40,6 +41,7 @@ def number(Model):
==>
=g>
isa math_goal
+ expand_slot None
ones1 =one
tens1 =ten
hundreds1 =hun
@@ -56,6 +58,7 @@ def number(Model):
isa math_goal
arg2 =num
ones2 None
+ expand_slot None
?retrieval>
state free
buffer empty
@@ -86,6 +89,7 @@ def number(Model):
==>
=g>
isa math_goal
+ expand_slot None
ones2 =one
tens2 =ten
hundreds2 =hun
@@ -142,6 +146,7 @@ def number(Model):
=g>
isa math_goal
result =num
+ expand_slot None
~retrieval>
"""
)
diff --git a/modeling/prod_vis.py b/modeling/prod_vis.py
index 3ad5ccc..e70a4c7 100644
--- a/modeling/prod_vis.py
+++ b/modeling/prod_vis.py
@@ -15,6 +15,7 @@ def procedures(Model):
=g>
isa math_goal
op find_arg1_header
+ expand_slot busy
+visual_location>
isa _visuallocation
value =var
@@ -206,6 +207,7 @@ def procedures(Model):
op check_if_number_arg2_start
arg1 =arg1
vis_counter None
+ expand_slot None
~visual>
""",
)
@@ -502,6 +504,7 @@ def procedures(Model):
op check_if_number_arg2_start
arg1 =result
vis_counter None
+ expand_slot None
~visual>
~retrieval>
""",
@@ -799,6 +802,7 @@ def procedures(Model):
op check_if_number_arg2_start
arg1 =result
vis_counter None
+ expand_slot None
~visual>
~retrieval>
""",
@@ -815,6 +819,7 @@ def procedures(Model):
=g>
isa math_goal
op find_arg2_header
+ expand_slot busy
+visual_location>
isa _visuallocation
value =var
@@ -1007,6 +1012,7 @@ def procedures(Model):
op done
arg2 =arg2
vis_counter None
+ expand_slot None
~visual>
~retrieval>
""",
@@ -1304,6 +1310,7 @@ def procedures(Model):
op done
arg2 =result
vis_counter None
+ expand_slot None
~visual>
~retrieval>
""",
@@ -1601,6 +1608,7 @@ def procedures(Model):
op done
arg2 =result
vis_counter None
+ expand_slot None
~visual>
~retrieval>
""",
diff --git a/modeling/productions_math.py b/modeling/productions_math.py
index a064710..cbacfa0 100644
--- a/modeling/productions_math.py
+++ b/modeling/productions_math.py
@@ -80,31 +80,44 @@ def start():
environment_process=env.environment_process,
stimuli=envs,
# triggers="space",
- triggers="b"
+ triggers="b",
)
i = 1
userinput = ""
while True:
sim.step()
- if sim.current_event.time >= 40:
+ if sim.current_event.time >= 50:
print(sim.current_event)
break
if "KEY PRESSED" in sim.current_event.action:
userinput = userinput + sim.current_event.action.split(":")[1]
- if sim.current_event.action == "NO RULE FOUND":
- print(goal)
+ # if sim.current_event.action == "NO RULE FOUND":
+ # print(goal)
if sim.current_event.action == "KEY PRESSED: SPACE":
i += 1
print(userinput)
print("NEW PROC")
- goal.add(
- actr.makechunk("", "math_goal", proc=f"proc{i}", ones_carry="hello")
- )
+ if i <= 6:
+ goal.add(
+ actr.makechunk(
+ "", "math_goal", proc=f"proc{i}", ones_carry="hello"
+ )
+ )
+ elif i == 7:
+ goal.add(
+ actr.makechunk(
+ "", "math_goal", proc="proc_overall", ones_carry="hello"
+ )
+ )
+ elif i > 7:
+ print("DONE")
+ break
# sim.run(max_time=25)
print(userinput)
print("Simulation time: ", sim.show_time())
print("goal: ", goal)
+ print(sim.current_event)
# print(list(env))
# print("imaginal: ", imaginal)
# imaginal.show("hundreds_ans")