match format in configs

This commit is contained in:
Michael Zargham 2018-10-18 12:07:14 -07:00
parent 2f069a3a2e
commit 05a760f28d
4 changed files with 699 additions and 7 deletions

View File

@ -1,4 +1,4 @@
from ui.config import state_dict, mechanisms, exogenous_states, env_processes, sim_config from ui.configBC_Config import state_dict, mechanisms, exogenous_states, env_processes, sim_config
from engine.configProcessor import generate_config from engine.configProcessor import generate_config
from engine.mechanismExecutor import simulation from engine.mechanismExecutor import simulation
from engine.utils import flatten from engine.utils import flatten

692
notebooks/testBC.ipynb Normal file

File diff suppressed because one or more lines are too long

View File

@ -103,12 +103,12 @@ proc_one_coef_A = -delta
proc_one_coef_B = delta proc_one_coef_B = delta
def es3p1(step, sL, s, _input): def es3p1(step, sL, s, _input):
rv = bound_norm_random(seed['a'], proc_one_coef_A, proc_one_coef_B) rv = bound_norm_random(seed['a'], proc_one_coef_A, proc_one_coef_B)
s['Price'] = theta*s['Price'] * (Decimal('1')+rv) +(Decimal('1')-theta)*s['Pool']/s['Supply'] return ('Price', theta*s['Price'] * (Decimal('1')+rv) +(Decimal('1')-theta)*s['Pool']/s['Supply'] )
def es4p2(step, sL, s, _input): def es4p2(step, sL, s, _input):
s['Belief'] = alpha*s['Belief']+s['Pool']/s['Supply']*(Decimal('1')-alpha) return ('Belief', alpha*s['Belief']+s['Pool']/s['Supply']*(Decimal('1')-alpha))
def es5p2(step, sL, s, _input): # accept timedelta instead of timedelta params def es5p2(step, sL, s, _input): # accept timedelta instead of timedelta params
s['timestamp'] = ep_time_step(s, s['timestamp'], seconds=1) return ('timestamp', ep_time_step(s, s['timestamp'], seconds=1))
# Environment States # Environment States
#from numpy.random import randn as rn #from numpy.random import randn as rn

View File

@ -121,12 +121,12 @@ proc_one_coef_A = -delta
proc_one_coef_B = delta proc_one_coef_B = delta
def es3p1(step, sL, s, _input): def es3p1(step, sL, s, _input):
rv = bound_norm_random(seed['a'], proc_one_coef_A, proc_one_coef_B) rv = bound_norm_random(seed['a'], proc_one_coef_A, proc_one_coef_B)
s['Price'] = theta*s['Price'] * (Decimal('1')+rv) +(Decimal('1')-theta)*s['Pool']/s['Supply'] return ('Price', theta*s['Price'] * (Decimal('1')+rv) +(Decimal('1')-theta)*s['Pool']/s['Supply'] )
def es4p2(step, sL, s, _input): def es4p2(step, sL, s, _input):
s['Belief'] = alpha*s['Belief']+s['Pool']/s['Supply']*(Decimal('1')-alpha) return ('Belief', alpha*s['Belief']+s['Pool']/s['Supply']*(Decimal('1')-alpha))
def es5p2(step, sL, s, _input): # accept timedelta instead of timedelta params def es5p2(step, sL, s, _input): # accept timedelta instead of timedelta params
s['timestamp'] = ep_time_step(s, s['timestamp'], seconds=1) return ('timestamp', ep_time_step(s, s['timestamp'], seconds=1))
# Environment States # Environment States
#from numpy.random import randn as rn #from numpy.random import randn as rn