I suppose the "don't build what can't be afforded" sounded like stockpile, but income/expenditure is checked by using the following logic in pseudocode:
Code: Select all
TimeToBuild = BuildTime / BuilderTime;
EnergyPerSecond = EnergyCost / TimeToBuild;
IF EnergyPerSecond > (EnergyIncome - EnergyExpense) - EnergyStockpile / BuildTime
TooExpensive
ELSE
NotTooExpensive
Yes, I know that it assumes the whole stockpile is available for the project, but it usually works out OK anyway.