Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Limmen committed Jul 19, 2024
1 parent 7cdec90 commit 96fa707
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import numpy as np
from gym_csle_stopping_game.dao.stopping_game_config import StoppingGameConfig
from csle_common.metastore.metastore_facade import MetastoreFacade
from gym_csle_stopping_game.util.stopping_game_util import StoppingGameUtil
from csle_tolerance.util.pomdp_solve_parser import PomdpSolveParser
Expand All @@ -21,15 +20,16 @@
simulation_env_config.simulation_env_input_config.stopping_game_config.L = 1
simulation_env_config.simulation_env_input_config.stopping_game_config.O = list(range(10))
simulation_env_config.simulation_env_input_config.stopping_game_config.Z = \
StoppingGameUtil.observation_tensor(n=10-1)
StoppingGameUtil.observation_tensor(n=10 - 1)
gamma = 0.95
pi2 = np.array([
[0.9, 0.1],
[1, 0],
[1, 0]
])
pomdp_solve_file_str = StoppingGameUtil.pomdp_solver_file(config=simulation_env_config.simulation_env_input_config.stopping_game_config,
discount_factor=gamma, pi2=pi2)
pomdp_solve_file_str = StoppingGameUtil.pomdp_solver_file(
config=simulation_env_config.simulation_env_input_config.stopping_game_config,
discount_factor=gamma, pi2=pi2)
with open("/home/kim/thesis/paper_1.pomdp", 'w') as f:
f.write(pomdp_solve_file_str)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,5 @@ def pomdp_solver_file(config: StoppingGameConfig, discount_factor: float, pi2: n
for s_prime in config.S:
for o in config.O:
r = config.R[0][a1][0][s]
file_str = (
file_str + f"R: {a1} : {s} : {s_prime} : {o} {r:.80f}\n"
)
file_str = file_str + f"R: {a1} : {s} : {s_prime} : {o} {r:.80f}\n"
return file_str

0 comments on commit 96fa707

Please sign in to comment.