gym-examples 3.0.274__py3-none-any.whl → 3.0.276__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 CHANGED
@@ -5,4 +5,4 @@ register(
5
5
  entry_point="gym_examples.envs:WSNRoutingEnv",
6
6
  )
7
7
 
8
- __version__ = "3.0.274"
8
+ __version__ = "3.0.276"
@@ -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
 
@@ -121,7 +122,6 @@ class WSNRoutingEnv(gym.Env):
121
122
  # rewards = 0
122
123
  dones = False
123
124
  actions = np.array([self.current_sensor, actions])
124
- print(f"\nactions from step in WSNRoutingEnv: {actions}\n")
125
125
  for i, action in [actions]:
126
126
  if self.remaining_energy[i] <= 0 or self.number_of_packets[i] <= 0:
127
127
  continue # Skip if sensor has no energy left or no packets to transmit
@@ -231,13 +231,13 @@ class WSNRoutingEnv(gym.Env):
231
231
 
232
232
 
233
233
  def _get_observation_space(self):
234
- return Dict({
235
- 'remaining_energy': Box(low=0, high=initial_energy, shape=(1,), dtype=np.float64),
236
- 'consumption_energy': Box(low=0, high=initial_energy, shape=(1,), dtype=np.float64),
237
- 'sensor_positions': Box(low=lower_bound, high=upper_bound, shape=(2,), dtype=np.float64),
238
- 'number_of_packets': Box(low=0, high=self.n_sensors * initial_number_of_packets + 1, shape=(1,), dtype=int),
239
- 'current_sensor': Box(low=0, high=self.n_sensors - 1, shape=(1,), dtype=int)
240
- })
234
+ return Dict(OrderedDict([
235
+ ('remaining_energy', Box(low=0, high=initial_energy, shape=(1,), dtype=np.float64)),
236
+ ('consumption_energy', Box(low=0, high=initial_energy, shape=(1,), dtype=np.float64)),
237
+ ('sensor_positions', Box(low=lower_bound, high=upper_bound, shape=(2,), dtype=np.float64)),
238
+ ('number_of_packets', Box(low=0, high=self.n_sensors * initial_number_of_packets + 1, shape=(1,), dtype=int)),
239
+ ('current_sensor', Box(low=0, high=self.n_sensors - 1, shape=(1,), dtype=int))
240
+ ]))
241
241
 
242
242
 
243
243
  def get_state(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gym-examples
3
- Version: 3.0.274
3
+ Version: 3.0.276
4
4
  Summary: A custom environment for multi-agent reinforcement learning focused on WSN routing.
5
5
  Home-page: https://github.com/gedji/CODES.git
6
6
  Author: Georges Djimefo
@@ -0,0 +1,7 @@
1
+ gym_examples/__init__.py,sha256=sxoi8VXpsjUx4-iwiC6bUozanl7r_nO-IAXLaC0_F3Y,166
2
+ gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
3
+ gym_examples/envs/wsn_env.py,sha256=pi4-ErjIpxM1jrWjMr8vbUHmp0YSY9YaGSTXsL2k50I,24121
4
+ gym_examples-3.0.276.dist-info/METADATA,sha256=nNq__QCASDTY89JfO9-DElxxg2JipY6GnK4fJpLIEj8,412
5
+ gym_examples-3.0.276.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
6
+ gym_examples-3.0.276.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
7
+ gym_examples-3.0.276.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,,