A more classical approach
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user