Skip to content

Commit 99fc848

Browse files
committed
fix linter
1 parent c50aefd commit 99fc848

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

examples/training/pomdp_solve/intrusion_recovery_pomdp/run_vs_random_attacker_v_001.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from csle_tolerance.util.intrusion_recovery_pomdp_util import IntrusionRecoveryPomdpUtil
44
from csle_tolerance.util.pomdp_solve_parser import PomdpSolveParser
55

6-
76
if __name__ == '__main__':
87
eta = 2
98
p_a = 0.05
@@ -12,7 +11,7 @@
1211
p_u = 0.0
1312
BTR = np.inf
1413
negate_costs = False
15-
discount_factor = 1-p_c_1
14+
discount_factor = 1 - p_c_1
1615
num_observations = 100
1716
simulation_name = "csle-tolerance-intrusion-recovery-pomdp-defender-001"
1817
cost_tensor = IntrusionRecoveryPomdpUtil.cost_tensor(eta=eta, states=IntrusionRecoveryPomdpUtil.state_space(),
@@ -39,13 +38,13 @@
3938

4039
alpha_vectors = PomdpSolveParser.parse_alpha_vectors(
4140
file_path="/home/kim/gamesec24/intrusion_recovery-3361312.alpha")
42-
belief_space = np.linspace(0.0, 1, int(1.0/0.01))
41+
belief_space = np.linspace(0.0, 1, int(1.0 / 0.01))
4342
print(belief_space)
4443
for i in range(len(alpha_vectors)):
4544
print(f"a*:{alpha_vectors[i][0]}, vector: {list(-np.array(alpha_vectors[i][1][0:2]))}")
4645
values_01 = []
4746
for j, b in enumerate(belief_space):
48-
b_vec = [1-b, b]
47+
b_vec = [1 - b, b]
4948
dot_vals = []
5049
for i in range(len(alpha_vectors)):
5150
dot_vals.append(np.dot(b_vec, list(-np.array(alpha_vectors[i][1][0:2]))))
@@ -54,5 +53,5 @@
5453
vec_dots = []
5554
print(f"{b} {values_01[-1]}")
5655
for b in belief_space:
57-
b_vec = [1-b, b]
56+
b_vec = [1 - b, b]
5857
vec_dots.append(-np.dot(b_vec, list(-np.array(alpha_vectors[min_index][1][0:2]))))

0 commit comments

Comments
 (0)