diff options
author | Niclas Dobbertin <niclas.dobbertin@mailbox.org> | 2024-06-27 22:31:33 +0200 |
---|---|---|
committer | Niclas Dobbertin <niclas.dobbertin@mailbox.org> | 2024-06-27 22:31:33 +0200 |
commit | 6a0b7dad008cb8a9e48ade0dceb49082e1349c30 (patch) | |
tree | 46241ff78b6905e2a1339fc7608299fdf760e632 | |
parent | eb2e5ca2ffa74e3dd2579dcb70a347e6cd481545 (diff) |
update
-rw-r--r-- | modeling/prod_multi.py | 49 | ||||
-rw-r--r-- | modeling/prod_vis.py | 10 | ||||
-rw-r--r-- | modeling/productions_math.py | 6 |
3 files changed, 51 insertions, 14 deletions
diff --git a/modeling/prod_multi.py b/modeling/prod_multi.py index 9009f6b..9b55f2a 100644 --- a/modeling/prod_multi.py +++ b/modeling/prod_multi.py @@ -99,7 +99,7 @@ def multiplication(Model): =g> isa math_goal op done - """ + """, ) mul_continue = Model.productionstring( @@ -128,10 +128,9 @@ def multiplication(Model): op add arg1 =arg2 arg2 =result - """ + """, ) - mul_step_failure = Model.productionstring( name="mul_step_failure", string=""" @@ -152,15 +151,14 @@ def multiplication(Model): isa math_goal nextop mul op add - arg1 =arg2 + arg1 =arg arg2 =result ones1 None - ones1 None - ones1 None - ones1 None - ones1 None - ones1 None - ones1 None + tens1 None + hundreds1 None + ones2 None + tens2 None + hundreds2 None +retrieval> isa math_op op add @@ -169,5 +167,36 @@ def multiplication(Model): """, ) + mul_step_failure_return = Model.productionstring( + name="mul_step_failure_return", + string=""" + =g> + isa math_goal + op mul + arg1 =mul + arg2 =arg + ones2 =ones + tens2 =tens + hundreds2 =huns + mul_counter =mul_counter + result =result + =retrieval> + isa math_op + op add + arg1 =arg + arg2 =result + result =sum + ==> + =g> + isa math_goal + result =sum + +retrieval> + isa math_op + op add + arg1 =mul_counter + arg2 1 + """, + ) + prods.append(mul_start) return prods diff --git a/modeling/prod_vis.py b/modeling/prod_vis.py index 4fc1883..31e53ca 100644 --- a/modeling/prod_vis.py +++ b/modeling/prod_vis.py @@ -62,6 +62,7 @@ def procedures(Model): op search_arg1_idx arg1 =var arg1_idx =idx + vis_counter 1 vis_counter ~=idx vis_counter =vis_counter =visual_location> @@ -82,7 +83,7 @@ def procedures(Model): +visual_location> isa _visuallocation screen_x =screen_x - screen_y closest + screen_y 300 +retrieval> isa number number =next @@ -97,6 +98,7 @@ def procedures(Model): op search_arg1_idx arg1 =var arg1_idx =idx + vis_counter 2 vis_counter ~=idx vis_counter =vis_counter =visual_location> @@ -132,6 +134,7 @@ def procedures(Model): op search_arg1_idx arg1 =var arg1_idx =idx + vis_counter 3 vis_counter ~=idx vis_counter =vis_counter =visual_location> @@ -164,6 +167,7 @@ def procedures(Model): string=""" =g> isa math_goal + op search_arg1_idx arg1_idx =idx vis_counter =idx =visual_location> @@ -266,6 +270,7 @@ def procedures(Model): op search_arg2_idx arg2 =var arg2_idx =idx + vis_counter 1 vis_counter ~=idx vis_counter =vis_counter =visual_location> @@ -301,6 +306,7 @@ def procedures(Model): op search_arg2_idx arg2 =var arg2_idx =idx + vis_counter 2 vis_counter ~=idx vis_counter =vis_counter =visual_location> @@ -336,6 +342,7 @@ def procedures(Model): op search_arg2_idx arg2 =var arg2_idx =idx + vis_counter 3 vis_counter ~=idx vis_counter =vis_counter =visual_location> @@ -369,6 +376,7 @@ def procedures(Model): string=""" =g> isa math_goal + op search_arg2_idx arg2_idx =idx vis_counter =idx =visual_location> diff --git a/modeling/productions_math.py b/modeling/productions_math.py index 90dcffb..5687ba9 100644 --- a/modeling/productions_math.py +++ b/modeling/productions_math.py @@ -88,8 +88,8 @@ def init(): "procedure", proc="proc1", op1="add", - arg1_1="Algen", - arg1_1_idx=1, + arg1_1="Gifte", + arg1_1_idx=4, arg1_2="Sandstein", arg1_2_idx=4, op2="mul", @@ -215,7 +215,7 @@ def start(): # sim.step() # if sim.current_event.action == "KEY PRESSED: SPACE": # break - sim.run(max_time=4) + sim.run(max_time=8) print("Simulation time: ", sim.show_time()) print("goal: ", goal) # print(list(env)) |