gym-examples 3.0.164__py3-none-any.whl → 3.0.167__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 CHANGED
@@ -6,4 +6,4 @@ register(
6
6
  max_episode_steps=50,
7
7
  )
8
8
 
9
- __version__ = "3.0.164"
9
+ __version__ = "3.0.167"
@@ -8,6 +8,7 @@ from datetime import datetime
8
8
  import torch
9
9
  import torch.nn as nn
10
10
  import torch.nn.functional as F
11
+ import os
11
12
 
12
13
  # Define the network parameters for the final reward function
13
14
  input_dim = 7 # length of the individual rewards vector
@@ -46,6 +47,9 @@ net = Attention(input_dim, output_dim)
46
47
  net = net.double() # Convert the weights to Double
47
48
 
48
49
  class WSNRoutingEnv(gym.Env):
50
+
51
+ print_stats = False # Global flag to control printing of statistics
52
+
49
53
  def __init__(self, n_sensors = 20, coverage_radius=(upper_bound - lower_bound)/4):
50
54
 
51
55
  super(WSNRoutingEnv, self).__init__()
@@ -71,7 +75,7 @@ class WSNRoutingEnv(gym.Env):
71
75
  self.reset()
72
76
 
73
77
  def reset(self):
74
- if self.episode_count > 1:
78
+ if self.episode_count > 1 and os.getenv('PRINT_STATS') == '1':
75
79
  print(f"Episode: {self.episode_count}")
76
80
  print(f"This episode ends with # Steps: {self.log_steps}")
77
81
  print(f"This episode ends with Done: {self.log_done}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gym-examples
3
- Version: 3.0.164
3
+ Version: 3.0.167
4
4
  Summary: A custom environment for multi-agent reinforcement learning focused on WSN routing.
5
5
  Home-page: https://github.com/gedji/CODES.git
6
6
  Author: Georges Djimefo
@@ -0,0 +1,7 @@
1
+ gym_examples/__init__.py,sha256=skAF_aeIYspj8jzblD8MdAQ-UHo9jCZdEOnkBpdg1FQ,194
2
+ gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
3
+ gym_examples/envs/wsn_env.py,sha256=yZDuhrioWV6p0cySol8Nl_f8NDzw0KvI0KwbTloE-CE,22965
4
+ gym_examples-3.0.167.dist-info/METADATA,sha256=U2Ewa0n8PgUJpkYUVgECLhbvqeb6NBUDHYX8MJJ9VQA,412
5
+ gym_examples-3.0.167.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
6
+ gym_examples-3.0.167.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
7
+ gym_examples-3.0.167.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- gym_examples/__init__.py,sha256=EBSBe55Y7WGUFcWXt8yCdWTgFt5HfT4NfT0MhYV91Ic,194
2
- gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
3
- gym_examples/envs/wsn_env.py,sha256=BR0OUpLWTgwTBv55bOT2pCSpNwz4zp6zTmC9seZ3Kvw,22840
4
- gym_examples-3.0.164.dist-info/METADATA,sha256=XHTU4gl7c9o_lHaCA09f72X6VwL9rNBWjjOehYMzpWk,412
5
- gym_examples-3.0.164.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
6
- gym_examples-3.0.164.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
7
- gym_examples-3.0.164.dist-info/RECORD,,