A REAL PROGRESS

This commit is contained in:
Frank14f
2024-08-18 22:50:50 +08:00
parent c6f607dd8d
commit fb1efcd441
6 changed files with 165 additions and 85 deletions
Binary file not shown.
+2 -2
View File
@@ -120,7 +120,7 @@ class CustomEnv(gym.Env):
# barrier.wait()
self.fifo_states.append(self.flow_field.obs.copy()[2:14])
def calc_reward():
def proc_data():
states = np.array(self.fifo_states)
forces = states[-1, 6:12] / self.force_norm_fact
cd = (forces[0] + forces[2] + forces[4]) / 3
@@ -179,7 +179,7 @@ class CustomEnv(gym.Env):
result_queue.put((np.hstack([forces, sens]), reward))
run_flow_field(action)
calc_reward()
proc_data()
observation, reward = result_queue.get()
truncated = bool(np.any(observation > 1) or np.any(observation < -1))
File diff suppressed because one or more lines are too long
+151 -77
View File
File diff suppressed because one or more lines are too long