Skip to content

Commit

Permalink
Add delay to SlopeELBirth
Browse files Browse the repository at this point in the history
  • Loading branch information
kngwyu committed Aug 27, 2024
1 parent 2ad5c10 commit 6aaabe1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/emevo/birth_and_death.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,13 @@ class SlopeELBirth(BirthFunction):
slope: float = 1.0
scale: float = 0.1
const: float = 0.0
delay: float = 0.0

def __call__(self, age: jax.Array, energy: jax.Array) -> jax.Array:
del age
return self.const + self.scale / (1.0 + jnp.exp(-energy * self.slope))
return self.const + self.scale / (
1.0 + jnp.exp(self.delay - energy * self.slope)
)

def cumulative(self, age: jax.Array, energy: jax.Array) -> jax.Array:
"""Birth function b(t)"""
Expand Down

0 comments on commit 6aaabe1

Please sign in to comment.