gym-examples 2.0.104__py3-none-any.whl → 2.0.106__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 +3 -2
- {gym_examples-2.0.104.dist-info → gym_examples-2.0.106.dist-info}/METADATA +1 -1
- gym_examples-2.0.106.dist-info/RECORD +7 -0
- gym_examples-2.0.104.dist-info/RECORD +0 -7
- {gym_examples-2.0.104.dist-info → gym_examples-2.0.106.dist-info}/WHEEL +0 -0
- {gym_examples-2.0.104.dist-info → gym_examples-2.0.106.dist-info}/top_level.txt +0 -0
gym_examples/__init__.py
CHANGED
gym_examples/envs/wsn_env.py
CHANGED
@@ -133,11 +133,12 @@ class WSNRoutingEnv(gym.Env):
|
|
133
133
|
# rewards_individual = torch.tensor(rewards[i], dtype=torch.double)
|
134
134
|
# final_reward = net(rewards_individual)
|
135
135
|
# self.rewards_individual[i] = rewards[i]
|
136
|
-
final_reward = np.sum(rewards[i])
|
136
|
+
# final_reward = np.sum(rewards[i])
|
137
|
+
weights = [1/6, 2/6, 2/6, 1/6]
|
138
|
+
final_reward = np.sum(reward * weight for reward, weight in zip(rewards[i], weights))
|
137
139
|
rewards[i] = final_reward
|
138
140
|
# rewards = [0.5 * r + 0.5 * (1/self.n_sensors) * (self.network_reward_consumption_energy() + self.network_reward_dispersion_remaining_energy()) for r in rewards]
|
139
141
|
# rewards = [0.5 * r + 0.5 * (self.network_reward_consumption_energy() + self.network_reward_dispersion_remaining_energy()) for r in rewards]
|
140
|
-
|
141
142
|
# Only proceed if network consumption energy is not zero to avoid unnecessary list comprehension
|
142
143
|
# self.rewards_individual = [r for r in self.rewards_individual if ((r != 0) and (r[len(r) -1] < 1))]
|
143
144
|
|
@@ -0,0 +1,7 @@
|
|
1
|
+
gym_examples/__init__.py,sha256=LLttMQkApwpfR7DeXQpm3gJJwtJB3FoKJvnH9xm6J7M,194
|
2
|
+
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
+
gym_examples/envs/wsn_env.py,sha256=O74uGEz8CmHg349jx_HOoI4TxSgC8HF_kg_oppFk4Uk,17332
|
4
|
+
gym_examples-2.0.106.dist-info/METADATA,sha256=EM7zaq_mUG5oORRmM1E-Vqh0WDaSURCoS_-GJyD0lns,412
|
5
|
+
gym_examples-2.0.106.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
+
gym_examples-2.0.106.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
+
gym_examples-2.0.106.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
gym_examples/__init__.py,sha256=3mNmrKy4s4i95PHkt8tYcrAxSi165zhXT_6gxVN_6w8,194
|
2
|
-
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
-
gym_examples/envs/wsn_env.py,sha256=l9BqjdKQ4cytR9mHeny9pAtM4Rnx4K96YpVKo601Ktw,17197
|
4
|
-
gym_examples-2.0.104.dist-info/METADATA,sha256=Z6H73hbAFlCP5ZYSYflLh2SFML8Bf_9GbZ3jmS8Qa1w,412
|
5
|
-
gym_examples-2.0.104.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
-
gym_examples-2.0.104.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
-
gym_examples-2.0.104.dist-info/RECORD,,
|
File without changes
|
File without changes
|