# import libraries from decimal import Decimal import numpy as np from datetime import timedelta from cadCAD.configuration import append_configs from cadCAD.configuration.utils import bound_norm_random, ep_time_step, config_sim seeds = { # 'z': np.random.RandomState(1), # 'a': np.random.RandomState(2) } sim_config = config_sim({ 'T': range(10), #number of discrete iterations in each experiement 'N': 1, #number of times the simulation will be run (Monte Carlo runs) #'M': g #parameter sweep dictionary }) # define the time deltas for the discrete increments in the model # ts_format = '%Y-%m-%d %H:%M:%S' # t_delta = timedelta(days=0, minutes=1, seconds=0) # def time_model(_g, step, sL, s, _input): # y = 'time' # x = ep_time_step(s, dt_str=s['time'], fromat_str=ts_format, _timedelta=t_delta) # return (y, x) # Behaviors def robot_arm(_g, step, sL, s): add_to_A = 0 if (s['box_A'] > s['box_B']): add_to_A = -1 elif (s['box_A'] < s['box_B']): add_to_A = 1 return({'add_to_A': add_to_A, 'add_to_B': -add_to_A}) robots_probabilities = [0.5,1/3] # Robot 1 acts with a 50% probability; Robot 2, 33.33% def robot_arm_1(_g, step, sL, s): _robotId = 1 if np.random.rand()