gym-examples 3.0.115__py3-none-any.whl → 3.0.117__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 +16 -1
- {gym_examples-3.0.115.dist-info → gym_examples-3.0.117.dist-info}/METADATA +1 -1
- gym_examples-3.0.117.dist-info/RECORD +7 -0
- gym_examples-3.0.115.dist-info/RECORD +0 -7
- {gym_examples-3.0.115.dist-info → gym_examples-3.0.117.dist-info}/WHEEL +0 -0
- {gym_examples-3.0.115.dist-info → gym_examples-3.0.117.dist-info}/top_level.txt +0 -0
gym_examples/__init__.py
CHANGED
gym_examples/envs/wsn_env.py
CHANGED
@@ -168,6 +168,8 @@ class WSNRoutingEnv(gym.Env):
|
|
168
168
|
|
169
169
|
self.get_metrics()
|
170
170
|
|
171
|
+
# rewards = self.compute_network_rewards()
|
172
|
+
|
171
173
|
return self._get_obs(), rewards, dones, {}
|
172
174
|
|
173
175
|
def _get_obs(self):
|
@@ -312,7 +314,20 @@ class WSNRoutingEnv(gym.Env):
|
|
312
314
|
|
313
315
|
return np.concatenate((rewards_energy, rewards_performance))
|
314
316
|
# return rewards_energy
|
315
|
-
|
317
|
+
|
318
|
+
def compute_network_rewards(self):
|
319
|
+
|
320
|
+
reward_consumption_energy = self.network_reward_consumption_energy()
|
321
|
+
reward_dispersion_remaining_energy = self.network_reward_dispersion_remaining_energy()
|
322
|
+
rewards_energy = np.array([reward_consumption_energy, reward_dispersion_remaining_energy])
|
323
|
+
|
324
|
+
reward_latency = self.compute_reward_latency()
|
325
|
+
reward_network_throughput = self.compute_reward_network_throughput()
|
326
|
+
reward_packet_delivery_ratio = self.compute_reward_packet_delivery_ratio()
|
327
|
+
rewards_performance = np.array([reward_latency, reward_network_throughput, reward_packet_delivery_ratio])
|
328
|
+
|
329
|
+
return np.concatenate((rewards_energy, rewards_performance))
|
330
|
+
|
316
331
|
def network_reward_dispersion_remaining_energy(self):
|
317
332
|
'''
|
318
333
|
Compute the reward based on the standard deviation of the remaining energy at the network level
|
@@ -0,0 +1,7 @@
|
|
1
|
+
gym_examples/__init__.py,sha256=Et8QNhj8860t2dxSPeXeaRqoXJs6jPWc97e0D40zJ9s,194
|
2
|
+
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
+
gym_examples/envs/wsn_env.py,sha256=2SL0mSy2hAjNpiV0PxkCyO49HBr-5an8zapgnNX6EuA,21533
|
4
|
+
gym_examples-3.0.117.dist-info/METADATA,sha256=y1fTVAL8jchnas8bEshkjtjTISmGHYCTP5VavOh0Mqo,412
|
5
|
+
gym_examples-3.0.117.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
+
gym_examples-3.0.117.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
+
gym_examples-3.0.117.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
gym_examples/__init__.py,sha256=4tutbZYDTaS04kfY-9VcMSXg5aYZvn5jWVUwXk7vzR8,194
|
2
|
-
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
-
gym_examples/envs/wsn_env.py,sha256=XSRDyoJXewSwDBtHJJHGYarmWDbgX4qlG5HMVTeASTI,20762
|
4
|
-
gym_examples-3.0.115.dist-info/METADATA,sha256=N8sjWFwvyZ1IYM0Axh4HcwIzJkhzJxsLY4s7-x7z2lY,412
|
5
|
-
gym_examples-3.0.115.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
-
gym_examples-3.0.115.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
-
gym_examples-3.0.115.dist-info/RECORD,,
|
File without changes
|
File without changes
|