Class ParallelEvaluatorAI

All Implemented Interfaces:
AI

public class ParallelEvaluatorAI extends ExperimentalAI
DON'T USE THAT ONE YET. This one implements a parallel findBestLegionMove. Unfortunately, SimpleAI implementation of evaluateLegionBattleMove is anything but thread-safe, and it goes very deep: Evaluations functions mostly fall-back to asking the Client object property of the current situation. So they have first to move all BattleCritter (which are only a view of full BattleUnit) to the evaluated position, then evaluate. This version only tests the parallelism, so evaluateLegionBattleMove is random. We would need to (1) implements Strike as BattleClientSide, a proper, per-battle extension of Battle (the way it is done on with BattleServerSide) (2) make sure all evaluate functions only use property of BattleClientSide, even if that means changing the state of BattleClientSide. (3) have a proper deep copy constructor in BattleClientSide, so we can work on several variant at once.
Author:
Romain Dolbeau