gym-examples 3.0.264__py3-none-any.whl → 3.0.266__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 -4
- {gym_examples-3.0.264.dist-info → gym_examples-3.0.266.dist-info}/METADATA +1 -1
- gym_examples-3.0.266.dist-info/RECORD +7 -0
- gym_examples-3.0.264.dist-info/RECORD +0 -7
- {gym_examples-3.0.264.dist-info → gym_examples-3.0.266.dist-info}/WHEEL +0 -0
- {gym_examples-3.0.264.dist-info → gym_examples-3.0.266.dist-info}/top_level.txt +0 -0
gym_examples/__init__.py
CHANGED
gym_examples/envs/wsn_env.py
CHANGED
@@ -133,10 +133,10 @@ class WSNRoutingEnv(gym.Env):
|
|
133
133
|
def step(self, actions):
|
134
134
|
actions = [actions[i] for i in range(self.n_agents)] # We want to go back from the MultiDiscrete action space to a tuple of tuple of Discrete action spaces
|
135
135
|
self.steps += 1
|
136
|
-
rewards = [-max_reward] * self.n_sensors
|
136
|
+
# rewards = [-max_reward] * self.n_sensors
|
137
|
+
rewards = [0] * self.n_sensors
|
137
138
|
dones = [False] * self.n_sensors
|
138
139
|
for i, action in enumerate(actions):
|
139
|
-
print(f"\nAction in WSNRoutingEnv: {action} and type: {type(action)}")
|
140
140
|
if action not in range(self.n_sensors + 1):
|
141
141
|
raise ValueError("Invalid action!")
|
142
142
|
|
@@ -169,8 +169,8 @@ class WSNRoutingEnv(gym.Env):
|
|
169
169
|
self.packet_latency[i] = 0
|
170
170
|
|
171
171
|
# rewards[i] = self.compute_individual_rewards(i, action)
|
172
|
-
rewards[i] = np.ones(input_dim) * max_reward # Reward for transmitting data to the base station
|
173
|
-
|
172
|
+
# rewards[i] = np.ones(input_dim) * max_reward # Reward for transmitting data to the base station
|
173
|
+
rewards[i] = np.ones(input_dim) # Reward for transmitting data to the base station
|
174
174
|
dones[i] = True
|
175
175
|
else:
|
176
176
|
distance = np.linalg.norm(self.sensor_positions[i] - self.sensor_positions[action])
|
@@ -0,0 +1,7 @@
|
|
1
|
+
gym_examples/__init__.py,sha256=KqEqczXOEfVmbkVd7dsDXk4gyzc5VC_HrycnPdSH_8M,166
|
2
|
+
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
+
gym_examples/envs/wsn_env.py,sha256=4CXrSu-8epidbKW7JgPIzbXPS-WPtCC82FIsdPPAlMQ,24863
|
4
|
+
gym_examples-3.0.266.dist-info/METADATA,sha256=KdqFD13218m6mSDcVJ5fpru17gAS0IuYts1m4uMPUTE,412
|
5
|
+
gym_examples-3.0.266.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
+
gym_examples-3.0.266.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
+
gym_examples-3.0.266.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
gym_examples/__init__.py,sha256=OE2WBgKyEbqBOaXf4v4N5a0qFaCkN5iUcgmZIdLghqk,166
|
2
|
-
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
-
gym_examples/envs/wsn_env.py,sha256=t0uJq77RsuDKn_VRKh8dY9khp4DE1etoHzaUd582OSw,24905
|
4
|
-
gym_examples-3.0.264.dist-info/METADATA,sha256=4l07YRLJpfbh8kvvuZIlaOTAls-N81hZPxxvNNAu8bM,412
|
5
|
-
gym_examples-3.0.264.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
-
gym_examples-3.0.264.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
-
gym_examples-3.0.264.dist-info/RECORD,,
|
File without changes
|
File without changes
|