Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we go back in time ? #59

Open
hit-11 opened this issue Sep 22, 2022 · 3 comments
Open

Can we go back in time ? #59

hit-11 opened this issue Sep 22, 2022 · 3 comments
Assignees

Comments

@hit-11
Copy link

hit-11 commented Sep 22, 2022

What if I want to go back in time and do a reverse evolution of a species ?
PS- reverse evolution = revolution 馃く

@DarkStar1997
Copy link
Collaborator

DarkStar1997 commented Sep 22, 2022

Definitely not a bad idea. We have an increment_age function which is actually responsible for increasing the age and all the stats. We can write a decrement_age function though to do the inverse!

Why do you want it though? Do you want a deliberate devolution of some particular species :)

@sayansil
Copy link
Owner

Yeah! The decrement_age function should not be the problem. If we keep track of the traits with which one died, we can resurrect that organism and roll back time.

HOWEVER!!!! There is a lot of randomness involved when incrementing the age of an organism. By writing the decrement_age function we bring in the same randomness so by moving back in time we may not get the same organism. Sounds like sci-fi. Love it.

However, to maintain exact attributes of organisms after rollback, we can

  1. Keep a god damn copy of the stats for every organism at every instance
  2. Remove randomness and make most of the logic predictable - no fun.

Let's discuss further and get back to you.

@DarkStar1997
Copy link
Collaborator

The first approach of keeping a copy of the stats of every organism at every instant is the right way but it is absolutely impractical as it can quickly blow up in memory requirements with a small increase in the number of years and organisms.

Instead we can be smarter and generate a polynomial function to interpolate the data of the organism's lifetime stats. We can decide on the maximum degree and all we need to store is an array of coefficients corresponding to the degree of the polynomial for each organism. This can be easily implemented using some good old optimized linear algebra library (we just need matrix inversion, transpose and a matrix multiplication).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants