A little experiment to observe the behavior of a population growth.
What is it?
- There are initial entities you should decide first. Call them "TOWN".
- Every TOWN has an initial fixed number of inhabitants. Call them "PEOPLE".
- The society is monogamous. So if a PERSON meet another one with opposite sex, there's a chance to them to "MARRY".
- When MARRIED PEOPLE meet, there's a chance to give a "BIRTH" (if they're in TOWN).
- Every TOWN is linked to another with a web of path, "LINKS" (you cannot see them), but the furthest ones.
- The PEOPLES can travel through the LINKS and in case MARRY, but cannot give BIRTH.
- New BORN cannot travel from TOWN, MARRY or procreate until his adulthood.
How to make it work:
- (Optional) Change values in INITIALIZ. PROPERTIES. Probabilities are float numbers from 0.00 to 1.00. The others are integers.
- (Optional) Change values in SIMULATION PROPERTIES. You can do this during simulation as well.
- Click POPULATE to build the towns and add some living entities. They'll be placed randomly on the screen.
- (Optional) Click On/Off fancy animations to speed up the simulation. They're only there for fashion.
- Click Start/Stop Iterations to start the simulation iteration, or click Iterate one step to make only an iteration.
- At the end of a simulation, if the population is extinct, on the right panel it will be created automatically the graph of the progress in growth and death of the population. Else you can click Make graph to build it.
- RED = max age
- GREEN = average age
- BLUE = min age.
Think to each TOWN as an undergraduate human body containing an amount of virus, surrounded by other infected undergraduate. How much time will be required to cure the illness - changing the parameters of his propagation through town and the infection expansion speed - to be eliminated?
It should work well with all modern browsers, old browsers should be supported too, if not for the animation.
The process is very CPU intensive the more PEOPLE are active in the same time.
Tests with my NVIDIA GeForce GT 540M, Intel Core i5-2410M give this results: only Google Chrome has the power to merge animation and computation together, even with over 200 entities moving in the screen. Opera is equal to Crome, so no great differences. Astonishing, Internet Explorer is quite good and can manage about 100 entities. Firefox is inesplicably the worse, and can move fluidly only 10 entities, more are too much.
Since the history is recorded every POPULATION you initialize, the more iterations you made the slower the script will become.
© 2015, MBC