public int getOverDrones(EcState s) { int overDrones = ((s.productionTime() / 17) + s.usedDrones()) * overDroneEfficiency / 100; overDrones = Math.min(overDrones, maxOverDrones); return overDrones; }
public boolean waypointMissed(EcBuildOrder candidate) { for (EcState s : waypoints) { if (candidate.seconds < s.targetSeconds) continue; if (s.isSatisfied(candidate)) continue; return true; } return false; }
public static EcState defaultDestination() { EcState d = new EcState(); d.drones = 0; d.overlords = 0; d.hatcheries = 0; d.targetSeconds = 60 * 120; return d; }
public int getSumStuff() { if (waypoints.size() > 0) { EcState state = defaultDestination(); for (EcState s : waypoints) { state.union(s); } state.union(this); return state.getSumStuff(); } int i = hatcheries + lairs + hives + spawningPools + evolutionChambers + roachWarrens + hydraliskDen + banelingNest + infestationPit + greaterSpire + ultraliskCavern + gasExtractors + spire + spineCrawlers + sporeCrawlers + nydusNetwork + nydusWorm + drones + overlords + overseers + zerglings + banelings * 2 + roaches + mutalisks + infestors + queens + hydralisks + corruptors + ultralisks + broodlords * 2; if (metabolicBoost) i++; if (adrenalGlands) i++; if (glialReconstitution) i++; if (tunnelingClaws) i++; if (burrow) i++; if (pneumatizedCarapace) i++; if (ventralSacs) i++; if (centrifugalHooks) i++; if (melee1) i++; if (melee2) i++; if (melee3) i++; if (missile1) i++; if (missile2) i++; if (missile3) i++; if (armor1) i++; if (armor2) i++; if (armor3) i++; if (groovedSpines) i++; if (neuralParasite) i++; if (pathogenGlands) i++; if (flyerAttack1) i++; if (flyerAttack2) i++; if (flyerAttack3) i++; if (flyerArmor1) i++; if (flyerArmor2) i++; if (flyerArmor3) i++; if (chitinousPlating) i++; for (EcState s : waypoints) i += s.getSumStuff(); return i; }
public int getParityDrones(EcState s) { int optimalDrones = Math.min((s.bases() * 16) + (s.gasExtractors * 3), maxOverDrones); int parityDrones = Math.min(s.getOverDrones(s), optimalDrones); return parityDrones; }
public boolean isSatisfied(EcState candidate) { if (waypoints.size() > 0) { EcState state = defaultDestination(); for (EcState s : waypoints) { state.union(s); } state.union(this); return state.isSatisfied(candidate); } if (candidate.drones < drones) return false; if (candidate.zerglings < zerglings) return false; if (candidate.banelings < banelings) return false; if (candidate.roaches < roaches) return false; if (candidate.mutalisks < mutalisks) return false; if (candidate.queens < queens) return false; if (candidate.hydralisks < hydralisks) return false; if (candidate.infestors < infestors) return false; if (candidate.corruptors < corruptors) return false; if (candidate.ultralisks < ultralisks) return false; if (candidate.broodlords < broodlords) return false; if (candidate.overlords < overlords) return false; if (candidate.overseers < overseers) return false; if (candidate.bases() < requiredBases) return false; if (candidate.lairs < lairs) return false; if (candidate.hives < hives) return false; if (candidate.gasExtractors < gasExtractors) return false; if (candidate.spawningPools < spawningPools) return false; if (candidate.banelingNest < banelingNest) return false; if (candidate.roachWarrens < roachWarrens) return false; if (candidate.hydraliskDen < hydraliskDen) return false; if (candidate.infestationPit < infestationPit) return false; if (candidate.spire < spire) return false; if (candidate.greaterSpire < greaterSpire) return false; if (candidate.ultraliskCavern < ultraliskCavern) return false; if (candidate.evolutionChambers < evolutionChambers) return false; if (candidate.spineCrawlers < spineCrawlers) return false; if (candidate.sporeCrawlers < sporeCrawlers) return false; if (candidate.nydusNetwork < nydusNetwork) return false; if (candidate.nydusWorm < nydusWorm) return false; if ((!candidate.metabolicBoost) & metabolicBoost) return false; if ((!candidate.adrenalGlands) & adrenalGlands) return false; if ((!candidate.glialReconstitution) & glialReconstitution) return false; if ((!candidate.tunnelingClaws) & tunnelingClaws) return false; if ((!candidate.burrow) & burrow) return false; if ((!candidate.pneumatizedCarapace) & pneumatizedCarapace) return false; if ((!candidate.ventralSacs) & ventralSacs) return false; if ((!candidate.centrifugalHooks) & centrifugalHooks) return false; if ((!candidate.melee1) & melee1) return false; if ((!candidate.melee2) & melee2) return false; if ((!candidate.melee3) & melee3) return false; if ((!candidate.missile1) & missile1) return false; if ((!candidate.missile2) & missile2) return false; if ((!candidate.missile3) & missile3) return false; if ((!candidate.armor1) & armor1) return false; if ((!candidate.armor2) & armor2) return false; if ((!candidate.armor3) & armor3) return false; if ((!candidate.groovedSpines) & groovedSpines) return false; if ((!candidate.neuralParasite) & neuralParasite) return false; if ((!candidate.pathogenGlands) & pathogenGlands) return false; if ((!candidate.flyerAttack1) & flyerAttack1) return false; if ((!candidate.flyerAttack2) & flyerAttack2) return false; if ((!candidate.flyerAttack3) & flyerAttack3) return false; if ((!candidate.flyerArmor1) & flyerArmor1) return false; if ((!candidate.flyerArmor2) & flyerArmor2) return false; if ((!candidate.flyerArmor3) & flyerArmor3) return false; if ((!candidate.chitinousPlating) & chitinousPlating) return false; if (EcSettings.overDrone || EcSettings.workerParity) { int overDrones = getOverDrones(candidate); if (EcSettings.overDrone && candidate.drones < overDrones) { return false; } if (EcSettings.workerParity) { int parityDrones = getParityDrones(candidate); if (candidate.drones < parityDrones) { return false; } } } return true; }
protected void assign(EcState s) { for (EcState st : waypoints) try { s.waypoints.add((EcState) st.clone()); } catch (CloneNotSupportedException e) { // TODO Auto-generated catch block e.printStackTrace(); } s.minerals = minerals; s.gas = gas; s.supplyUsed = supplyUsed; s.requiredBases = requiredBases; s.hatcheries = hatcheries; s.lairs = lairs; s.hives = hives; s.spawningPools = spawningPools; s.banelingNest = banelingNest; s.evolutionChambers = evolutionChambers; s.roachWarrens = roachWarrens; s.hydraliskDen = hydraliskDen; s.infestationPit = infestationPit; s.greaterSpire = greaterSpire; s.ultraliskCavern = ultraliskCavern; s.gasExtractors = gasExtractors; s.spire = spire; s.greaterSpire = greaterSpire; s.spineCrawlers = spineCrawlers; s.sporeCrawlers = sporeCrawlers; s.nydusNetwork = nydusNetwork; s.nydusWorm = nydusWorm; s.zerglings = zerglings; s.banelings = banelings; s.roaches = roaches; s.mutalisks = mutalisks; s.drones = drones; s.queens = queens; s.hydralisks = hydralisks; s.infestors = infestors; s.corruptors = corruptors; s.ultralisks = ultralisks; s.broodlords = broodlords; s.overlords = overlords; s.overseers = overseers; s.metabolicBoost = metabolicBoost; s.adrenalGlands = adrenalGlands; s.glialReconstitution = glialReconstitution; s.tunnelingClaws = tunnelingClaws; s.burrow = burrow; s.pneumatizedCarapace = pneumatizedCarapace; s.ventralSacs = ventralSacs; s.centrifugalHooks = centrifugalHooks; s.melee1 = melee1; s.melee2 = melee2; s.melee3 = melee3; s.missile1 = missile1; s.missile2 = missile2; s.missile3 = missile3; s.armor1 = armor1; s.armor2 = armor2; s.armor3 = armor3; s.groovedSpines = groovedSpines; s.neuralParasite = neuralParasite; s.pathogenGlands = pathogenGlands; s.flyerAttack1 = flyerAttack1; s.flyerAttack2 = flyerAttack2; s.flyerAttack3 = flyerAttack3; s.flyerArmor1 = flyerArmor1; s.flyerArmor2 = flyerArmor2; s.flyerArmor3 = flyerArmor3; s.chitinousPlating = chitinousPlating; s.seconds = seconds; s.targetSeconds = targetSeconds; s.invalidActions = invalidActions; s.actionLength = actionLength; }