http://www.luis-guzman.com/OpenGen_AI.html
Purchasing
AI doesn't use its total prestige to purchase new units, as it reserves some prestige to reinforce units. AI figures all the prestige needed to reinforce all units with SP below the SP base at the time this phase is checked. AI reserves the percentage defined by $buy_refit (default is 70%).
If the remaining prestige is less than the cost of the cheaper unit or if less than $buy_minpres or the AI cannot deploy units, then the AI doesn't purchase anything.
If AI has prestige to spend, it first check if any VH is in danger and if it can purchase a unit to defend it moving from the closer SH.
If AI still has prestige it assigns the percentage defined by $buy_newair (default 50%) to buy air units in sequence Bomber,Fighter,Bomber, etc .. .
If still AI has prestige it scans owned SH and buy new units in the sequence defined by:
$buy_aggresive (default to 2, 1, 9, 5 ,1, 4, 2, 3) if AI global stance is defined as aggressive
$buy_defensive (default to 1 ,1 ,9 ,10,1, 4, 9, 2) if AI global stance is defined as defensive
Note: the numbers are the class id to buy, meaning 1 ,1 ,9 ,10, 1, 4, 9, 2 that AI will try to buy INF, INF, ATY, AD, INF, AT, ATY, TANK, looping through the sequence and buying one unit of the type defined until running out of prestige.