diff --git a/src/player/malte/MalteAI.java b/src/player/malte/MalteAI.java index 70450eb..fd14a0e 100644 --- a/src/player/malte/MalteAI.java +++ b/src/player/malte/MalteAI.java @@ -147,16 +147,16 @@ public class MalteAI implements Player{ } } // Maybe we get lucky TODO: Expand this. - int nrOfMyIDAround = 0; - int nrOfEnemyIDAround = 0; + double extraWeight = 0.0; for (int i = 0; i < ids.length; i++) { if (ids[i] == this.id) { - nrOfMyIDAround++; + extraWeight += Math.pow(nrs[i], 2) * 2; } else if (ids[i] == this.enemyID) { - nrOfEnemyIDAround++; + extraWeight += Math.pow(nrs[i], 2); } } - weight *= 1.0 + (nrOfEnemyIDAround + nrOfMyIDAround) / (8.0 * 10.0); + extraWeight /= 10 * 126; + weight *= extraWeight + 1.0; return weight; }