Revert "Merge remote-tracking branch 'origin/staging' into mz-dead"

This reverts commit 4113fb4202, reversing
changes made to 8f35856348.
This commit is contained in:
Michael Zargham 2018-10-18 09:11:49 -07:00
parent 4587c377f9
commit 249dfc22e3
8 changed files with 12 additions and 36 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -21,12 +21,8 @@ def mech_step(m_step, sL, state_funcs, behavior_funcs, env_processes, t_step):
_input = getBehaviorInput(m_step, sL, last_in_obj, behavior_funcs) _input = getBehaviorInput(m_step, sL, last_in_obj, behavior_funcs)
# OLD: no bueno! Mutation Bad for f in state_funcs:
# for f in state_funcs: f(m_step, sL, last_mut_obj, _input)
# f(m_step, sL, last_mut_obj, _input)
# New
last_mut_obj = dict([ f(m_step, sL, last_mut_obj, _input) for f in state_funcs ])
apply_env_proc(env_processes, last_mut_obj, last_mut_obj['timestamp']) apply_env_proc(env_processes, last_mut_obj, last_mut_obj['timestamp'])

View File

@ -1,4 +1,2 @@
from engine import run from engine import run
from tabulate import tabulate run.main()
result = run.main()
print(tabulate(result, headers='keys', tablefmt='psql'))

View File

@ -29,47 +29,29 @@ def b2m3(step, sL, s):
# Internal States per Mechanism # Internal States per Mechanism
def s1m1(step, sL, s, _input): def s1m1(step, sL, s, _input):
y = 's1' s['s1'] = s['s1'] + _input
x = s['s1'] + _input
return (y, x)
def s2m1(step, sL, s, _input): def s2m1(step, sL, s, _input):
y = 's2' s['s2'] = s['s2'] + _input
x = s['s2'] + _input
return (y, x)
def s1m2(step, sL, s, _input): def s1m2(step, sL, s, _input):
y = 's1' s['s1'] = s['s1'] + _input
x = s['s1'] + _input
return (y, x)
def s2m2(step, sL, s, _input): def s2m2(step, sL, s, _input):
y = 's2' s['s2'] = s['s2'] + _input
x = s['s2'] + _input
return (y, x)
def s1m3(step, sL, s, _input): def s1m3(step, sL, s, _input):
y = 's1' s['s1'] = s['s1'] + _input
x = s['s1'] + _input
return (y, x)
def s2m3(step, sL, s, _input): def s2m3(step, sL, s, _input):
y = 's2' s['s2'] = s['s2'] + _input
x = s['s2'] + _input
return (y, x)
# Exogenous States # Exogenous States
proc_one_coef_A = 0.7 proc_one_coef_A = 0.7
proc_one_coef_B = 1.3 proc_one_coef_B = 1.3
def es3p1(step, sL, s, _input): def es3p1(step, sL, s, _input):
y = 's3' s['s3'] = s['s3'] * bound_norm_random(seed['a'], proc_one_coef_A, proc_one_coef_B)
x = s['s3'] * bound_norm_random(seed['a'], proc_one_coef_A, proc_one_coef_B)
return (y, x)
def es4p2(step, sL, s, _input): def es4p2(step, sL, s, _input):
y = 's4' s['s4'] = s['s4'] * bound_norm_random(seed['b'], proc_one_coef_A, proc_one_coef_B)
x = s['s4'] * bound_norm_random(seed['b'], proc_one_coef_A, proc_one_coef_B)
return (y, x)
def es5p2(step, sL, s, _input): # accept timedelta instead of timedelta params def es5p2(step, sL, s, _input): # accept timedelta instead of timedelta params
y = 'timestamp' s['timestamp'] = ep_time_step(s, s['timestamp'], seconds=1)
x = ep_time_step(s, s['timestamp'], seconds=1)
return (y, x)
# Environment States # Environment States
def env_a(x): def env_a(x):