behavior id bug pt. 2

This commit is contained in:
Joshua E. Jodesty 2018-11-26 15:53:17 -05:00
parent d46e9ad255
commit 4cc180b9d4
4 changed files with 32 additions and 32 deletions

View File

@ -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):

View File

@ -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,

View File

@ -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))

View File

@ -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()
#
# 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()