Samsara (https://en.wikipedia.org/wiki/Sa%E1%B9%83s%C4%81ra) algorithm:
while True:
person.birth()
person.get_old()
person.fall_sick()
person.die()
if person.liberated:
break
# only when liberated:
person.enjoy_bliss()