comefrom: simulate */
| 787 | |
| 788 | /* comefrom: simulate */ |
| 789 | void Micropolis::take120Census() |
| 790 | { |
| 791 | // TODO: Make configurable parameters. |
| 792 | int resPopDenom = 8; |
| 793 | |
| 794 | /* Long Term Graphs */ |
| 795 | short x; |
| 796 | |
| 797 | resHist120Max = 0; |
| 798 | comHist120Max = 0; |
| 799 | indHist120Max = 0; |
| 800 | |
| 801 | for (x = 238; x >= 120; x--) { |
| 802 | |
| 803 | resHist120Max = max(resHist120Max, resHist[x]); |
| 804 | comHist120Max = max(comHist120Max, comHist[x]); |
| 805 | indHist120Max = max(indHist120Max, indHist[x]); |
| 806 | |
| 807 | resHist[x + 1] = resHist[x]; |
| 808 | comHist[x + 1] = comHist[x]; |
| 809 | indHist[x + 1] = indHist[x]; |
| 810 | crimeHist[x + 1] = crimeHist[x]; |
| 811 | pollutionHist[x + 1] = pollutionHist[x]; |
| 812 | moneyHist[x + 1] = moneyHist[x]; |
| 813 | |
| 814 | } |
| 815 | |
| 816 | graph120Max = resHist120Max; |
| 817 | graph120Max = max(graph120Max, comHist120Max); |
| 818 | graph120Max = max(graph120Max, indHist120Max); |
| 819 | |
| 820 | resHist[120] = resPop / resPopDenom; |
| 821 | comHist[120] = comPop; |
| 822 | indHist[120] = indPop; |
| 823 | crimeHist[120] = crimeHist[0] ; |
| 824 | pollutionHist[120] = pollutionHist[0]; |
| 825 | moneyHist[120] = moneyHist[0]; |
| 826 | changeCensus(); |
| 827 | } |
| 828 | |
| 829 | |
| 830 | /** Collect taxes |