From 8cab8c8deb884fc158888e1fcdfc4a6465e32a65 Mon Sep 17 00:00:00 2001 From: Malte Tammena Date: Mon, 23 Oct 2017 13:44:42 +0200 Subject: [PATCH] Playing with the weights --- src/player/malte/MalteAI.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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; }