gym-examples 3.0.274__py3-none-any.whl → 3.0.275__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 +9 -8
- {gym_examples-3.0.274.dist-info → gym_examples-3.0.275.dist-info}/METADATA +1 -1
- gym_examples-3.0.275.dist-info/RECORD +7 -0
- gym_examples-3.0.274.dist-info/RECORD +0 -7
- {gym_examples-3.0.274.dist-info → gym_examples-3.0.275.dist-info}/WHEEL +0 -0
- {gym_examples-3.0.274.dist-info → gym_examples-3.0.275.dist-info}/top_level.txt +0 -0
gym_examples/__init__.py
CHANGED
gym_examples/envs/wsn_env.py
CHANGED
@@ -9,6 +9,7 @@ import torch
|
|
9
9
|
import torch.nn as nn
|
10
10
|
import torch.nn.functional as F
|
11
11
|
import os
|
12
|
+
from collections import OrderedDict
|
12
13
|
|
13
14
|
# Define the network parameters for the final reward function
|
14
15
|
input_dim = 4 # length of the individual rewards vector
|
@@ -111,7 +112,7 @@ class WSNRoutingEnv(gym.Env):
|
|
111
112
|
self.episode_count += 1
|
112
113
|
|
113
114
|
self.get_metrics()
|
114
|
-
|
115
|
+
|
115
116
|
return self._get_obs()
|
116
117
|
|
117
118
|
|
@@ -231,13 +232,13 @@ class WSNRoutingEnv(gym.Env):
|
|
231
232
|
|
232
233
|
|
233
234
|
def _get_observation_space(self):
|
234
|
-
return Dict(
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
235
|
+
return Dict(OrderedDict([
|
236
|
+
('remaining_energy', Box(low=0, high=initial_energy, shape=(1,), dtype=np.float64)),
|
237
|
+
('consumption_energy', Box(low=0, high=initial_energy, shape=(1,), dtype=np.float64)),
|
238
|
+
('sensor_positions', Box(low=lower_bound, high=upper_bound, shape=(2,), dtype=np.float64)),
|
239
|
+
('number_of_packets', Box(low=0, high=self.n_sensors * initial_number_of_packets + 1, shape=(1,), dtype=int)),
|
240
|
+
('current_sensor', Box(low=0, high=self.n_sensors - 1, shape=(1,), dtype=int))
|
241
|
+
]))
|
241
242
|
|
242
243
|
|
243
244
|
def get_state(self):
|
@@ -0,0 +1,7 @@
|
|
1
|
+
gym_examples/__init__.py,sha256=sVM9Gk1qNwP3R3Ej62PfhYz-vNXDf0UQLvgclMAqU-4,166
|
2
|
+
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
+
gym_examples/envs/wsn_env.py,sha256=SYx28yL3WfHnb1I-AXUQpE9-6esP_BWdvLKoLXuATrw,24190
|
4
|
+
gym_examples-3.0.275.dist-info/METADATA,sha256=javWPmu6oFLAF9Zv0nOQHAd6VBO2brI6nmksHQdVNUg,412
|
5
|
+
gym_examples-3.0.275.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
+
gym_examples-3.0.275.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
+
gym_examples-3.0.275.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
gym_examples/__init__.py,sha256=lghJ3o_jHKKCoVsyBYdJfXiok6adkourXQgsWQmAVQ0,166
|
2
|
-
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
-
gym_examples/envs/wsn_env.py,sha256=YDIqycbx4vYRP4e9aueEQZJxBOjb3X5V4OpSSFVXBg0,24162
|
4
|
-
gym_examples-3.0.274.dist-info/METADATA,sha256=5snFdPtqiSbvivj5Uem_0QX_t-2_dZPBWOZAhBwiO7s,412
|
5
|
-
gym_examples-3.0.274.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
-
gym_examples-3.0.274.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
-
gym_examples-3.0.274.dist-info/RECORD,,
|
File without changes
|
File without changes
|