Darwinbots Forum

Bots and Simulations => DNA - General => Topic started by: shvarz on March 14, 2008, 04:13:26 PM

Title: Sequence of events
Post by: shvarz on March 14, 2008, 04:13:26 PM
I feed my veggies by giving them 140 energy for each 1000 body. I charge all bots 0.135 per body per cycle. So, a veggie with 1000 body should end up with 5 energy points per cycle.

I have a suspicion that predators in my sim have access to all of the 140 energy points that veggies get in each cycle. Is that possible?  Basically I think that the following might happen:
1. Veggie gets 140 energy
2. Predator's shot is registered and some amount of energy (say 100) is set aside for the return shot (I have proportional return for shots).
3. Costs are applied and veggie looses 135 energy.

As a result the veggie is loosing 100+135 energy.
Title: Sequence of events
Post by: EricL on March 14, 2008, 04:32:02 PM
Your correct.  Veggies are fed at the end of the cycle.  So, at the beginning of the next cycle, they have whatever you fed them.  First in the cycle, shots are processed, so nrg feeding shots can take all the nrg a bot at the beginnign of the cycle.  Then lots of other stuff occurs including acessing body upkeep costs.
Title: Sequence of events
Post by: shvarz on March 14, 2008, 04:45:02 PM
Bah! That sucks... But at least now things make sense. I've been trying to raise the cost of body for non-veggies and I compensated veggies for that by giving them more energy. The numbers of predators actually went up as I increased the cost of body. This explains it - predators get fed more from each veggie and their bodies are too small for increased body cost to make a difference  
Title: Sequence of events
Post by: Numsgil on March 14, 2008, 09:34:25 PM
IIRC there's no hard and fast reason for the relative ordering of when shots get processed and veggies get nrg.  Mostly the idea is that veggies getting nrg should be done during body management routines, which themselves get done after costs are charged, so that bots die correctly.  We could move the veggy feeding routines to sometime in the beginning of the cycle without any side effects, I think.
Title: Sequence of events
Post by: EricL on March 15, 2008, 12:19:12 PM
Unless we partner it right up with body upkeep, it won't change anything.  Beginning of the cycle, end of the cycle... it won't matter while it's outside of UpdateBots().

I'd prefer not to change this...