gym-examples 3.0.82__py3-none-any.whl → 3.0.84__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 +8 -5
- {gym_examples-3.0.82.dist-info → gym_examples-3.0.84.dist-info}/METADATA +1 -1
- gym_examples-3.0.84.dist-info/RECORD +7 -0
- gym_examples-3.0.82.dist-info/RECORD +0 -7
- {gym_examples-3.0.82.dist-info → gym_examples-3.0.84.dist-info}/WHEEL +0 -0
- {gym_examples-3.0.82.dist-info → gym_examples-3.0.84.dist-info}/top_level.txt +0 -0
gym_examples/__init__.py
CHANGED
gym_examples/envs/wsn_env.py
CHANGED
@@ -65,8 +65,7 @@ class WSNRoutingEnv(gym.Env):
|
|
65
65
|
self.reset()
|
66
66
|
|
67
67
|
|
68
|
-
def reset(self):
|
69
|
-
|
68
|
+
def reset(self):
|
70
69
|
self.sensor_positions = np.random.rand(self.n_sensors, 2) * (upper_bound - lower_bound) + lower_bound
|
71
70
|
self.distance_to_base = np.linalg.norm(self.sensor_positions - base_station_position, axis=1)
|
72
71
|
self.remaining_energy = np.ones(self.n_sensors) * initial_energy
|
@@ -304,11 +303,15 @@ class WSNRoutingEnv(gym.Env):
|
|
304
303
|
|
305
304
|
#-- rewards related to the performance metrics
|
306
305
|
reward_latency = self.compute_reward_latency()
|
307
|
-
reward_network_throughput = self.compute_reward_network_throughput()
|
308
|
-
reward_packet_delivery_ratio = self.compute_reward_packet_delivery_ratio()
|
306
|
+
reward_network_throughput = np.clip(2.6 * self.compute_reward_network_throughput(), 0, 1)
|
307
|
+
reward_packet_delivery_ratio = np.clip(1.6 * self.compute_reward_packet_delivery_ratio(), 0, 1)
|
309
308
|
|
310
309
|
rewards_performance = np.array([reward_latency, reward_network_throughput, reward_packet_delivery_ratio])
|
311
|
-
|
310
|
+
if self.episode_count == 455:
|
311
|
+
print(f"Sensor: {i}")
|
312
|
+
print(f"Episode: {self.episode_count}")
|
313
|
+
print(f"Rewards energy: {rewards_energy}")
|
314
|
+
print(f"Rewards performance: {rewards_performance}")
|
312
315
|
return np.concatenate((rewards_energy, rewards_performance))
|
313
316
|
# return rewards_energy
|
314
317
|
|
@@ -0,0 +1,7 @@
|
|
1
|
+
gym_examples/__init__.py,sha256=ST4s9tIt_yRybwlLKBLIlKL30PMwUmD-6X2XJakhv_0,193
|
2
|
+
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
+
gym_examples/envs/wsn_env.py,sha256=yJyhA_VVM00Pju7fYBBk2HAYas5ws_iZsSfQZBUFb74,20672
|
4
|
+
gym_examples-3.0.84.dist-info/METADATA,sha256=ZGgIUW9Y3i1fJFP8XI6M2ejWyTBzhtu01ZDU7y_2YfA,411
|
5
|
+
gym_examples-3.0.84.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
+
gym_examples-3.0.84.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
+
gym_examples-3.0.84.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
gym_examples/__init__.py,sha256=7wQ-bu5_OtGvaQiXM0RqpvJV3hMmXUD5SugSnc0Veu4,193
|
2
|
-
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
-
gym_examples/envs/wsn_env.py,sha256=xxzMP1L9oJ_xs-aCnSG3t1dfQZVaa5CLc2r-Vux6zdY,20385
|
4
|
-
gym_examples-3.0.82.dist-info/METADATA,sha256=C47Q2dc_cOoakwwhz2N8GoAjAaXPHhwbkIPmVguR9o4,411
|
5
|
-
gym_examples-3.0.82.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
-
gym_examples-3.0.82.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
-
gym_examples-3.0.82.dist-info/RECORD,,
|
File without changes
|
File without changes
|