A more classical approach

This commit is contained in:
Johnny Fernandes
2026-04-23 11:51:52 +01:00
parent f9c5093211
commit ffbfaa3977
2 changed files with 101 additions and 92 deletions
+4 -5
View File
@@ -94,9 +94,8 @@ def main():
# Access the underlying HerdingEnv for dispersion calculation
inner = env.envs[0] if hasattr(env, "envs") else env.venv.envs[0]
if not inner.penned[:inner.n_sheep].all():
ep_dispersion.append(
pairwise_mean(inner.sheep_pos, inner.n_sheep)
)
_, radius, _ = inner._flock_stats()
ep_dispersion.append(radius)
if first_ep and render_mode == "human":
pass # render() is called inside step()
@@ -134,8 +133,8 @@ def main():
f" ({sum(successes)}/{args.episodes})")
print(f" Time-to-pen : {mean_ttp:.1f} steps/sheep"
f" (successful episodes only)")
print(f" Flock dispersion: {mean_disp:.2f} m"
f" (mean pairwise distance while active)")
print(f" Flock radius : {mean_disp:.2f} m"
f" (max sheep-to-COM distance while active)")
print("=" * 50)