gym-examples 3.0.766__py3-none-any.whl → 3.0.767__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 +6 -2
- {gym_examples-3.0.766.dist-info → gym_examples-3.0.767.dist-info}/METADATA +1 -1
- gym_examples-3.0.767.dist-info/RECORD +7 -0
- gym_examples-3.0.766.dist-info/RECORD +0 -7
- {gym_examples-3.0.766.dist-info → gym_examples-3.0.767.dist-info}/WHEEL +0 -0
- {gym_examples-3.0.766.dist-info → gym_examples-3.0.767.dist-info}/top_level.txt +0 -0
gym_examples/__init__.py
CHANGED
gym_examples/envs/wsn_env.py
CHANGED
@@ -195,16 +195,20 @@ class WSNRoutingEnv(gym.Env):
|
|
195
195
|
continue # Skip if the sensor does not have enough energy to transmit data to the next hop
|
196
196
|
|
197
197
|
self.update_sensor_energies(i, transmission_energy)
|
198
|
+
# Update the metrics
|
199
|
+
self.total_energy_consumed += transmission_energy
|
200
|
+
self.total_packets_sent_by_sensors += self.number_of_packets[i]
|
198
201
|
|
199
202
|
if self.remaining_energy[action] < reception_energy:
|
200
203
|
# self.remaining_energy[action] = 0
|
204
|
+
self.packet_latency[i] = 0 # Reset the latency of the packet
|
205
|
+
self.number_of_packets[i] = 0 # Reset the number of packets of the sensor i
|
201
206
|
continue # Skip if the next hop does not have enough energy to receive data
|
202
207
|
|
203
208
|
self.update_sensor_energies(action, reception_energy)
|
204
209
|
|
205
210
|
# Update the metrics
|
206
|
-
self.total_energy_consumed +=
|
207
|
-
self.total_packets_sent_by_sensors += self.number_of_packets[i]
|
211
|
+
self.total_energy_consumed += reception_energy
|
208
212
|
self.packet_latency[action] += self.packet_latency[i] + latency_per_hop
|
209
213
|
self.packet_latency[i] = 0
|
210
214
|
|
@@ -0,0 +1,7 @@
|
|
1
|
+
gym_examples/__init__.py,sha256=lI2A534ndKHi9RQYvkCYTX1c8O0mQr5rLLLQuRzu5Qw,166
|
2
|
+
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
+
gym_examples/envs/wsn_env.py,sha256=QX9nNxbq87fRr0Dtfwe3aPtTmtiCJtNHixJLfycR1mo,26794
|
4
|
+
gym_examples-3.0.767.dist-info/METADATA,sha256=KSj6oEzWvhbdwcJxk6M1V_OxbwExmam4LyXCHUbrWZ8,412
|
5
|
+
gym_examples-3.0.767.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
+
gym_examples-3.0.767.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
+
gym_examples-3.0.767.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
gym_examples/__init__.py,sha256=oGBLNhUkMsxNUxrD6aMbIe9qHF4IwLFTzFobdBSE9pM,166
|
2
|
-
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
-
gym_examples/envs/wsn_env.py,sha256=YyPRExlOFIEDI0NLhaAX6LwOmJgGLw5WU8G-pvD8wVc,26532
|
4
|
-
gym_examples-3.0.766.dist-info/METADATA,sha256=QMrQjl8_UfOylLp1Aw0TvEtriDzm576Rji5sTS2gtZk,412
|
5
|
-
gym_examples-3.0.766.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
-
gym_examples-3.0.766.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
-
gym_examples-3.0.766.dist-info/RECORD,,
|
File without changes
|
File without changes
|