gym-examples 3.0.209__py3-none-any.whl → 3.0.210__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 +4 -2
- {gym_examples-3.0.209.dist-info → gym_examples-3.0.210.dist-info}/METADATA +1 -1
- gym_examples-3.0.210.dist-info/RECORD +7 -0
- gym_examples-3.0.209.dist-info/RECORD +0 -7
- {gym_examples-3.0.209.dist-info → gym_examples-3.0.210.dist-info}/WHEEL +0 -0
- {gym_examples-3.0.209.dist-info → gym_examples-3.0.210.dist-info}/top_level.txt +0 -0
gym_examples/__init__.py
CHANGED
gym_examples/envs/wsn_env.py
CHANGED
@@ -210,7 +210,8 @@ class WSNRoutingEnv(gym.Env):
|
|
210
210
|
|
211
211
|
rewards = [r.item() if isinstance(r, torch.Tensor) else r for r in rewards] # Convert the rewards to a list of floats
|
212
212
|
# rewards = np.sum(rewards) # Sum the rewards of all agents
|
213
|
-
rewards = np.mean(rewards) # Average the rewards of all agents
|
213
|
+
# rewards = np.mean(rewards) # Average the rewards of all agents
|
214
|
+
rewards = np.mean(self.compute_network_rewards()) # Average the rewards of all agents
|
214
215
|
# print(f"Step: {self.steps}, Rewards: {rewards}, Done: {dones}")
|
215
216
|
dones = all(dones) # Done if all agents are done
|
216
217
|
|
@@ -396,7 +397,8 @@ class WSNRoutingEnv(gym.Env):
|
|
396
397
|
reward_packet_delivery_ratio = self.compute_reward_packet_delivery_ratio()
|
397
398
|
rewards_performance = np.array([reward_latency, reward_network_throughput, reward_packet_delivery_ratio])
|
398
399
|
|
399
|
-
return np.concatenate((rewards_energy, rewards_performance))
|
400
|
+
# return np.concatenate((rewards_energy, rewards_performance))
|
401
|
+
return rewards_energy
|
400
402
|
|
401
403
|
def network_reward_dispersion_remaining_energy(self):
|
402
404
|
'''
|
@@ -0,0 +1,7 @@
|
|
1
|
+
gym_examples/__init__.py,sha256=Nn1UcrZxRInKFf4JCxinIa8PEWS4P7wgPq_OK8roe5o,194
|
2
|
+
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
+
gym_examples/envs/wsn_env.py,sha256=wP8oHngOs0pnHplq8Yv8YYJfeA48rQMB3A_EMXVmU2Q,26049
|
4
|
+
gym_examples-3.0.210.dist-info/METADATA,sha256=Chn-C1wtSJ58hCwLG6ZAOZbWZEWzXt4WK4AKGKDi2TE,412
|
5
|
+
gym_examples-3.0.210.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
+
gym_examples-3.0.210.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
+
gym_examples-3.0.210.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
gym_examples/__init__.py,sha256=W8b-NCyzEIs31EMwPSeDN61nvcQN2IFTagqv0stxTZE,194
|
2
|
-
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
-
gym_examples/envs/wsn_env.py,sha256=PFcrAnbBjdhC11_qfnSyAcyXe2IlwdW37Ru0nNXwIYI,25918
|
4
|
-
gym_examples-3.0.209.dist-info/METADATA,sha256=OP2QbV15anG0gxnQEVqdbv01H0JX2d242hp6TsiprAE,412
|
5
|
-
gym_examples-3.0.209.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
-
gym_examples-3.0.209.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
-
gym_examples-3.0.209.dist-info/RECORD,,
|
File without changes
|
File without changes
|