diff options
Diffstat (limited to 'modeling')
-rw-r--r-- | modeling/model_env.py | 31 | ||||
-rw-r--r-- | modeling/prod_procedure.py | 2 | ||||
-rw-r--r-- | modeling/prod_vis.py | 16 | ||||
-rw-r--r-- | modeling/productions_math.py | 9 |
4 files changed, 34 insertions, 24 deletions
diff --git a/modeling/model_env.py b/modeling/model_env.py index 473995e..fd262c6 100644 --- a/modeling/model_env.py +++ b/modeling/model_env.py @@ -1,31 +1,42 @@ #!/usr/bin/env python3 -def get_env(): +def generate_environments(): envs = [] screen = {} + generate_variables(screen) + # generate_procedures(screen) + envs.append(screen) + + return envs + + +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)} + + +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": "2", "position": (200, 200)} + screen["MineralienVar"] = {"text": "9", "position": (200, 200)} screen["Gifte"] = {"text": "Gifte", "position": (300, 100)} screen["GifteVar1"] = {"text": "3", "position": (300, 200)} - screen["GifteVar2"] = {"text": "8", "position": (300, 300)} - screen["GifteVar3"] = {"text": "1", "position": (300, 400)} + 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)} - - - envs.append(screen) - - return envs diff --git a/modeling/prod_procedure.py b/modeling/prod_procedure.py index 1a7628b..20921c9 100644 --- a/modeling/prod_procedure.py +++ b/modeling/prod_procedure.py @@ -127,7 +127,7 @@ def procedures(Model): """ ) - # direct cont from chech var1 + # direct cont from check var1 proc_check_substitute_var2_alt = Model.productionstring( name="proc_substitute_var2_alt", string=""" diff --git a/modeling/prod_vis.py b/modeling/prod_vis.py index bc1f0b4..3ad5ccc 100644 --- a/modeling/prod_vis.py +++ b/modeling/prod_vis.py @@ -15,8 +15,6 @@ def procedures(Model): =g> isa math_goal op find_arg1_header - ?visual_location> - attended False +visual_location> isa _visuallocation value =var @@ -50,7 +48,7 @@ def procedures(Model): +visual_location> isa _visuallocation screen_x =screen_x - screen_y closest + screen_y 200 +retrieval> isa number number 1 @@ -235,7 +233,7 @@ def procedures(Model): +visual_location> isa _visuallocation screen_x =screen_x - screen_y closest + screen_y 200 ~retrieval> """, ) @@ -532,7 +530,7 @@ def procedures(Model): +visual_location> isa _visuallocation screen_x =screen_x - screen_y closest + screen_y 200 ~retrieval> """, ) @@ -817,8 +815,6 @@ def procedures(Model): =g> isa math_goal op find_arg2_header - ?visual_location> - attended False +visual_location> isa _visuallocation value =var @@ -853,7 +849,7 @@ def procedures(Model): isa _visuallocation screen_x =screen_x screen_y ~=screen_y - screen_y closest + screen_y 200 +retrieval> isa number number 1 @@ -1039,7 +1035,7 @@ def procedures(Model): +visual_location> isa _visuallocation screen_x =screen_x - screen_y closest + screen_y 200 ~retrieval> """, ) @@ -1336,7 +1332,7 @@ def procedures(Model): +visual_location> isa _visuallocation screen_x =screen_x - screen_y closest + screen_y 200 ~retrieval> """, ) diff --git a/modeling/productions_math.py b/modeling/productions_math.py index aa22053..a064710 100644 --- a/modeling/productions_math.py +++ b/modeling/productions_math.py @@ -56,7 +56,7 @@ def start(): Model, DM, goal, imaginal, env = init() # add_goal(goal, op, arg1, arg2) add_proc(goal, "proc1") - envs = model_env.get_env() + envs = model_env.generate_environments() general_prod(Model) prod_procedure.procedures(Model) @@ -79,17 +79,20 @@ def start(): gui=False, environment_process=env.environment_process, stimuli=envs, - triggers="space", + # triggers="space", + triggers="b" ) i = 1 userinput = "" while True: sim.step() - if sim.current_event.time >= 20: + if sim.current_event.time >= 40: 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 == "KEY PRESSED: SPACE": i += 1 print(userinput) |