summaryrefslogtreecommitdiff
path: root/modeling/productions_math.py
diff options
context:
space:
mode:
Diffstat (limited to 'modeling/productions_math.py')
-rw-r--r--modeling/productions_math.py24
1 files changed, 20 insertions, 4 deletions
diff --git a/modeling/productions_math.py b/modeling/productions_math.py
index 07609bf..326b9c4 100644
--- a/modeling/productions_math.py
+++ b/modeling/productions_math.py
@@ -34,8 +34,8 @@ def add_proc(goal, proc):
def start():
condition = "fixed"
- training_N = 2
- test_N = 2
+ training_N = 1
+ test_N = 1
stimuli = model_env.Stimuli(condition, training_N=training_N, test_N=test_N)
@@ -54,6 +54,7 @@ def start():
# Model.model_parameters["subsymbolic"] = True
# Model.model_parameters["partial_matching"] = True
Model.model_parameters["activation_trace"] = True
+ Model.model_parameters["instantaneous_noise"] = .2
Model.model_parameters["utility_alpha"] = 0.5
Model.model_parameters["utility_noise"] = 0.5
Model.model_parameters["production_compilation"] = True
@@ -84,6 +85,8 @@ def start():
# triggers="space",
triggers="b",
)
+ # pprint(sim._Simulation__pr.rules)
+ # pprint(sim._Simulation__pr.ordered_rulenames)
i = 1
j = 1
phase = "training"
@@ -92,9 +95,9 @@ def start():
if j > training_N:
phase = "test"
sim.step()
- print(goal)
+ # print(goal)
if sim.current_event.time >= 900:
- print(sim.current_event)
+ pprint(sim.current_event)
break
if "KEY PRESSED" in sim.current_event.action:
if not stimuli.current_stimulus_id in userinput[phase]:
@@ -104,6 +107,10 @@ def start():
userinput[phase][stimuli.current_stimulus_id][str(i)].append(
sim.current_event.action.split(":")[1].strip()
)
+ if "RULE FIRED:" in sim.current_event.action and " and " in sim.current_event.action:
+ print("FIRED COMPILED RULE!!!!")
+ print(Model.productions[sim.current_event.action[12:]])
+ # break
if sim.current_event.action == "NO RULE FOUND":
print(goal)
if sim.current_event.action == "KEY PRESSED: SPACE":
@@ -147,6 +154,15 @@ def start():
# print(math_goals)
# pprint(Model.productions)
+ # for p in Model.productions:
+ # print(p)
+ # print(Model.productions[p])#.__setitem__("utility", 1)
+ # print("\n")
+ # print("#######used prods########")
+ # print(sim.ordered_rulenames)
+
+ pprint(sim._Simulation__pr.rules)
+ pprint(sim._Simulation__pr.ordered_rulenames)
if __name__ == "__main__":
start()