adaptationMatrix()
This function is the heart of the whole adaptation mechanism. This is a purely arithmetical function that returns the priorities for using anti-tank, anti-personnel, anti-building or anti-air tanks based on the following parameters of the current game situation:
adapt()
This function figures out the parameters for adaptationMatrix(), calls it and then sets four variables based on its return value, RATE_AP, RATE_AT, RATE_AB, and RATE_AA respectively.
This function is called by a timer defined in eventStartLevel().
produceTanks()
This function makes factories produce tanks of one of the four classes in a ratio defined by RATE_AP, RATE_AT, RATE_AB, and RATE_AA.
produceCyborgs()
This function makes cyborg factories produce cyborgs of one of the two classes in a ratio defined by RATE_AP and RATE_AT.
addTankToSomeGroup()
This function adds a newly-produced tank or cyborg to one of the combat groups. The decision is based on how effective the tank will be against the enemy this group is ordered to fight against. This function calls adaptationMatrix(), giving it stats of a particular enemy rather than stats of all enemies at once.
doResearch()
This function is responsible for research. It uses its own built-in adaptation matrix, because it doesn't need to take into account the amounts of tanks we already have. It also decides how much fundamental research we require based on how much oil derricks we currently control, for it is known that on high-oil games fundamental research is usually much more important.
In fact, doResearch() randomly picks one of the five research branches picked by the personality: fundamental research, anti-personnel weapon research, anti-tank weapon research, anti-building weapon research and anti-air weapon research, with probabilities defined by the adaptation algorithm. There is also a pre-defined primary research path that is a priority until it is completed.
