def __init__(self): """Need to input: eta_priori eta_check """ # inherit parent class methods and properties super().__init__() self.n = 0 # type of danger threshold (d - point estimate or p - probabilistic) self.perception_list = MyDanger.define_options() # default is POINT estimate self.perception = self.perception_list[0] # will change with every interaction self.name_folder = '' self.path_folder = '' d = datetime.datetime.today() self.monthday = str(d.month).zfill(2) + str(d.day).zfill(2) # configurations # danger self.danger_constraints = True self.danger_kill = True self.prob_kill = MyDanger.exp_prob_kill(3) # team thresholds self.homogeneous_team = False # estimate self.true_priori = False self.true_estimate = False self.fov = True self.mva_conservative = True # self.prob_id = 'h' # keep self.parent_path = '' self.set_parent_path() # danger threshold for the searchers self.kappa = list() self.alpha = list() # a priori knowledge of danger # eta_priori[v] = [eta_l1,... eta_l5] self.danger_priori = None # ground truth eta_check[v] \in {1,..5} self.danger_true = None # self.danger_hat = None self.percentage_img = None self.human_gt = False self.all_descriptions = False self.log_file = False self.danger_levels, self.n_levels, self.level_label, self.level_color = MyDanger.define_danger_levels( )
def test_argmax_eta(): eta_v = [0.1, 0.3, 0.3, 0.2, 0.1] z_list = MyDanger.argmax_eta(eta_v) assert MyDanger.sum_1(eta_v) is True assert z_list == [2, 3] eta_v = [0.1, 0.2, 0.3, 0.2, 0.2] z_list = MyDanger.argmax_eta(eta_v) assert MyDanger.sum_1(eta_v) is True assert z_list == [3]
def __init__(self, searcher_id: int, v0: int, g, capture_range=0, zeta=None, my_seed=None): # note: init overrides parent class init # inherit parent class methods and properties super().__init__(searcher_id, v0, g, capture_range, zeta, my_seed) self.danger_levels = MyDanger.define_danger_levels()[0] # initial thresholds # danger threshold self.kappa = 3 self.alpha = 0.95 # type of danger threshold (d - deterministic or p - probabilistic) self.danger_perception = None # store danger and beliefs values for vertices visited self.path_kappa = dict() # life status self.alive = True self.mva = False # original id self.id_0 = searcher_id
def load_eta_values(self): """load the actual values from file""" k = 0 for f_name in self.danger_files: self.eta_values[k] = bf.is_list(MyDanger.load_danger_data(f_name)) k += 1
def test_frequentist(): img1 = [0.1, 0.1, 0.6, 0.1, 0.1] img2 = [0.1, 0.1, 0.6, 0.1, 0.1] img3 = [0.1, 0.1, 0.6, 0.1, 0.1] assert MyDanger.sum_1(img1) is True assert MyDanger.sum_1(img2) is True assert MyDanger.sum_1(img3) is True xi = dict() xi[1] = [img1, img2, img3] eta_hat, z_hat = MyDanger.compute_frequentist(xi) assert z_hat[0] == 3 assert eta_hat[0] == [0.1, 0.1, 0.6, 0.1, 0.1]
def plot_only(): extension = '.pkl' folder_path = MyDanger.get_folder_path('data_compiled') low_prob = ['1010NCDKHT-s-100', '1010DCDKHT-s-100'] high_prob = ['1009NCDKHT-b-100', '1009NCDKHT-b-05', '1010DCDKHT-b-100', '1010DCDKHT-b-05'] f_names = low_prob success_rate = [] casualty_mission_rate = [] avg_mission_time = [] casualty_mvp = [] for f_name in f_names: f_path = folder_path + '/' + f_name + extension stats = bf.load_pickle_file(f_path) # --- stats.print_name(stats.parent_name, '--\nStats for') stats.print_final_stats() success_rate.append(copy.deepcopy(stats.cum_success_rate)) casualty_mission_rate.append(copy.deepcopy(stats.cum_casualty_mission_rate)) avg_mission_time.append(copy.deepcopy(stats.cum_mission_time)) casualty_mvp.append(copy.deepcopy(stats.cum_casualty_mvp_rate)) print(stats.prob_kill) del stats rp = RiskPlot() for success in success_rate: rp.add_stats(success) rp.plot_stat() rp.clear_list() # for avg_time in avg_mission_time: rp.add_stats(avg_time) # rp.plot_stat() rp.clear_list() for casual in casualty_mission_rate: rp.add_stats(casual) rp.plot_stat() rp.clear_list() for mvp in casualty_mvp: rp.add_stats(mvp) rp.plot_stat() rp.clear_list()
def test_z_from_eta(): eta1 = [0.1, 0.3, 0.3, 0.2, 0.1] eta2 = [0.3, 0.3, 0.3, 0.05, 0.05] b = MyDanger.sum_1(eta1) c = MyDanger.sum_1(eta2) assert b is True assert c is True # mean op1 = 1 z1 = MyDanger.z_from_eta(eta1, op1) assert z1 == 3 z1 = MyDanger.z_from_eta(eta2, op1) assert z1 == 2 # max op2 = 2 z2 = MyDanger.z_from_eta(eta1, op2) assert z2 == 3 z2 = MyDanger.z_from_eta(eta2, op2) assert z2 == 3 # min kappa op3 = 3 kappa1 = [2] kappa2 = [3] z3 = MyDanger.z_from_eta(eta1, op3, kappa1) z4 = MyDanger.z_from_eta(eta1, op3, kappa2) assert z3 == 2 assert z4 == 3 eta_1 = MyDanger.eta_from_z(z1) assert eta_1 == [0.1, 0.6, 0.1, 0.1, 0.1] eta = [0.2, 0.2, 0.2, 0.2, 0.2] k = 3 z = MyDanger.z_from_eta(eta, 4, k) assert z == 4
def __init__(self): self.handle = None self.graph_vertices = 'School_Image_VGraph' self.graph_edges = 'School_Image_EGraph' self.f_name = 'saved_data.pkl' self.n = 46 self.danger_files = [] self.eta_values = dict() self.z_values = dict() self.levels, self.n_levels, self.level_label, self.level_color = MyDanger.define_danger_levels() # data # to be updated for each parent folder self.parent = '' self.belief, self.target, self.team, self.solver_data, self.danger, self.mission, self.specs = self.empty_dicts(7) self.percentages = [] self.configs = [] self.n_runs = 200 self.instances = [] # folders self.parent_folders = [] # parent folders as keys self.instance_folders = dict() # stats self.casualties = dict() self.mission_time = dict() self.killed_info = dict() self.success = dict() self.failure = dict() self.deadline_reached = dict() self.team_killed = dict() self.v_sort = dict() self.z_sort = dict() self.v_fatal = dict() self.z_fatal = dict() self.v_bleak = [] self.v_times = [] self.z_cause = [] self.k_team = [] self.casualties_kappa = dict() self.avg_time = [] self.prob_kill = []
def test_compute_H(): eta = [0.1, 0.3, 0.4, 0.7, 0.9] a = MyDanger.sum_1(eta) assert a is False eta = [0.1, 0.3, 0.2, 0.2, 0.2] b = MyDanger.sum_1(eta) assert b is True list_k = [2, 4] # sum for each level H2 = MyDanger.compute_H(eta) assert H2 == [0.1, 0.4, 0.6, 0.8, 1.0] H1 = MyDanger.get_H_for_team(H2, list_k) H3 = MyDanger.compute_H_for_team(eta, list_k) my_sum2 = 0.1 + 0.3 my_sum4 = 0.1 + 0.3 + 0.2 + 0.2 assert H1 == [my_sum2, my_sum4] == H3
def plot_graph_school(self): bloat = True per_list = [per for per in self.z_values.keys()] n_sub = len(per_list) for i in range(n_sub): if i == 0: continue fig = plt.figure(figsize=(6, 4), dpi=200) # fig_1, ax_arr = plt.subplots(1, 1, figsize=(9, 5), dpi=150) mg.plot_ss2(bloat, True, 'dimgray') mg.plot_graph(bloat, True, True) V = ff.get_info(self.graph_vertices, 'V') danger = True if danger: colors = self.get_vertices_color(per_list[i]) for v in V: vidx = V.index(v) my_color = colors[vidx] self.plot_points([v], my_color, 'o', 6) xy = [0.125, 0.15] rpf.my_hazard_labels(fig, xy, 14) plt.xlim(right=72, left=-7) # adjust the right leaving left unchanged plt.ylim(bottom=-0.5, top=59) plt.axis('off') my_str = 'School Scenario' #'Danger Graph, ' + str(per_list[i]) + '\% images' # plt.title(my_str, fontsize=20, weight='heavy') # save fig fig_path = MyDanger.get_folder_path('figs') fig_name = fig_path + '/ss2' + '.pdf' fig.savefig(fig_name, bbox_inches='tight') fig_name = 'danger_graph_' + str(per_list[i]) mg.save_plot(fig_name, 'figs', '.pdf')
def assemble_parent_name(datename: str, config: str, extra_id='', probname='h'): parent_name = datename + config + '-' + probname + '-' + extra_id data_saved_path = MyDanger.get_folder_path('data_saved') parent_path = data_saved_path + '/' + parent_name # check if folder exists if not os.path.exists(parent_path): exit(print('Parent folder %s does not exist.' % parent_name)) return parent_name, parent_path
def test_eta_from_z(): list_z = [1, 1, 2, 3, 4, 5] eta = [] for z in list_z: eta_v = MyDanger.eta_from_z(z, 1.0) eta.append(eta_v) assert eta[0] == [1, 0, 0, 0, 0] assert eta[1] == [1, 0, 0, 0, 0] assert eta[2] == [0, 1, 0, 0, 0] assert eta[3] == [0, 0, 1, 0, 0] assert eta[4] == [0, 0, 0, 1, 0] assert eta[5] == [0, 0, 0, 0, 1]
def get_specs_prob(): specs = MyInputs2() # test graph specs.set_graph(4) # solver parameter: central x distributed specs.set_solver_type('distributed') # target motion specs.set_target_motion('static') # searchers' detection: capture range and false negatives m = 2 specs.set_capture_range(0) specs.set_size_team(m) # position v0 = [1, 1] specs.set_start_searchers(v0) b_0 = [0.0 for i in range(10)] b_0[8] = 0.5 b_0[6] = 0.5 specs.set_b0(b_0) # time-step stuff: deadline mission (tau), planning horizon (h), re-plan frequency (theta) h = 3 specs.set_all_times(h) specs.set_theta(1) # solver timeout (in sec) specs.set_timeout(10) # danger stuff specs.set_threshold([3, 4], 'kappa') specs.set_danger_perception('prob') specs.set_threshold([0.9, 0.9], 'alpha') eta_true = [1, 3, 3, 4, 5, 3, 4, 4, 1] # transform in distribution eta_priori = [] for level in eta_true: eta = MyDanger.eta_from_z(level, 1) eta_priori.append(eta) specs.set_danger_data(eta_true, 'true') specs.set_danger_data(eta_priori, 'priori') return specs
def test_compute_apriori(): n = 4 op_avg = 1 op_conservative = 2 op_min_k = 3 op_mva = 4 # default with weighted avg my_eta1 = None eta0_0, z0_0 = MyDanger.compute_from_value(n, my_eta1, op_avg) assert z0_0 == [3, 3, 3, 3] for v_idx in range(n): assert z0_0[v_idx] == 3 assert eta0_0[v_idx] == [0.2, 0.2, 0.2, 0.2, 0.2] k = 3 eta0_0, z0_0 = MyDanger.compute_from_value(n, my_eta1, op_mva, k) for v_idx in range(n): assert z0_0[v_idx] == 4 assert eta0_0[v_idx] == [0.2, 0.2, 0.2, 0.2, 0.2] # one danger for all vertices my_eta2 = 2 eta0_0, z0_0 = MyDanger.compute_from_value(n, my_eta2, op_avg) assert z0_0 == [2, 2, 2, 2] for v_idx in range(n): assert z0_0[v_idx] == 2 assert eta0_0[v_idx] == [0.1, 0.6, 0.1, 0.1, 0.1] # one danger level for each vertex my_eta3 = [1, 2, 3, 5] eta0_0, z0_0 = MyDanger.compute_from_value(n, my_eta3, op_avg) assert z0_0 == [1, 2, 3, 5] assert eta0_0[0] == [0.6, 0.1, 0.1, 0.1, 0.1] assert eta0_0[1] == [0.1, 0.6, 0.1, 0.1, 0.1] assert eta0_0[2] == [0.1, 0.1, 0.6, 0.1, 0.1] assert eta0_0[3] == [0.1, 0.1, 0.1, 0.1, 0.6] # prob for each vertex my_eta4 = [[0.1, 0.2, 0.3, 0.3, 0.1], [0.3, 0.1, 0.3, 0.1, 0.2], [0.1, 0.2, 0.3, 0.3, 0.1], [0.1, 0.2, 0.3, 0.3, 0.1]] eta0_0, z0_0 = MyDanger.compute_from_value(n, my_eta4, op_conservative) assert z0_0 == [4, 3, 4, 4] for v_idx in range(n): assert eta0_0[v_idx] == my_eta4[v_idx] # break ties - z == min k value z = MyDanger.z_from_eta(eta0_0[0], op_min_k, [3, 4, 5]) assert z == 3
def get_save_path(f_name: str): data_compiled_path = MyDanger.get_folder_path('data_compiled') save_path = data_compiled_path + '/' + f_name return save_path
def set_z_values(self): for per in self.eta_values.keys(): eta = self.eta_values.get(per) z = MyDanger.compute_all_z(eta, 1) self.z_values[per] = z
def load_eta_values(self): """load the actual values from file""" for f_name in self.danger_files: per = int(f_name.split('_')[-1]) self.eta_values[per] = bf.is_list(MyDanger.load_danger_data(f_name))
def default_danger_data(self): self.danger_priori, _ = MyDanger.compute_from_value(self.n, 1, None) self.danger_true, _ = MyDanger.compute_from_value(self.n, 1, None)
def plot_graph_school(self): bloat = True per_list = [per for per in self.z_values.keys()] n_sub = len(per_list) for i in range(n_sub): # if i == 0: # continue fig = plt.figure(figsize=(6, 4), dpi=200) # fig_1, ax_arr = plt.subplots(1, 1, figsize=(9, 5), dpi=150) mg.plot_ss2(bloat, True, 'darkgray') mg.plot_graph(bloat, True, True) V = ff.get_info(self.graph_vertices, 'V') danger = True if danger: colors = self.get_vertices_color(per_list[i]) for v in V: vidx = V.index(v) my_color = colors[vidx] self.plot_points([v], my_color, 'o', 13) # 6 xy = [0.15, 0.15] # [0.125, 0.15] if i < 1: rpf.my_hazard_labels(fig, xy, 12) ha = 0.88 wa = 0.73 xy2 = [[0.725, 0.515], [0.135, 0.799], [0.27, 0.81], [0.45, ha], [0.57, ha], [0.69, ha], [0.8, ha], [wa, 0.585], [wa, 0.635], [wa, 0.685], [0.90, 0.6]] rooms = [ 'GYM', 'CAFE', 'HALL 2', 'CLASS D', 'CLASS C', 'CLASS B', 'CLASS A', 'STGE', 'WC1', 'WC2', 'HALL 1' ] rpf.my_rooms_label(fig, xy2, rooms, 9) plt.xlim(right=72, left=-7) # adjust the right leaving left unchanged plt.ylim(bottom=-0.5, top=59) plt.axis('off') my_str = 'School Scenario' # save fig fig_path = MyDanger.get_folder_path('figs') fig_name = fig_path + '/ss2' + '.pdf' fig.savefig(fig_name, bbox_inches='tight') fig_name = 'danger_graph_' + str(per_list[i]) mg.save_plot(fig_name, 'figs', '.pdf')
def test_create_and_estimate(): specs = get_specs() eta_true = [1, 3, 3, 4, 5, 3, 4, 4, 1] eta_priori = [2, 2, 2, 3, 3, 3, 2, 2, 2] specs.set_danger_data(eta_true, 'true') specs.set_danger_data(eta_priori, 'priori') g = specs.graph danger_true = specs.danger_true danger_priori = specs.danger_priori assert danger_true == [1, 3, 3, 4, 5, 3, 4, 4, 1] assert danger_priori == [2, 2, 2, 3, 3, 3, 2, 2, 2] # will set lookup equal to a priori eta_hat_2 = 0 # create class danger = MyDanger(g) # set danger values (ground truth, estimate and a priori) danger.set_true(danger_true) danger.set_priori(danger_priori) danger.set_lookup(eta_hat_2) danger.set_hat_0() assert danger.n == len(g.vs) assert danger.z0_0 == danger_priori assert danger.z == danger_true assert danger.perception == 'point' assert danger.z_hat == danger_priori assert danger.lookup_z_hat == danger_priori del danger # ---------------------------------------------------------- # will set estimate lookup equal to true value eta_hat_1 = None # create class danger = MyDanger(g) # set danger values (ground truth, estimate and a priori) danger.set_true(danger_true) danger.set_priori(danger_priori) danger.set_lookup(eta_hat_1) danger.set_hat_0() assert danger.n == len(g.vs) assert danger.z0_0 == danger_priori assert danger.z == danger_true assert danger.perception == 'point' assert danger.z_hat == danger_priori assert danger.lookup_z_hat == danger_true for v in range(1, danger.n + 1): v_idx = v - 1 assert danger.get_z(v) == danger_true[v_idx] assert danger.get_zhat(v) == danger_priori[v_idx] # lookup table: equal to true value (eta_hat_1 = None) eta_hat, z_hat, H_hat = danger.get_from_lookup(v) assert z_hat == danger_true[v_idx] # test estimate function op_test = True danger.set_use_fov(True, op_test) visited_vertices = [1] danger.estimate(visited_vertices) danger_estimate = [1, 1, 2, 1, 3, 3, 2, 2, 2] for v in range(1, 10): assert danger.get_z(v) == danger_true[v - 1] assert danger.get_zhat(v) == danger_estimate[v - 1] visited_vertices = [1, 2] danger.estimate(visited_vertices) danger_estimate = [1, 3, 3, 1, 3, 3, 2, 2, 2] for v in range(1, 10): assert danger.get_z(v) == danger_true[v - 1] assert danger.get_zhat(v) == danger_estimate[v - 1] visited_vertices = [1, 3] danger.estimate(visited_vertices) danger_estimate = [1, 1, 3, 1, 3, 3, 2, 2, 2] for v in range(1, 10): assert danger.get_z(v) == danger_true[v - 1] assert danger.get_zhat(v) == danger_estimate[v - 1]
def set_z_values(self): for k in self.eta_values.keys(): eta = self.eta_values.get(k) z = MyDanger.compute_all_z(eta, 1) self.z_values[k] = z
def plot_error_point_only(self, plot_n=0): # get padding self.set_x_ticks() self.set_title() self.set_lgd(plot_n) fig = plt.figure() ax = fig.add_subplot(111) colors = ['bo', 'ks', 'ro'] my_markers = ['o', 's', 'o'] for i in range(self.configs): print('------\nConfig %d ---- ' % i) for j in range(len(self.avg[i])): std = self.std[i][j] y = self.mean[i][j] y = self.avg[i][j] y_low = self.y_low[i][j] y_up = self.y_up[i][j] if y is None: continue print('%s: %.2f +- %.2f' % (self.lgd[j], y, std)) # # make error bar pretty low_error = y_low up_error = y_up assy = None if plot_n < 2: y = self.prob_to_per(y) else: assy = np.array([[low_error, up_error]]).T # make into lists x = [self.x_list[i]] y = [y] plt.errorbar(x, y, yerr=assy, linestyle=None, fmt=colors[j]) # plot labels f_size = 16 ax.set_ylabel(self.y_label[plot_n], fontsize=f_size) my_handle = [] for j in range(len(self.avg[0])): # if plot_n == 2: # my_handle.append( # mlines.Line2D([], [], marker=my_markers[j], markersize=8, color=colors[j][0], label=self.lgd[j])) # else: my_handle.append( mlines.Line2D([], [], linestyle='None', marker=my_markers[j], markersize=7, color=colors[j][0], label=self.lgd[j])) if plot_n == 1: my_loc = 'upper right' elif plot_n == 0: my_loc = 'upper right' else: my_loc = 'upper left' # 'center left' plt.legend(handles=my_handle, frameon=False, loc=my_loc, fontsize=16) # save fig fig_path = MyDanger.get_folder_path('figs') fig_name = fig_path + '/' + self.fig_name[plot_n] + '.pdf' fig.savefig(fig_name, bbox_inches='tight') plt.close()
def get_compiled_path(): data_compiled_path = MyDanger.get_folder_path('data_compiled') save_path = data_compiled_path return save_path
def plot_error_point(self, plot_n=0): """Plot with lines""" # get padding self.set_x_ticks() self.set_title() self.set_lgd(plot_n) fig = plt.figure() ax = fig.add_subplot(111) colors = ['bo--', 'ks--', 'ro--'] my_markers = ['o', 's', 'o'] for j in range(3): x = [] y = [] yr = [] for i in range(self.configs): print('------\nConfig %d ---- ' % i) std = self.std[i][j] y_1 = self.mean[i][j] y_i = self.avg[i][j] y_low_i = self.y_low[i][j] y_up_i = self.y_up[i][j] if y_up_i > 100: y_up_i = 0 if y is None: continue print('%s: %.2f +- %.2f' % (self.lgd[j], y_1, std)) if plot_n < 2: y_i = self.prob_to_per(y_i) # make into lists x.append(self.x_list[i]) y.append(y_i) yr.append(y_up_i) if plot_n == 2: y_plot = yr else: y_plot = None plt.errorbar(x, y, yerr=y_plot, linewidth=0.5, linestyle='--', fmt=colors[j]) # plot labels f_size = 16 ax.set_ylabel(self.y_label[plot_n], fontsize=f_size) my_handle = [] for j in range(len(self.avg[0])): my_handle.append( mlines.Line2D([], [], linestyle='--', linewidth=0.5, marker=my_markers[j], markersize=7, color=colors[j][0], label=self.lgd[j])) if plot_n == 1: # casualties my_loc = 'lower right' # 'upper right' elif plot_n == 0: # outcomes my_loc = 'upper right' else: # time my_loc = 'upper right' #''center left' plt.legend(handles=my_handle, frameon=False, loc=my_loc, fontsize=16) # save fig fig_path = MyDanger.get_folder_path('figs') fig_name = fig_path + '/' + self.fig_name[plot_n] + '.pdf' fig.savefig(fig_name, bbox_inches='tight') plt.close()
def get_parent_path(parent_name: str): data_saved_path = MyDanger.get_folder_path('data_saved') parent_path = data_saved_path + '/' + parent_name return parent_path
def set_path_data(self, parent_folder='10-07-2'): saved_data_path = MyDanger.get_folder_path('data_saved') self.parent = saved_data_path + '/' + parent_folder
def set_prob_kill(self, prob_list: list or int): if isinstance(prob_list, int): prob_list = MyDanger.exp_prob_kill(prob_list) self.prob_kill = prob_list
from milp_sim.risk.classes.danger import MyDanger import milp_mespp.core.extract_info as ext import sys print(sys.path) # parameters deadline = 10 g = ext.get_graph_04() what = 'fire' plot_for_me = True # init # hazard = MyHazard(g, deadline, what) # hazard.simulate(3) danger = MyDanger(g, deadline, plot_for_me)
v += 1 print(v_target) path_taken = dict() # 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 path_taken[1] = [1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1] path_taken[2] = [1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2] path_taken[3] = [1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2] print(len(path_taken[1])) def compute_avg(score: list): levels = [1, 2, 3, 4, 5] nrm = sum(score) my_sum = 0 i = 0 for s in score: my_sum += s * levels[i] i += 1 d = round(my_sum / nrm, 2) return d if __name__ == "__main__": eta = [0.1, 0.3, 0.2, 0.2, 0.2] list_k = [2, 4] H1 = MyDanger.compute_H(eta)
def create_danger(specs): """ create danger class""" g = specs.graph # create danger class danger = MyDanger(g) # perception: point or prob danger.set_perception(specs.perception) # thresholds danger.set_thresholds(specs.kappa, specs.alpha) # kill prob danger.set_kill(specs.danger_kill, specs.prob_kill) # constraints (use or not) danger.set_constraints(specs.danger_constraints) # how to compute z from eta danger.set_mva_conservative(specs.mva_conservative) # if you are using fov danger.set_use_fov(specs.fov) # true priori knowledge (true or false) danger.set_true_priori(specs.true_priori) # parse actual values or files # order: true, priori, estimate danger.set_true(specs.danger_true) if specs.true_priori is False: # if danger hat is None, it's gonna use the true values danger.set_priori(specs.danger_priori) danger.set_lookup(specs.danger_hat) else: danger.uniform_priori = False danger.set_hat_0() # make node 1 be danger level 1 to avoid inf at t=0, save it to priori, estimated and lookup danger.set_v0_danger() return danger