gym-examples 3.0.418__py3-none-any.whl → 3.0.420__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 -9
- {gym_examples-3.0.418.dist-info → gym_examples-3.0.420.dist-info}/METADATA +1 -1
- gym_examples-3.0.420.dist-info/RECORD +7 -0
- gym_examples-3.0.418.dist-info/RECORD +0 -7
- {gym_examples-3.0.418.dist-info → gym_examples-3.0.420.dist-info}/WHEEL +0 -0
- {gym_examples-3.0.418.dist-info → gym_examples-3.0.420.dist-info}/top_level.txt +0 -0
gym_examples/__init__.py
CHANGED
gym_examples/envs/wsn_env.py
CHANGED
@@ -93,7 +93,7 @@ class WSNRoutingEnv(gym.Env):
|
|
93
93
|
# Create filenames to save statistics for evaluation
|
94
94
|
self.statistics_filename = "results/data/Statistics_filename_" + os.getenv('ALGO_NAME') + ".txt"
|
95
95
|
with open(self.statistics_filename, 'w') as file:
|
96
|
-
file.write("
|
96
|
+
file.write("returns, total_consumption_energy, std_remaining_energy, network_throughput, energy_efficiency, packet_delivery_ratio, network_lifetime, average_latency\n")
|
97
97
|
# Initialize list of episode metrics
|
98
98
|
self.num_timesteps = num_timesteps # This argument is for the PPO algorithm
|
99
99
|
self.version = version # This argument is for the PPO algorithm
|
@@ -142,14 +142,7 @@ class WSNRoutingEnv(gym.Env):
|
|
142
142
|
|
143
143
|
# Append the statistics to the .txt file
|
144
144
|
with open(self.statistics_filename, 'a') as file:
|
145
|
-
file.write(f"{self.episode_return}, {total_consumption_energy}, {std_remaining_energy}, {
|
146
|
-
|
147
|
-
# print("Episode count: ", self.episode_count)
|
148
|
-
# print("Episode return: ", self.episode_return)
|
149
|
-
# print("Total consumption energy: ", total_consumption_energy)
|
150
|
-
# print("Std remaining energy: ", std_remaining_energy)
|
151
|
-
# print("Mean remaining energy: ", mean_remaining_energy)
|
152
|
-
# print("Network lifetime: ", self.network_lifetime)
|
145
|
+
file.write(f"{self.episode_return}, {total_consumption_energy}, {std_remaining_energy}, {network_throughput}, {energy_efficiency}, {packet_delivery_ratio}, {network_lifetime}, {average_latency}\n")
|
153
146
|
|
154
147
|
self.episode_return = 0
|
155
148
|
self.sensor_positions = np.random.rand(self.n_sensors, 2) * (upper_bound - lower_bound) + lower_bound
|
@@ -0,0 +1,7 @@
|
|
1
|
+
gym_examples/__init__.py,sha256=R53smKQgq-_6snOPOrIKXJdQQtephqoYNarnqXcS6lQ,166
|
2
|
+
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
+
gym_examples/envs/wsn_env.py,sha256=CFTaC2-YCH8MFiM_8e7nDZubT1lwB-z_SAtypmNy34E,27077
|
4
|
+
gym_examples-3.0.420.dist-info/METADATA,sha256=E21W8_UoEX6GZ3CxJZOW8ejjiBM0BkFsgGGzQuwByMA,412
|
5
|
+
gym_examples-3.0.420.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
+
gym_examples-3.0.420.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
+
gym_examples-3.0.420.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
gym_examples/__init__.py,sha256=9QC8DKfLRfiQyo3MbVoVddXSYyo0G3LUTftTRLeaFdw,166
|
2
|
-
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
-
gym_examples/envs/wsn_env.py,sha256=psQI0Aitq6Xpqdbe2Fep2Up1s6ufcLE9vrEQimHQ5Pk,27591
|
4
|
-
gym_examples-3.0.418.dist-info/METADATA,sha256=7mdj538tM3Lq_ZxFe_LXRDIbQUPNaGywVgVjaGPmioQ,412
|
5
|
-
gym_examples-3.0.418.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
-
gym_examples-3.0.418.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
-
gym_examples-3.0.418.dist-info/RECORD,,
|
File without changes
|
File without changes
|