Playing with the weights
This commit is contained in:
parent
5016d07571
commit
8cab8c8deb
|
@ -147,16 +147,16 @@ public class MalteAI implements Player{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Maybe we get lucky TODO: Expand this.
|
// Maybe we get lucky TODO: Expand this.
|
||||||
int nrOfMyIDAround = 0;
|
double extraWeight = 0.0;
|
||||||
int nrOfEnemyIDAround = 0;
|
|
||||||
for (int i = 0; i < ids.length; i++) {
|
for (int i = 0; i < ids.length; i++) {
|
||||||
if (ids[i] == this.id) {
|
if (ids[i] == this.id) {
|
||||||
nrOfMyIDAround++;
|
extraWeight += Math.pow(nrs[i], 2) * 2;
|
||||||
} else if (ids[i] == this.enemyID) {
|
} 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;
|
return weight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue