Author Topic: Veggie pop control  (Read 3759 times)

Offline Sprotiel

  • Bot Destroyer
  • ***
  • Posts: 135
    • View Profile
Veggie pop control
« on: June 23, 2005, 11:50:52 AM »
The way I understand population control, it only allows vegetables to reproduce when there's less of them than the threshold, in which case all of them trying to repro are allowed to do so, which means that veggie pop can reach up to twice the threshold. The trouble is that right now, I have a sim with pop max = 1000 and 2192 vegetables!

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Veggie pop control
« Reply #1 on: June 23, 2005, 12:17:32 PM »
I've included something in the new version no one has yet, I've forgot to mention it.

As the number of veggies drops below the max, vegs are allowed to reproduce.  As the new population climbs above the max, vegs have a one in (how many over we are) chance of reproing.

It's not perfect...

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Veggie pop control
« Reply #2 on: June 23, 2005, 12:39:29 PM »
I originally tried to set it up such that each veg could only repro if the current population was less than the limit.
The trouble is that the veg population is calculated independently of the repro loop so it didn't work out right.

I could have fixed this by incrementing the population as a new veg was born but this would have meant that only veggies with low robot numbers would be able to repro as they would be get to go first each time.

I like Num's idea better.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Veggie pop control
« Reply #3 on: June 23, 2005, 12:49:44 PM »
It still favors bots with low numbers, but at least it addresses the problem.

Offline Greven

  • Bot Destroyer
  • ***
  • Posts: 345
    • View Profile
Veggie pop control
« Reply #4 on: June 24, 2005, 09:01:45 AM »
The problem is, if you have a maxpop at 75, and you have a veggie pop 75 >, the veggies just accumulate energy, and a lot of them get up to 32000, even at 5 nrg/cycle/veggie. When the pop goes under 75, 74 for example, all the vegs reproduce (at the extreme) and we get 2 * 74 = 148, which completely schrews up the sim (or so I think), although the energy level is the same, it is just easier for the bots to find possible food....

This problem need to be adressed as soon as possible! I know Num & PY is busy on other things, but it shouldnt be too hard...?
« Last Edit: June 24, 2005, 09:03:07 AM by Greven »
10010011000001110111110100111011001101100100000110110111000011101011110010110000
011000011000001100010110010111101001110100110010111100101000001000001111001011101
001101001110011011010011100011110100111000011101100100000100110011010011100110110
010110000011100111101001110110111101011101100110000111101001101001110111111011101
01100100000111010011010001100001110111010000010001001000010100001

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Veggie pop control
« Reply #5 on: June 24, 2005, 09:21:38 AM »
The trouble is in the hierarchy of the program.

The way reproduction works is that when a robot activates a repro gene, it is added to an array of "robots that will reproduce on this cycle" and then the program moves on to the next robot.
Later after all the main routines have been processed (including the one that counts the veggies), it moves onto the repro array and goes through them all one by one, form low robot number to high.

Who gets to repro and who doesn't?

If we set it to cut off when the cap is reached then all the lower number bots will reproduce while the higher ones won't.
Random access to the list will take too long to process.
Nums new feature only allows each one to repro if it meets a certain criteria based on a random number (1 in 100) a bit like mutations. It shuld be a good compromise, particularly if the repro chance can be set in the control panel.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Greven

  • Bot Destroyer
  • ***
  • Posts: 345
    • View Profile
Veggie pop control
« Reply #6 on: June 24, 2005, 09:29:43 AM »
Okay sounds better to me :)
10010011000001110111110100111011001101100100000110110111000011101011110010110000
011000011000001100010110010111101001110100110010111100101000001000001111001011101
001101001110011011010011100011110100111000011101100100000100110011010011100110110
010110000011100111101001110110111101011101100110000111101001101001110111111011101
01100100000111010011010001100001110111010000010001001000010100001

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Veggie pop control
« Reply #7 on: June 24, 2005, 10:25:43 AM »
Just thought I'd post the code for you to look at:

Code: [Select]
If rob(n).Veg = True And totvegs > SimOpts.MaxPopulation Then
    t = Random(0, totvegs - SimOpts.MaxPopulation)
    totvegs = totvegs + 1
    If t > 0 Then Exit Sub 'attempt to stop veg overpopulation but will it work?
  ElseIf rob(n).Veg = True Then
    totvegs = totvegs + 1
  End If

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Veggie pop control
« Reply #8 on: June 24, 2005, 11:39:48 AM »
Why not just set it up so that veggies always have to pass a random check before reproducing. We can set the chance of them reproducing in the options.
As they exceed the maxpop the chance can just get progressively smaller.

Could be a useful way to control explosive populations of veggies.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D