gym-examples 3.0.164__py3-none-any.whl → 3.0.167__py3-none-any.whl
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.
- gym_examples/__init__.py +1 -1
- gym_examples/envs/wsn_env.py +5 -1
- {gym_examples-3.0.164.dist-info → gym_examples-3.0.167.dist-info}/METADATA +1 -1
- gym_examples-3.0.167.dist-info/RECORD +7 -0
- gym_examples-3.0.164.dist-info/RECORD +0 -7
- {gym_examples-3.0.164.dist-info → gym_examples-3.0.167.dist-info}/WHEEL +0 -0
- {gym_examples-3.0.164.dist-info → gym_examples-3.0.167.dist-info}/top_level.txt +0 -0
gym_examples/__init__.py
CHANGED
gym_examples/envs/wsn_env.py
CHANGED
@@ -8,6 +8,7 @@ from datetime import datetime
|
|
8
8
|
import torch
|
9
9
|
import torch.nn as nn
|
10
10
|
import torch.nn.functional as F
|
11
|
+
import os
|
11
12
|
|
12
13
|
# Define the network parameters for the final reward function
|
13
14
|
input_dim = 7 # length of the individual rewards vector
|
@@ -46,6 +47,9 @@ net = Attention(input_dim, output_dim)
|
|
46
47
|
net = net.double() # Convert the weights to Double
|
47
48
|
|
48
49
|
class WSNRoutingEnv(gym.Env):
|
50
|
+
|
51
|
+
print_stats = False # Global flag to control printing of statistics
|
52
|
+
|
49
53
|
def __init__(self, n_sensors = 20, coverage_radius=(upper_bound - lower_bound)/4):
|
50
54
|
|
51
55
|
super(WSNRoutingEnv, self).__init__()
|
@@ -71,7 +75,7 @@ class WSNRoutingEnv(gym.Env):
|
|
71
75
|
self.reset()
|
72
76
|
|
73
77
|
def reset(self):
|
74
|
-
if self.episode_count > 1:
|
78
|
+
if self.episode_count > 1 and os.getenv('PRINT_STATS') == '1':
|
75
79
|
print(f"Episode: {self.episode_count}")
|
76
80
|
print(f"This episode ends with # Steps: {self.log_steps}")
|
77
81
|
print(f"This episode ends with Done: {self.log_done}")
|
@@ -0,0 +1,7 @@
|
|
1
|
+
gym_examples/__init__.py,sha256=skAF_aeIYspj8jzblD8MdAQ-UHo9jCZdEOnkBpdg1FQ,194
|
2
|
+
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
+
gym_examples/envs/wsn_env.py,sha256=yZDuhrioWV6p0cySol8Nl_f8NDzw0KvI0KwbTloE-CE,22965
|
4
|
+
gym_examples-3.0.167.dist-info/METADATA,sha256=U2Ewa0n8PgUJpkYUVgECLhbvqeb6NBUDHYX8MJJ9VQA,412
|
5
|
+
gym_examples-3.0.167.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
+
gym_examples-3.0.167.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
+
gym_examples-3.0.167.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
gym_examples/__init__.py,sha256=EBSBe55Y7WGUFcWXt8yCdWTgFt5HfT4NfT0MhYV91Ic,194
|
2
|
-
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
-
gym_examples/envs/wsn_env.py,sha256=BR0OUpLWTgwTBv55bOT2pCSpNwz4zp6zTmC9seZ3Kvw,22840
|
4
|
-
gym_examples-3.0.164.dist-info/METADATA,sha256=XHTU4gl7c9o_lHaCA09f72X6VwL9rNBWjjOehYMzpWk,412
|
5
|
-
gym_examples-3.0.164.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
-
gym_examples-3.0.164.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
-
gym_examples-3.0.164.dist-info/RECORD,,
|
File without changes
|
File without changes
|