rename 'sandbox' to 'simulation'
This commit is contained in:
parent
2599cc424a
commit
fb0c90124b
|
|
@ -1,16 +1 @@
|
|||
from fn.op import foldr
|
||||
from SimCAD.configuration.utils.behaviorAggregation import dict_elemwise_sum
|
||||
|
||||
|
||||
configs = []
|
||||
|
||||
#Configuration(sim_config, state_dict, seed, exogenous_states, env_processes, mechanisms)
|
||||
class Configuration:
|
||||
def __init__(self, sim_config, state_dict, seed, exogenous_states, env_processes, mechanisms, behavior_ops=[foldr(dict_elemwise_sum())]):
|
||||
self.sim_config = sim_config
|
||||
self.state_dict = state_dict
|
||||
self.seed = seed
|
||||
self.exogenous_states = exogenous_states
|
||||
self.env_processes = env_processes
|
||||
self.behavior_ops = behavior_ops
|
||||
self.mechanisms = mechanisms
|
||||
configs = []
|
||||
|
|
@ -1,6 +1,20 @@
|
|||
from functools import reduce
|
||||
from fn.op import foldr
|
||||
import pandas as pd
|
||||
|
||||
from SimCAD.utils import key_filter
|
||||
from SimCAD.configuration.utils.behaviorAggregation import dict_elemwise_sum
|
||||
|
||||
#Configuration(sim_config, state_dict, seed, exogenous_states, env_processes, mechanisms)
|
||||
class Configuration:
|
||||
def __init__(self, sim_config, state_dict, seed, exogenous_states, env_processes, mechanisms, behavior_ops=[foldr(dict_elemwise_sum())]):
|
||||
self.sim_config = sim_config
|
||||
self.state_dict = state_dict
|
||||
self.seed = seed
|
||||
self.exogenous_states = exogenous_states
|
||||
self.env_processes = env_processes
|
||||
self.behavior_ops = behavior_ops
|
||||
self.mechanisms = mechanisms
|
||||
|
||||
class Identity:
|
||||
def __init__(self, behavior_id={'indentity': 0}):
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ from decimal import Decimal
|
|||
import numpy as np
|
||||
from datetime import timedelta
|
||||
|
||||
from SimCAD import Configuration, configs
|
||||
from SimCAD import configs
|
||||
from SimCAD.configuration import Configuration
|
||||
from SimCAD.configuration.utils import exo_update_per_ts, proc_trigger, bound_norm_random, \
|
||||
ep_time_step
|
||||
|
||||
seed = {
|
||||
'z': np.random.RandomState(1)
|
||||
}
|
||||
|
|
@ -2,7 +2,8 @@ from decimal import Decimal
|
|||
import numpy as np
|
||||
from datetime import timedelta
|
||||
|
||||
from SimCAD import Configuration, configs
|
||||
from SimCAD import configs
|
||||
from SimCAD.configuration import Configuration
|
||||
from SimCAD.configuration.utils import exo_update_per_ts, proc_trigger, bound_norm_random, \
|
||||
ep_time_step
|
||||
|
||||
|
|
@ -2,7 +2,8 @@ from decimal import Decimal
|
|||
import numpy as np
|
||||
from datetime import timedelta
|
||||
|
||||
from SimCAD import Configuration, configs
|
||||
from SimCAD import configs
|
||||
from SimCAD.configuration import Configuration
|
||||
from SimCAD.configuration.utils import exo_update_per_ts, proc_trigger, bound_norm_random, \
|
||||
ep_time_step
|
||||
|
||||
|
|
@ -2,7 +2,8 @@ from decimal import Decimal
|
|||
import numpy as np
|
||||
from datetime import timedelta
|
||||
|
||||
from SimCAD import Configuration, configs
|
||||
from SimCAD import configs
|
||||
from SimCAD.configuration import Configuration
|
||||
from SimCAD.configuration.utils import exo_update_per_ts, proc_trigger, bound_norm_random, \
|
||||
ep_time_step
|
||||
|
||||
|
|
@ -2,7 +2,8 @@ from decimal import Decimal
|
|||
import numpy as np
|
||||
from datetime import timedelta
|
||||
|
||||
from SimCAD import Configuration, configs
|
||||
from SimCAD import configs
|
||||
from SimCAD.configuration import Configuration
|
||||
from SimCAD.configuration.utils import exo_update_per_ts, proc_trigger, bound_norm_random, \
|
||||
ep_time_step
|
||||
|
||||
|
|
@ -2,7 +2,8 @@ from decimal import Decimal
|
|||
import numpy as np
|
||||
from datetime import timedelta
|
||||
|
||||
from SimCAD import Configuration, configs
|
||||
from SimCAD import configs
|
||||
from SimCAD.configuration import Configuration
|
||||
from SimCAD.configuration.utils import exo_update_per_ts, proc_trigger, bound_norm_random, \
|
||||
ep_time_step
|
||||
|
||||
|
|
@ -2,7 +2,8 @@ from decimal import Decimal
|
|||
import numpy as np
|
||||
from datetime import timedelta
|
||||
|
||||
from SimCAD import Configuration, configs
|
||||
from SimCAD import configs
|
||||
from SimCAD.configuration import Configuration
|
||||
from SimCAD.configuration.utils import exo_update_per_ts, proc_trigger, bound_norm_random, \
|
||||
ep_time_step
|
||||
|
||||
|
|
@ -2,10 +2,10 @@ import pandas as pd
|
|||
from tabulate import tabulate
|
||||
|
||||
from SimCAD.engine import ExecutionMode, ExecutionContext, Executor
|
||||
# from sandbox.validation import config1, config2
|
||||
# from sandbox.barlin import config4
|
||||
# from sandbox.zx import config_zx
|
||||
from sandbox.barlin import config6atemp #config6aworks,
|
||||
from simulations.validation import config1, config2
|
||||
# from simulations.barlin import config4
|
||||
# from simulations.zx import config_zx
|
||||
# from simulations.barlin import config6atemp #config6aworks,
|
||||
from SimCAD import configs
|
||||
|
||||
# ToDo: pass ExecutionContext with execution method as ExecutionContext input
|
||||
|
|
@ -24,13 +24,13 @@ 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)
|
||||
# # configs = [config1, config1]
|
||||
# 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)
|
||||
# configs = [config1, config1]
|
||||
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()
|
||||
|
|
@ -2,7 +2,8 @@ from decimal import Decimal
|
|||
import numpy as np
|
||||
from datetime import timedelta
|
||||
|
||||
from SimCAD import Configuration, configs
|
||||
from SimCAD import configs
|
||||
from SimCAD.configuration import Configuration
|
||||
from SimCAD.configuration.utils import exo_update_per_ts, proc_trigger, bound_norm_random, \
|
||||
ep_time_step
|
||||
|
||||
|
|
@ -2,7 +2,8 @@ from decimal import Decimal
|
|||
import numpy as np
|
||||
from datetime import timedelta
|
||||
|
||||
from SimCAD import Configuration, configs
|
||||
from SimCAD import configs
|
||||
from SimCAD.configuration import Configuration
|
||||
from SimCAD.configuration.utils import exo_update_per_ts, proc_trigger, bound_norm_random, \
|
||||
ep_time_step
|
||||
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
from fn.op import foldr
|
||||
from fn import _
|
||||
|
||||
from decimal import Decimal
|
||||
import numpy as np
|
||||
from datetime import timedelta
|
||||
|
||||
from SimCAD import Configuration, configs
|
||||
from SimCAD.configuration import exo_update_per_ts, proc_trigger, bound_norm_random, \
|
||||
from SimCAD import configs
|
||||
from SimCAD.configuration import Configuration
|
||||
from SimCAD.configuration.utils import exo_update_per_ts, proc_trigger, bound_norm_random, \
|
||||
ep_time_step
|
||||
|
||||
seed = {
|
||||
Loading…
Reference in New Issue