From 4cc180b9d4383ad24531adb2a2216b1f8873fd15 Mon Sep 17 00:00:00 2001 From: "Joshua E. Jodesty" Date: Mon, 26 Nov 2018 15:53:17 -0500 Subject: [PATCH] behavior id bug pt. 2 --- SimCAD/utils/configProcessor.py | 2 +- sandboxUX/config2.py | 4 ++-- sandboxUX/config3.py | 37 ++++++++++++++++----------------- sandboxUX/sim_test.py | 21 ++++++++++--------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/SimCAD/utils/configProcessor.py b/SimCAD/utils/configProcessor.py index 254c532..c482e5b 100644 --- a/SimCAD/utils/configProcessor.py +++ b/SimCAD/utils/configProcessor.py @@ -12,7 +12,7 @@ def state_identity(k): # fix def b_identity(step, sL, s): - return {'identity': 0} + return {'indentity': 0} def behavior_identity(k): diff --git a/sandboxUX/config2.py b/sandboxUX/config2.py index 785331e..5f41574 100644 --- a/sandboxUX/config2.py +++ b/sandboxUX/config2.py @@ -130,7 +130,7 @@ mechanisms = { "m1": { "behaviors": { "b1": b1m1, # lambda step, sL, s: s['s1'] + 1, - "b2": b2m1 + # "b2": b2m1 }, "states": { # exclude only. TypeError: reduce() of empty sequence with no initial value "s1": s1m1, @@ -140,7 +140,7 @@ mechanisms = { "m2": { "behaviors": { "b1": b1m2, - "b2": b2m2 + # "b2": b2m2 }, "states": { "s1": s1m2, diff --git a/sandboxUX/config3.py b/sandboxUX/config3.py index 3b3f2b0..b8b838d 100644 --- a/sandboxUX/config3.py +++ b/sandboxUX/config3.py @@ -101,7 +101,7 @@ def s3m1(step, sL, s, _input): def s4m2(step, sL, s, _input): y = 'Sell_Log' - x = _input['sell_order1'] #+ _input['sell_order2'] # / Psignal_int + x = _input['sell_order1'] + _input['sell_order2'] # / Psignal_int return (y, x) @@ -169,8 +169,7 @@ def env_proc_id(x): return x env_processes = { - "P_Ext_Markets": env_proc_id, - "timestamp": env_proc_id + # "P_Ext_Markets": env_proc_id } exogenous_states = exo_update_per_ts( @@ -197,22 +196,22 @@ mechanisms = { "Buy_Log": s3m1 } }, - # "m2": { - # "behaviors": { - # "b1": b1m2, - # # "b4": b4m2 - # }, - # "states": { - # "Sell_Log": s4m2 - # } - # }, - # "m3": { - # "behaviors": { - # }, - # "states": { - # "Price": s2m3 - # } - # } + "m2": { + "behaviors": { + "b1": b1m2, + "b4": b4m2 + }, + "states": { + "Sell_Log": s4m2 + } + }, + "m3": { + "behaviors": { + }, + "states": { + "Price": s2m3 + } + } } configs.append(Configuration(sim_config, state_dict, seed, exogenous_states, env_processes, mechanisms)) \ No newline at end of file diff --git a/sandboxUX/sim_test.py b/sandboxUX/sim_test.py index 80507f5..37775c3 100644 --- a/sandboxUX/sim_test.py +++ b/sandboxUX/sim_test.py @@ -3,6 +3,7 @@ from tabulate import tabulate from SimCAD.engine import ExecutionMode, ExecutionContext, Executor # from sandboxUX import config1, config2 +from sandboxUX import config3 from SimCAD import configs # ToDo: pass ExecutionContext with execution method as ExecutionContext input @@ -19,13 +20,13 @@ run1_raw_result = run1.main() result = pd.DataFrame(run1_raw_result) print(tabulate(result, headers='keys', tablefmt='psql')) print() - -print("Simulation Run 2: Pairwise Execution") -print() -multi_proc_ctx = ExecutionContext(exec_mode.multi_proc) -run2 = Executor(multi_proc_ctx, configs) -run2_raw_results = run2.main() -for raw_result in run2_raw_results: - result = pd.DataFrame(raw_result) - print(tabulate(result, headers='keys', tablefmt='psql')) -print() \ No newline at end of file +# +# print("Simulation Run 2: Pairwise Execution") +# print() +# multi_proc_ctx = ExecutionContext(exec_mode.multi_proc) +# run2 = Executor(multi_proc_ctx, configs) +# run2_raw_results = run2.main() +# for raw_result in run2_raw_results: +# result = pd.DataFrame(raw_result) +# print(tabulate(result, headers='keys', tablefmt='psql')) +# print() \ No newline at end of file