Class ParallelEvaluatorAI
java.lang.Object
net.sf.colossus.ai.AbstractAI
net.sf.colossus.ai.SimpleAI
net.sf.colossus.ai.ExperimentalAI
net.sf.colossus.ai.ParallelEvaluatorAI
- All Implemented Interfaces:
AI
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
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class SimpleAI
SimpleAI.PowerSkill, SimpleAI.TriggerTimeIsUpNested classes/interfaces inherited from class AbstractAI
AbstractAI.AbstractAIOracle, AbstractAI.CreatureValueConstants, AbstractAI.MoveInfo -
Field Summary
FieldsFields inherited from class SimpleAI
MIN_ITERATIONS, timeIsUp, timeLimitFields inherited from class AbstractAI
bec, client, cvc, hintSectionUsed, random, variant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intprotected LegionMovefindBestLegionMove(Collection<LegionMove> legionMoves) Evaluate all legion moves in the list, and return the best one.Methods inherited from class ExperimentalAI
battleMove, cleanupBattle, evaluateCritterMove_Defender, evaluateCritterMove_Rangestrike, evaluateCritterMove_Strike, evaluateCritterMove_Titan, evaluateLegionBattleMoveAsAWhole, findLegionMoves, initBattleMethods inherited from class SimpleAI
acquireAngel, chooseRecruit, concede, doInitialGameSplit, findWeakestTwoCritters, flee, getCreatureMoveLimit, getNativeValue, handleCarries, handleMulligans, masterMove, muster, pickColor, pickEngagement, pickEntrySide, pickMarker, pickStrikePenalty, RATIO_DRAW, RATIO_LOSE_HEAVY_LOSS, RATIO_WIN_HEAVY_LOSS, RATIO_WIN_MINIMAL_LOSS, reinforce, retryFailedBattleMoves, setupTimer, split, splitCallback, strike, summonAngelMethods inherited from class AbstractAI
buildEnemyAttackMap, couldRecruitUp, countCreatureAccrossAllLegionFromPlayer, findStrikeMap, generateDamageMap, generateLegionMoves, getAcqStepValue, getBattleStrike, getBattleUnit, getCaretaker, getHintedRecruitmentValue, getHintedRecruitmentValueNonTitan, getHintedRecruitmentValueNonTitan, getInitialSplitHint, getKillValue, getKillValue, getNumberOfWaysToTerrain, getVariantRecruitHint, hasOpponentNativeCreature, isHumanLegion, makeLegionMove, rangeToClosestOpponent, setVariant
-
Field Details
-
LOGGER
-
NTHREADS
private static final int NTHREADS- See Also:
-
-
Constructor Details
-
ParallelEvaluatorAI
-
-
Method Details
-
evaluateLegionBattleMove
- Overrides:
evaluateLegionBattleMovein classSimpleAI
-
findBestLegionMove
Description copied from class:SimpleAIEvaluate all legion moves in the list, and return the best one. Break out early if the time limit is exceeded.- Overrides:
findBestLegionMovein classSimpleAI
-