MCPcopy Create free account
hub / github.com/SimHacker/micropolis / initGraphMax

Method initGraphMax

MicropolisCore/src/MicropolisEngine/src/graph.cpp:140–197  ·  view source on GitHub ↗

Compute various max ranges of graphs */

Source from the content-addressed store, hash-verified

138
139/** Compute various max ranges of graphs */
140void Micropolis::initGraphMax()
141{
142 int x;
143
144 resHist10Max = 0;
145 comHist10Max = 0;
146 indHist10Max = 0;
147
148 for (x = 118; x >= 0; x--) {
149
150 if (resHist[x] < 0) {
151 resHist[x] = 0;
152 }
153 if (comHist[x] < 0) {
154 comHist[x] = 0;
155 }
156 if (indHist[x] < 0) {
157 indHist[x] = 0;
158 }
159
160 resHist10Max = max(resHist10Max, resHist[x]);
161 comHist10Max = max(comHist10Max, comHist[x]);
162 indHist10Max = max(indHist10Max, indHist[x]);
163
164 }
165
166 graph10Max =
167 max(resHist10Max,
168 max(comHist10Max,
169 indHist10Max));
170
171 resHist120Max = 0;
172 comHist120Max = 0;
173 indHist120Max = 0;
174
175 for (x = 238; x >= 120; x--) {
176
177 if (resHist[x] < 0) {
178 resHist[x] = 0;
179 }
180 if (comHist[x] < 0) {
181 comHist[x] = 0;
182 }
183 if (indHist[x] < 0) {
184 indHist[x] = 0;
185 }
186
187 resHist120Max = max(resHist120Max, resHist[x]);
188 comHist120Max = max(comHist120Max, comHist[x]);
189 indHist120Max = max(indHist120Max, indHist[x]);
190
191 }
192
193 graph120Max =
194 max(resHist120Max,
195 max(comHist120Max,
196 indHist120Max));
197}

Callers

nothing calls this directly

Calls 1

maxFunction · 0.85

Tested by

no test coverage detected