@@ -56,7 +56,10 @@ namespace suboo {
56
56
GameState state = tech.getInitial ();
57
57
BuildOrder bopre;
58
58
std::unordered_set<UnitId> seen;
59
- for (auto & u : state.getUnits ()) {
59
+ for (auto & u : state.getFreeUnits ()) {
60
+ seen.insert (u.type );
61
+ }
62
+ for (auto & u : state.getBusyUnits ()) {
60
63
seen.insert (u.type );
61
64
}
62
65
int sz = bo.getItems ().size ();
@@ -117,7 +120,10 @@ namespace suboo {
117
120
GameState state = tech.getInitial ();
118
121
BuildOrder bopre;
119
122
std::unordered_set<UnitId> seen;
120
- for (auto & u : state.getUnits ()) {
123
+ for (auto & u : state.getFreeUnits ()) {
124
+ seen.insert (u.type );
125
+ }
126
+ for (auto & u : state.getBusyUnits ()) {
121
127
seen.insert (u.type );
122
128
}
123
129
int vesp=0 ;
@@ -164,6 +170,7 @@ namespace suboo {
164
170
optimizers.emplace_back (new AddProduction ());
165
171
optimizers.emplace_back (new LeftShifter ());
166
172
fastoptimizers.emplace_back (new LeftShifter ());
173
+ fastoptimizers.emplace_back (new RemoveExtra ());
167
174
optimizers.emplace_back (new AddVespeneGatherer ());
168
175
169
176
@@ -292,17 +299,23 @@ namespace suboo {
292
299
int soongas = 0 ;
293
300
294
301
int vcount =0 ;
295
- for (auto & u : gs.getUnits ()) {
302
+ for (auto & u : gs.getFreeUnits ()) {
296
303
if (u.state == UnitInstance::MINING_VESPENE) {
297
304
vcount++;
298
305
}
299
306
else if (u.type == UnitId::PROTOSS_ASSIMILATOR && u.state == UnitInstance::FREE) {
300
307
gas++;
301
308
}
309
+ }
310
+ for (auto & u : gs.getBusyUnits ()) {
311
+ if (u.state == UnitInstance::MINING_VESPENE) {
312
+ vcount++;
313
+ }
302
314
else if (u.type == UnitId::PROTOSS_ASSIMILATOR) {
303
315
soongas++;
304
316
}
305
317
}
318
+
306
319
if (vcount >= 3 * (gas+soongas)) {
307
320
std::cout << " Gas over saturated skipping \n " ;
308
321
// gs.print(std::cout);
0 commit comments