Skip to content

Commit

Permalink
Avoid NAN
Browse files Browse the repository at this point in the history
  • Loading branch information
kngwyu committed Oct 2, 2024
1 parent d2a0847 commit e863053
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion experiments/cf_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ def replace_net(
is_active = env_state.unique_id.is_active()
popl = int(jnp.sum(is_active))
avg_e = float(jnp.mean(env_state.status.energy[is_active]))
print(f"Population: {popl} Avg. Energy: {avg_e}")
if popl > 0:
print(f"Population: {popl} Avg. Energy: {avg_e}")

# Extinct?
n_active = jnp.sum(env_state.unique_id.is_active()) # type: ignore
Expand Down

0 comments on commit e863053

Please sign in to comment.