gym-csle-stopping-game 0.7.6__tar.gz → 0.8.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gym-csle-stopping-game might be problematic. Click here for more details.
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/PKG-INFO +9 -9
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/pyproject.toml +8 -8
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/setup.cfg +8 -8
- gym_csle_stopping_game-0.8.1/src/gym_csle_stopping_game/__version__.py +1 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/src/gym_csle_stopping_game/dao/stopping_game_config.py +3 -3
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/src/gym_csle_stopping_game/envs/stopping_game_mdp_attacker_env.py +3 -2
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/src/gym_csle_stopping_game/util/stopping_game_util.py +32 -31
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/src/gym_csle_stopping_game.egg-info/PKG-INFO +9 -9
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/src/gym_csle_stopping_game.egg-info/requires.txt +8 -8
- gym_csle_stopping_game-0.7.6/src/gym_csle_stopping_game/__version__.py +0 -1
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/LICENSE.md +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/README.md +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/setup.py +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/src/gym_csle_stopping_game/__init__.py +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/src/gym_csle_stopping_game/constants/__init__.py +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/src/gym_csle_stopping_game/constants/constants.py +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/src/gym_csle_stopping_game/dao/__init__.py +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/src/gym_csle_stopping_game/dao/stopping_game_attacker_mdp_config.py +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/src/gym_csle_stopping_game/dao/stopping_game_defender_pomdp_config.py +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/src/gym_csle_stopping_game/dao/stopping_game_state.py +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/src/gym_csle_stopping_game/envs/__init__.py +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/src/gym_csle_stopping_game/envs/stopping_game_env.py +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/src/gym_csle_stopping_game/envs/stopping_game_pomdp_defender_env.py +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/src/gym_csle_stopping_game/util/__init__.py +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/src/gym_csle_stopping_game.egg-info/SOURCES.txt +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/src/gym_csle_stopping_game.egg-info/dependency_links.txt +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/src/gym_csle_stopping_game.egg-info/not-zip-safe +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/src/gym_csle_stopping_game.egg-info/top_level.txt +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/tests/test_stopping_game_dao.py +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/tests/test_stopping_game_env.py +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/tests/test_stopping_game_mdp_attacker_env.py +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/tests/test_stopping_game_pomdp_defender_env.py +0 -0
- {gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/tests/test_stopping_game_util.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: gym-csle-stopping-game
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.1
|
|
4
4
|
Summary: OpenAI gym reinforcement learning environment of a Dynkin (Optimal stopping) game in CSLE
|
|
5
5
|
Author: Kim Hammar
|
|
6
6
|
Author-email: hammar.kim@gmail.com
|
|
@@ -204,11 +204,11 @@ Classifier: Intended Audience :: Science/Research
|
|
|
204
204
|
Requires-Python: >=3.8
|
|
205
205
|
Description-Content-Type: text/markdown
|
|
206
206
|
Requires-Dist: gymnasium>=0.27.1
|
|
207
|
-
Requires-Dist: csle-base>=0.
|
|
208
|
-
Requires-Dist: csle-common>=0.
|
|
209
|
-
Requires-Dist: csle-attacker>=0.
|
|
210
|
-
Requires-Dist: csle-defender>=0.
|
|
211
|
-
Requires-Dist: csle-collector>=0.
|
|
207
|
+
Requires-Dist: csle-base>=0.8.1
|
|
208
|
+
Requires-Dist: csle-common>=0.8.1
|
|
209
|
+
Requires-Dist: csle-attacker>=0.8.1
|
|
210
|
+
Requires-Dist: csle-defender>=0.8.1
|
|
211
|
+
Requires-Dist: csle-collector>=0.8.1
|
|
212
212
|
Provides-Extra: test
|
|
213
213
|
Requires-Dist: pytest>=6.0; extra == "test"
|
|
214
214
|
Requires-Dist: pytest-cov>=2.0; extra == "test"
|
|
@@ -216,7 +216,7 @@ Requires-Dist: pytest-mock>=3.6.0; extra == "test"
|
|
|
216
216
|
Requires-Dist: pytest-grpc>=0.8.0; extra == "test"
|
|
217
217
|
Requires-Dist: grpcio>=1.69.0; extra == "test"
|
|
218
218
|
Requires-Dist: grpcio-tools>=1.69.0; extra == "test"
|
|
219
|
-
Requires-Dist: mypy>=1.
|
|
219
|
+
Requires-Dist: mypy>=1.16.1; extra == "test"
|
|
220
220
|
Requires-Dist: mypy-extensions>=1.0.0; extra == "test"
|
|
221
221
|
Requires-Dist: mypy-protobuf>=3.5.0; extra == "test"
|
|
222
222
|
Requires-Dist: types-PyYAML>=6.0.12.11; extra == "test"
|
|
@@ -226,11 +226,11 @@ Requires-Dist: types-requests>=2.31.0.1; extra == "test"
|
|
|
226
226
|
Requires-Dist: types-urllib3>=1.26.25.13; extra == "test"
|
|
227
227
|
Requires-Dist: flake8>=6.1.0; extra == "test"
|
|
228
228
|
Requires-Dist: flake8-rst-docstrings>=0.3.0; extra == "test"
|
|
229
|
-
Requires-Dist: tox>=
|
|
229
|
+
Requires-Dist: tox>=4.24.1; extra == "test"
|
|
230
230
|
Requires-Dist: sphinx>=5.3.0; extra == "test"
|
|
231
231
|
Requires-Dist: sphinxcontrib-napoleon>=0.7; extra == "test"
|
|
232
232
|
Requires-Dist: sphinx-rtd-theme>=1.1.1; extra == "test"
|
|
233
|
-
Requires-Dist: twine>=
|
|
233
|
+
Requires-Dist: twine>=6.1.0; extra == "test"
|
|
234
234
|
Requires-Dist: build>=0.10.0; extra == "test"
|
|
235
235
|
|
|
236
236
|
# `gym-csle-stopping-game`
|
|
@@ -19,11 +19,11 @@ classifiers = [
|
|
|
19
19
|
]
|
|
20
20
|
dependencies = [
|
|
21
21
|
"gymnasium>=0.27.1",
|
|
22
|
-
"csle-base>=0.
|
|
23
|
-
"csle-common>=0.
|
|
24
|
-
"csle-attacker>=0.
|
|
25
|
-
"csle-defender>=0.
|
|
26
|
-
"csle-collector>=0.
|
|
22
|
+
"csle-base>=0.8.1",
|
|
23
|
+
"csle-common>=0.8.1",
|
|
24
|
+
"csle-attacker>=0.8.1",
|
|
25
|
+
"csle-defender>=0.8.1",
|
|
26
|
+
"csle-collector>=0.8.1"
|
|
27
27
|
]
|
|
28
28
|
|
|
29
29
|
[project.optional-dependencies]
|
|
@@ -34,7 +34,7 @@ test = [
|
|
|
34
34
|
"pytest-grpc>=0.8.0",
|
|
35
35
|
"grpcio>=1.69.0",
|
|
36
36
|
"grpcio-tools>=1.69.0",
|
|
37
|
-
"mypy>=1.
|
|
37
|
+
"mypy>=1.16.1",
|
|
38
38
|
"mypy-extensions>=1.0.0",
|
|
39
39
|
"mypy-protobuf>=3.5.0",
|
|
40
40
|
"types-PyYAML>=6.0.12.11",
|
|
@@ -44,11 +44,11 @@ test = [
|
|
|
44
44
|
"types-urllib3>=1.26.25.13",
|
|
45
45
|
"flake8>=6.1.0",
|
|
46
46
|
"flake8-rst-docstrings>=0.3.0",
|
|
47
|
-
"tox>=
|
|
47
|
+
"tox>=4.24.1",
|
|
48
48
|
"sphinx>=5.3.0",
|
|
49
49
|
"sphinxcontrib-napoleon>=0.7",
|
|
50
50
|
"sphinx-rtd-theme>=1.1.1",
|
|
51
|
-
"twine>=
|
|
51
|
+
"twine>=6.1.0",
|
|
52
52
|
"build>=0.10.0"
|
|
53
53
|
]
|
|
54
54
|
|
|
@@ -20,11 +20,11 @@ classifiers =
|
|
|
20
20
|
[options]
|
|
21
21
|
install_requires =
|
|
22
22
|
gymnasium>=0.27.1
|
|
23
|
-
csle-base>=0.
|
|
24
|
-
csle-common>=0.
|
|
25
|
-
csle-attacker>=0.
|
|
26
|
-
csle-defender>=0.
|
|
27
|
-
csle-collector>=0.
|
|
23
|
+
csle-base>=0.8.1
|
|
24
|
+
csle-common>=0.8.1
|
|
25
|
+
csle-attacker>=0.8.1
|
|
26
|
+
csle-defender>=0.8.1
|
|
27
|
+
csle-collector>=0.8.1
|
|
28
28
|
python_requires = >=3.8
|
|
29
29
|
package_dir =
|
|
30
30
|
=src
|
|
@@ -42,7 +42,7 @@ testing =
|
|
|
42
42
|
grpcio>=1.69.0
|
|
43
43
|
grpcio-tools>=1.69.0
|
|
44
44
|
pytest-grpc>=0.8.0
|
|
45
|
-
mypy>=1.
|
|
45
|
+
mypy>=1.16.1
|
|
46
46
|
mypy-extensions>=1.0.0
|
|
47
47
|
mypy-protobuf>=3.5.0
|
|
48
48
|
types-PyYAML>=6.0.12.11
|
|
@@ -52,11 +52,11 @@ testing =
|
|
|
52
52
|
types-urllib3>=1.26.25.13
|
|
53
53
|
flake8>=6.1.0
|
|
54
54
|
flake8-rst-docstrings>=0.3.0
|
|
55
|
-
tox>=
|
|
55
|
+
tox>=4.24.1
|
|
56
56
|
sphinx>=5.3.0
|
|
57
57
|
sphinxcontrib-napoleon>=0.7
|
|
58
58
|
sphinx-rtd-theme>=1.1.1
|
|
59
|
-
twine>=
|
|
59
|
+
twine>=6.1.0
|
|
60
60
|
build>=0.10.0
|
|
61
61
|
|
|
62
62
|
[options.package_data]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '0.8.1'
|
|
@@ -11,9 +11,9 @@ class StoppingGameConfig(SimulationEnvInputConfig):
|
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
13
|
def __init__(self, env_name: str,
|
|
14
|
-
T: npt.NDArray[Any], O: npt.NDArray[np.
|
|
15
|
-
R: npt.NDArray[Any], S: npt.NDArray[np.
|
|
16
|
-
A2: npt.NDArray[np.
|
|
14
|
+
T: npt.NDArray[Any], O: npt.NDArray[np.int32], Z: npt.NDArray[Any],
|
|
15
|
+
R: npt.NDArray[Any], S: npt.NDArray[np.int32], A1: npt.NDArray[np.int32],
|
|
16
|
+
A2: npt.NDArray[np.int32], L: int, R_INT: int, R_COST: int, R_SLA: int, R_ST: int,
|
|
17
17
|
b1: npt.NDArray[np.float64],
|
|
18
18
|
save_dir: str, checkpoint_traces_freq: int, gamma: float = 1, compute_beliefs: bool = True,
|
|
19
19
|
save_trace: bool = True) -> None:
|
|
@@ -48,7 +48,7 @@ class StoppingGameMdpAttackerEnv(BaseEnv):
|
|
|
48
48
|
self.reset()
|
|
49
49
|
super().__init__()
|
|
50
50
|
|
|
51
|
-
def step(self, pi2: Union[npt.NDArray[Any], int, float,
|
|
51
|
+
def step(self, pi2: Union[npt.NDArray[Any], int, float, int, np.float64]) \
|
|
52
52
|
-> Tuple[npt.NDArray[Any], int, bool, bool, Dict[str, Any]]:
|
|
53
53
|
"""
|
|
54
54
|
Takes a step in the environment by executing the given action
|
|
@@ -56,7 +56,8 @@ class StoppingGameMdpAttackerEnv(BaseEnv):
|
|
|
56
56
|
:param pi2: attacker stage policy
|
|
57
57
|
:return: (obs, reward, terminated, truncated, info)
|
|
58
58
|
"""
|
|
59
|
-
if type(pi2) is int or type(pi2) is float or type(pi2) is np.int64 or type(pi2) is np.
|
|
59
|
+
if (type(pi2) is int or type(pi2) is float or type(pi2) is np.int64 or type(pi2) is np.int32 # type: ignore
|
|
60
|
+
or type(pi2) is np.float64): # type: ignore
|
|
60
61
|
a2 = pi2
|
|
61
62
|
if self.latest_attacker_obs is None:
|
|
62
63
|
raise ValueError("Attacker observation is None")
|
|
@@ -31,7 +31,7 @@ class StoppingGameUtil:
|
|
|
31
31
|
return np.array([0, 1, 2])
|
|
32
32
|
|
|
33
33
|
@staticmethod
|
|
34
|
-
def defender_actions() -> npt.NDArray[np.
|
|
34
|
+
def defender_actions() -> npt.NDArray[np.int32]:
|
|
35
35
|
"""
|
|
36
36
|
Gets the action space of the defender
|
|
37
37
|
|
|
@@ -40,7 +40,7 @@ class StoppingGameUtil:
|
|
|
40
40
|
return np.array([0, 1])
|
|
41
41
|
|
|
42
42
|
@staticmethod
|
|
43
|
-
def attacker_actions() -> npt.NDArray[np.
|
|
43
|
+
def attacker_actions() -> npt.NDArray[np.int32]:
|
|
44
44
|
"""
|
|
45
45
|
Gets the action space of the attacker
|
|
46
46
|
|
|
@@ -217,7 +217,7 @@ class StoppingGameUtil:
|
|
|
217
217
|
return Z
|
|
218
218
|
|
|
219
219
|
@staticmethod
|
|
220
|
-
def sample_next_state(T: npt.NDArray[Any], l: int, s: int, a1: int, a2: int, S: npt.NDArray[np.
|
|
220
|
+
def sample_next_state(T: npt.NDArray[Any], l: int, s: int, a1: int, a2: int, S: npt.NDArray[np.int32]) -> int:
|
|
221
221
|
"""
|
|
222
222
|
Samples the next state
|
|
223
223
|
|
|
@@ -245,7 +245,7 @@ class StoppingGameUtil:
|
|
|
245
245
|
return int(np.random.choice(np.arange(0, len(b1)), p=b1))
|
|
246
246
|
|
|
247
247
|
@staticmethod
|
|
248
|
-
def sample_next_observation(Z: npt.NDArray[Any], s_prime: int, O: npt.NDArray[np.
|
|
248
|
+
def sample_next_observation(Z: npt.NDArray[Any], s_prime: int, O: npt.NDArray[np.int32]) -> int:
|
|
249
249
|
"""
|
|
250
250
|
Samples the next observation
|
|
251
251
|
|
|
@@ -390,7 +390,7 @@ class StoppingGameUtil:
|
|
|
390
390
|
return file_str
|
|
391
391
|
|
|
392
392
|
@staticmethod
|
|
393
|
-
def reduce_T_attacker(T: npt.NDArray[np.
|
|
393
|
+
def reduce_T_attacker(T: npt.NDArray[np.float64], strategy: Policy) -> npt.NDArray[np.float64]:
|
|
394
394
|
"""
|
|
395
395
|
Reduces the transition tensor based on a given attacker strategy
|
|
396
396
|
|
|
@@ -415,7 +415,7 @@ class StoppingGameUtil:
|
|
|
415
415
|
return reduced_T
|
|
416
416
|
|
|
417
417
|
@staticmethod
|
|
418
|
-
def reduce_R_attacker(R: npt.NDArray[np.
|
|
418
|
+
def reduce_R_attacker(R: npt.NDArray[np.float64], strategy: Policy) -> npt.NDArray[np.float64]:
|
|
419
419
|
"""
|
|
420
420
|
Reduces the reward tensor based on a given attacker strategy
|
|
421
421
|
|
|
@@ -433,7 +433,7 @@ class StoppingGameUtil:
|
|
|
433
433
|
return reduced_R
|
|
434
434
|
|
|
435
435
|
@staticmethod
|
|
436
|
-
def reduce_Z_attacker(Z: npt.NDArray[np.
|
|
436
|
+
def reduce_Z_attacker(Z: npt.NDArray[np.float64], strategy: Policy) -> npt.NDArray[np.float64]:
|
|
437
437
|
"""
|
|
438
438
|
Reduces the observation tensor based on a given attacker strategy
|
|
439
439
|
|
|
@@ -450,7 +450,7 @@ class StoppingGameUtil:
|
|
|
450
450
|
return reduced_Z
|
|
451
451
|
|
|
452
452
|
@staticmethod
|
|
453
|
-
def reduce_T_defender(T: npt.NDArray[np.
|
|
453
|
+
def reduce_T_defender(T: npt.NDArray[np.float64], strategy: Policy) -> npt.NDArray[np.float64]:
|
|
454
454
|
"""
|
|
455
455
|
Reduces the transition tensor based on a given defender strategy
|
|
456
456
|
|
|
@@ -469,7 +469,7 @@ class StoppingGameUtil:
|
|
|
469
469
|
return reduced_T
|
|
470
470
|
|
|
471
471
|
@staticmethod
|
|
472
|
-
def reduce_R_defender(R: npt.NDArray[np.
|
|
472
|
+
def reduce_R_defender(R: npt.NDArray[np.float64], strategy: Policy) -> npt.NDArray[np.float64]:
|
|
473
473
|
"""
|
|
474
474
|
Reduces the reward tensor based on a given defender strategy
|
|
475
475
|
|
|
@@ -487,10 +487,10 @@ class StoppingGameUtil:
|
|
|
487
487
|
return reduced_R
|
|
488
488
|
|
|
489
489
|
@staticmethod
|
|
490
|
-
def aggregate_belief_mdp_defender(aggregation_resolution: int, T: npt.NDArray[np.
|
|
491
|
-
R: npt.NDArray[np.
|
|
492
|
-
S: npt.NDArray[np.
|
|
493
|
-
-> Tuple[npt.NDArray[np.
|
|
490
|
+
def aggregate_belief_mdp_defender(aggregation_resolution: int, T: npt.NDArray[np.float64],
|
|
491
|
+
R: npt.NDArray[np.float64], Z: npt.NDArray[np.float64],
|
|
492
|
+
S: npt.NDArray[np.int32], A: npt.NDArray[np.int32], O: npt.NDArray[np.int32]) \
|
|
493
|
+
-> Tuple[npt.NDArray[np.float64], npt.NDArray[np.int32], npt.NDArray[np.float64], npt.NDArray[np.float64]]:
|
|
494
494
|
"""
|
|
495
495
|
Generates an aggregate belief MDP from a given POMDP specification and aggregation resolution
|
|
496
496
|
|
|
@@ -512,7 +512,7 @@ class StoppingGameUtil:
|
|
|
512
512
|
return aggregate_belief_space, A, belief_T, belief_R
|
|
513
513
|
|
|
514
514
|
@staticmethod
|
|
515
|
-
def generate_aggregate_belief_space(n: int, belief_space_dimension: int) -> npt.NDArray[np.
|
|
515
|
+
def generate_aggregate_belief_space(n: int, belief_space_dimension: int) -> npt.NDArray[np.float64]:
|
|
516
516
|
"""
|
|
517
517
|
Generate an aggregate belief space B_n.
|
|
518
518
|
|
|
@@ -534,8 +534,8 @@ class StoppingGameUtil:
|
|
|
534
534
|
|
|
535
535
|
@staticmethod
|
|
536
536
|
def generate_aggregate_belief_reward_tensor(
|
|
537
|
-
aggregate_belief_space: npt.NDArray[np.
|
|
538
|
-
R: npt.NDArray[np.
|
|
537
|
+
aggregate_belief_space: npt.NDArray[np.float64], S: npt.NDArray[np.int32], A: npt.NDArray[np.int32],
|
|
538
|
+
R: npt.NDArray[np.float64]) -> npt.NDArray[np.float64]:
|
|
539
539
|
"""
|
|
540
540
|
Generates an aggregate reward tensor for the aggregate belief MDP
|
|
541
541
|
|
|
@@ -557,8 +557,9 @@ class StoppingGameUtil:
|
|
|
557
557
|
|
|
558
558
|
@staticmethod
|
|
559
559
|
def generate_aggregate_belief_transition_operator(
|
|
560
|
-
aggregate_belief_space: npt.NDArray[np.
|
|
561
|
-
O: npt.NDArray[np.
|
|
560
|
+
aggregate_belief_space: npt.NDArray[np.float64], S: npt.NDArray[np.int32], A: npt.NDArray[np.int32],
|
|
561
|
+
O: npt.NDArray[np.int32], T: npt.NDArray[np.float64], Z: npt.NDArray[np.float64]) \
|
|
562
|
+
-> npt.NDArray[np.float64]:
|
|
562
563
|
"""
|
|
563
564
|
Generates an aggregate belief space transition operator
|
|
564
565
|
|
|
@@ -581,11 +582,11 @@ class StoppingGameUtil:
|
|
|
581
582
|
return belief_T
|
|
582
583
|
|
|
583
584
|
@staticmethod
|
|
584
|
-
def aggregate_belief_transition_probability(b1: npt.NDArray[np.
|
|
585
|
-
S: npt.NDArray[np.
|
|
586
|
-
A: npt.NDArray[np.
|
|
587
|
-
T: npt.NDArray[np.
|
|
588
|
-
aggregate_belief_space: npt.NDArray[np.
|
|
585
|
+
def aggregate_belief_transition_probability(b1: npt.NDArray[np.float64], b2: npt.NDArray[np.float64], a: int,
|
|
586
|
+
S: npt.NDArray[np.int32], O: npt.NDArray[np.int32],
|
|
587
|
+
A: npt.NDArray[np.int32],
|
|
588
|
+
T: npt.NDArray[np.float64], Z: npt.NDArray[np.float64],
|
|
589
|
+
aggregate_belief_space: npt.NDArray[np.float64]) -> float:
|
|
589
590
|
"""
|
|
590
591
|
Calculates the probability of transitioning from belief b1 to belief b2 when taking action a
|
|
591
592
|
|
|
@@ -615,9 +616,9 @@ class StoppingGameUtil:
|
|
|
615
616
|
return prob
|
|
616
617
|
|
|
617
618
|
@staticmethod
|
|
618
|
-
def pomdp_next_belief(o: int, a: int, b: npt.NDArray[np.float64], states: npt.NDArray[np.
|
|
619
|
-
observations: npt.NDArray[np.
|
|
620
|
-
transition_tensor: npt.NDArray[np.
|
|
619
|
+
def pomdp_next_belief(o: int, a: int, b: npt.NDArray[np.float64], states: npt.NDArray[np.int32],
|
|
620
|
+
observations: npt.NDArray[np.int32], observation_tensor: npt.NDArray[np.float64],
|
|
621
|
+
transition_tensor: npt.NDArray[np.float64]) \
|
|
621
622
|
-> npt.NDArray[np.float64]:
|
|
622
623
|
"""
|
|
623
624
|
Computes the next belief of the POMDP using a Bayesian filter
|
|
@@ -642,9 +643,9 @@ class StoppingGameUtil:
|
|
|
642
643
|
return np.array(b_prime)
|
|
643
644
|
|
|
644
645
|
@staticmethod
|
|
645
|
-
def pomdp_bayes_filter(s_prime: int, o: int, a: int, b: npt.NDArray[np.float64], states: npt.NDArray[np.
|
|
646
|
-
observations: npt.NDArray[np.
|
|
647
|
-
transition_tensor: npt.NDArray[np.
|
|
646
|
+
def pomdp_bayes_filter(s_prime: int, o: int, a: int, b: npt.NDArray[np.float64], states: npt.NDArray[np.int32],
|
|
647
|
+
observations: npt.NDArray[np.int32], observation_tensor: npt.NDArray[np.float64],
|
|
648
|
+
transition_tensor: npt.NDArray[np.float64]) -> float:
|
|
648
649
|
"""
|
|
649
650
|
A Bayesian filter to compute b[s_prime] of the POMDP
|
|
650
651
|
|
|
@@ -679,8 +680,8 @@ class StoppingGameUtil:
|
|
|
679
680
|
return b_prime_s_prime
|
|
680
681
|
|
|
681
682
|
@staticmethod
|
|
682
|
-
def find_nearest_neighbor_belief(belief_space: npt.NDArray[np.
|
|
683
|
-
-> npt.NDArray[np.
|
|
683
|
+
def find_nearest_neighbor_belief(belief_space: npt.NDArray[np.float64], target_belief: npt.NDArray[np.float64]) \
|
|
684
|
+
-> npt.NDArray[np.float64]:
|
|
684
685
|
"""
|
|
685
686
|
Finds the nearest neighbor (in the Euclidean sense) of a given belief in a certain belief space
|
|
686
687
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: gym-csle-stopping-game
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.1
|
|
4
4
|
Summary: OpenAI gym reinforcement learning environment of a Dynkin (Optimal stopping) game in CSLE
|
|
5
5
|
Author: Kim Hammar
|
|
6
6
|
Author-email: hammar.kim@gmail.com
|
|
@@ -204,11 +204,11 @@ Classifier: Intended Audience :: Science/Research
|
|
|
204
204
|
Requires-Python: >=3.8
|
|
205
205
|
Description-Content-Type: text/markdown
|
|
206
206
|
Requires-Dist: gymnasium>=0.27.1
|
|
207
|
-
Requires-Dist: csle-base>=0.
|
|
208
|
-
Requires-Dist: csle-common>=0.
|
|
209
|
-
Requires-Dist: csle-attacker>=0.
|
|
210
|
-
Requires-Dist: csle-defender>=0.
|
|
211
|
-
Requires-Dist: csle-collector>=0.
|
|
207
|
+
Requires-Dist: csle-base>=0.8.1
|
|
208
|
+
Requires-Dist: csle-common>=0.8.1
|
|
209
|
+
Requires-Dist: csle-attacker>=0.8.1
|
|
210
|
+
Requires-Dist: csle-defender>=0.8.1
|
|
211
|
+
Requires-Dist: csle-collector>=0.8.1
|
|
212
212
|
Provides-Extra: test
|
|
213
213
|
Requires-Dist: pytest>=6.0; extra == "test"
|
|
214
214
|
Requires-Dist: pytest-cov>=2.0; extra == "test"
|
|
@@ -216,7 +216,7 @@ Requires-Dist: pytest-mock>=3.6.0; extra == "test"
|
|
|
216
216
|
Requires-Dist: pytest-grpc>=0.8.0; extra == "test"
|
|
217
217
|
Requires-Dist: grpcio>=1.69.0; extra == "test"
|
|
218
218
|
Requires-Dist: grpcio-tools>=1.69.0; extra == "test"
|
|
219
|
-
Requires-Dist: mypy>=1.
|
|
219
|
+
Requires-Dist: mypy>=1.16.1; extra == "test"
|
|
220
220
|
Requires-Dist: mypy-extensions>=1.0.0; extra == "test"
|
|
221
221
|
Requires-Dist: mypy-protobuf>=3.5.0; extra == "test"
|
|
222
222
|
Requires-Dist: types-PyYAML>=6.0.12.11; extra == "test"
|
|
@@ -226,11 +226,11 @@ Requires-Dist: types-requests>=2.31.0.1; extra == "test"
|
|
|
226
226
|
Requires-Dist: types-urllib3>=1.26.25.13; extra == "test"
|
|
227
227
|
Requires-Dist: flake8>=6.1.0; extra == "test"
|
|
228
228
|
Requires-Dist: flake8-rst-docstrings>=0.3.0; extra == "test"
|
|
229
|
-
Requires-Dist: tox>=
|
|
229
|
+
Requires-Dist: tox>=4.24.1; extra == "test"
|
|
230
230
|
Requires-Dist: sphinx>=5.3.0; extra == "test"
|
|
231
231
|
Requires-Dist: sphinxcontrib-napoleon>=0.7; extra == "test"
|
|
232
232
|
Requires-Dist: sphinx-rtd-theme>=1.1.1; extra == "test"
|
|
233
|
-
Requires-Dist: twine>=
|
|
233
|
+
Requires-Dist: twine>=6.1.0; extra == "test"
|
|
234
234
|
Requires-Dist: build>=0.10.0; extra == "test"
|
|
235
235
|
|
|
236
236
|
# `gym-csle-stopping-game`
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
gymnasium>=0.27.1
|
|
2
|
-
csle-base>=0.
|
|
3
|
-
csle-common>=0.
|
|
4
|
-
csle-attacker>=0.
|
|
5
|
-
csle-defender>=0.
|
|
6
|
-
csle-collector>=0.
|
|
2
|
+
csle-base>=0.8.1
|
|
3
|
+
csle-common>=0.8.1
|
|
4
|
+
csle-attacker>=0.8.1
|
|
5
|
+
csle-defender>=0.8.1
|
|
6
|
+
csle-collector>=0.8.1
|
|
7
7
|
|
|
8
8
|
[test]
|
|
9
9
|
pytest>=6.0
|
|
@@ -12,7 +12,7 @@ pytest-mock>=3.6.0
|
|
|
12
12
|
pytest-grpc>=0.8.0
|
|
13
13
|
grpcio>=1.69.0
|
|
14
14
|
grpcio-tools>=1.69.0
|
|
15
|
-
mypy>=1.
|
|
15
|
+
mypy>=1.16.1
|
|
16
16
|
mypy-extensions>=1.0.0
|
|
17
17
|
mypy-protobuf>=3.5.0
|
|
18
18
|
types-PyYAML>=6.0.12.11
|
|
@@ -22,9 +22,9 @@ types-requests>=2.31.0.1
|
|
|
22
22
|
types-urllib3>=1.26.25.13
|
|
23
23
|
flake8>=6.1.0
|
|
24
24
|
flake8-rst-docstrings>=0.3.0
|
|
25
|
-
tox>=
|
|
25
|
+
tox>=4.24.1
|
|
26
26
|
sphinx>=5.3.0
|
|
27
27
|
sphinxcontrib-napoleon>=0.7
|
|
28
28
|
sphinx-rtd-theme>=1.1.1
|
|
29
|
-
twine>=
|
|
29
|
+
twine>=6.1.0
|
|
30
30
|
build>=0.10.0
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '0.7.6'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/src/gym_csle_stopping_game/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/tests/test_stopping_game_dao.py
RENAMED
|
File without changes
|
{gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/tests/test_stopping_game_env.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gym_csle_stopping_game-0.7.6 → gym_csle_stopping_game-0.8.1}/tests/test_stopping_game_util.py
RENAMED
|
File without changes
|