Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Limmen committed May 7, 2024
1 parent c50aefd commit 99fc848
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from csle_tolerance.util.intrusion_recovery_pomdp_util import IntrusionRecoveryPomdpUtil
from csle_tolerance.util.pomdp_solve_parser import PomdpSolveParser


if __name__ == '__main__':
eta = 2
p_a = 0.05
Expand All @@ -12,7 +11,7 @@
p_u = 0.0
BTR = np.inf
negate_costs = False
discount_factor = 1-p_c_1
discount_factor = 1 - p_c_1
num_observations = 100
simulation_name = "csle-tolerance-intrusion-recovery-pomdp-defender-001"
cost_tensor = IntrusionRecoveryPomdpUtil.cost_tensor(eta=eta, states=IntrusionRecoveryPomdpUtil.state_space(),
Expand All @@ -39,13 +38,13 @@

alpha_vectors = PomdpSolveParser.parse_alpha_vectors(
file_path="/home/kim/gamesec24/intrusion_recovery-3361312.alpha")
belief_space = np.linspace(0.0, 1, int(1.0/0.01))
belief_space = np.linspace(0.0, 1, int(1.0 / 0.01))
print(belief_space)
for i in range(len(alpha_vectors)):
print(f"a*:{alpha_vectors[i][0]}, vector: {list(-np.array(alpha_vectors[i][1][0:2]))}")
values_01 = []
for j, b in enumerate(belief_space):
b_vec = [1-b, b]
b_vec = [1 - b, b]
dot_vals = []
for i in range(len(alpha_vectors)):
dot_vals.append(np.dot(b_vec, list(-np.array(alpha_vectors[i][1][0:2]))))
Expand All @@ -54,5 +53,5 @@
vec_dots = []
print(f"{b} {values_01[-1]}")
for b in belief_space:
b_vec = [1-b, b]
b_vec = [1 - b, b]
vec_dots.append(-np.dot(b_vec, list(-np.array(alpha_vectors[min_index][1][0:2]))))

0 comments on commit 99fc848

Please sign in to comment.