gym-examples 2.0.110__py3-none-any.whl → 2.0.111__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 +2 -2
- {gym_examples-2.0.110.dist-info → gym_examples-2.0.111.dist-info}/METADATA +1 -1
- gym_examples-2.0.111.dist-info/RECORD +7 -0
- gym_examples-2.0.110.dist-info/RECORD +0 -7
- {gym_examples-2.0.110.dist-info → gym_examples-2.0.111.dist-info}/WHEEL +0 -0
- {gym_examples-2.0.110.dist-info → gym_examples-2.0.111.dist-info}/top_level.txt +0 -0
gym_examples/__init__.py
CHANGED
gym_examples/envs/wsn_env.py
CHANGED
@@ -134,14 +134,14 @@ class WSNRoutingEnv(gym.Env):
|
|
134
134
|
# final_reward = net(rewards_individual)
|
135
135
|
# self.rewards_individual[i] = rewards[i]
|
136
136
|
# final_reward = np.sum(rewards[i])
|
137
|
-
weights =
|
137
|
+
weights = np.ones(self.n_sensors, dtype=int)
|
138
138
|
final_reward = np.sum(reward * weight for reward, weight in zip(rewards[i], weights))
|
139
139
|
rewards[i] = final_reward
|
140
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]
|
141
141
|
# rewards = [0.5 * r + 0.5 * (self.network_reward_consumption_energy() + self.network_reward_dispersion_remaining_energy()) for r in rewards]
|
142
142
|
# Only proceed if network consumption energy is not zero to avoid unnecessary list comprehension
|
143
143
|
# self.rewards_individual = [r for r in self.rewards_individual if ((r != 0) and (r[len(r) -1] < 1))]
|
144
|
-
rewards = np.
|
144
|
+
rewards = np.median(rewards)
|
145
145
|
# self.rewards_individual = [{"ind": r, "net_consumption_energy": self.network_reward_consumption_energy(), "net_dispersion_energy": self.network_reward_dispersion_remaining_energy()} for r in self.rewards_individual if ((r != 0) and (self.network_reward_consumption_energy() != 0))]
|
146
146
|
for i in range(self.n_sensors):
|
147
147
|
if (self.remaining_energy[i] <= 0) or (self.number_of_packets[i] <= 0):
|
@@ -0,0 +1,7 @@
|
|
1
|
+
gym_examples/__init__.py,sha256=S9G__bqxInj6rG_6rjVIRiTN_PVoePzjBS7beva-hnQ,194
|
2
|
+
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
+
gym_examples/envs/wsn_env.py,sha256=cjQVkRn1geb6404gyQhCX-jKk4fvCh9WzSurfGPpXxU,17382
|
4
|
+
gym_examples-2.0.111.dist-info/METADATA,sha256=bVcqAqPulMkYgExdwOHgVpOMfvoiJZn-wNeZlUSwuzM,412
|
5
|
+
gym_examples-2.0.111.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
+
gym_examples-2.0.111.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
+
gym_examples-2.0.111.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
gym_examples/__init__.py,sha256=gH2T-ct0Hi6ezm9VcLdPSPAphqvJ4BDGynuVTjyBDeo,194
|
2
|
-
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
-
gym_examples/envs/wsn_env.py,sha256=PcTXkRFBNNM2SbIL61TY84dJtMHwxg8J-YeZZBD8YtU,17366
|
4
|
-
gym_examples-2.0.110.dist-info/METADATA,sha256=EM4ein8vHpfOgDM_KkeS5qIW-a2zyAkXc_3sxJWxOL4,412
|
5
|
-
gym_examples-2.0.110.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
-
gym_examples-2.0.110.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
-
gym_examples-2.0.110.dist-info/RECORD,,
|
File without changes
|
File without changes
|