As a biologist I wanted to show some basic nature within a space, a digital island within a c++
This is the classic Lotka Volterra interaction. Named after Alfred J. Lotka and Vito Volterra and while the former originally used this model in 1910 for the description of chemical reactions, Volterra independently came up with this a fish-catch model in the Adriatic.
Instead of showing the amount of prey and predator as number or a graph I started with two circles growing and oscillating (but i might chance this as I get more acquainted with c++. Prey's (Students) or predators (Teachers) can be killed or fed to the Island at a constant rate or only once.
a => plus one teachers every new frame (initial value is 0)
A => plus one teachers once
z => minus one teacher every new frame (initial value is 0)
Z => minus one teachers once
q => random value beween 10 and -10 every new frame (initial value is 0)
Q => adds a random value beween 10 and -10 once
1 => reset the addition of teachers to 0
s => plus one student every new frame (initial value is 0)
S => plus one student once
x => minus one student every new frame (initial value is 0)
X => plus one student once
w => adds a random value beween 10 and -10 every new frame (initial value is 0)
W => adds a random value beween 10 and -10 once
2 => reset the addition of student to 0
The model is added with a carrying capacity for both Students and Teachers since there only that much blackboards and seats on the university island. I'm currently working on perhaps using sliders and adjusting the parameters.
These are the most important formulas, adjusted with carrying capacities and regular or occasional inflow (doctorates and exchange students) and outflow (fire teachers and flunking students). Let keep it a bit positive and say that if you're eaten as a student you're graduated.
deltaPrey = birthRatePrey* (1-(oldNumPrey/caryingCapacityPrey))* oldNumPrey - predationRate * oldNumPredator * oldNumPrey + inflowPrey + inflowPreyOnce;
deltaPredator = predationEfficiency*predationRate*oldNumPrey*oldNumPredator * (1-(oldNumPredator/caryingCapacityPredator)) - deathRatePredator * oldNumPredator + inflowPredatorOnce;
Let the game begin..
screen shots: