Package net.sf.colossus.ai
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 net.sf.colossus.ai.SimpleAI
SimpleAI.PowerSkill, SimpleAI.TriggerTimeIsUp
Nested classes/interfaces inherited from class net.sf.colossus.ai.AbstractAI
AbstractAI.AbstractAIOracle, AbstractAI.CreatureValueConstants, AbstractAI.MoveInfo
-
Field Summary
FieldsFields inherited from class net.sf.colossus.ai.SimpleAI
MIN_ITERATIONS, timeIsUp, timeLimit
Fields inherited from class net.sf.colossus.ai.AbstractAI
bec, client, cvc, hintSectionUsed, random, variant
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
protected LegionMove
findBestLegionMove
(Collection<LegionMove> legionMoves) Evaluate all legion moves in the list, and return the best one.Methods inherited from class net.sf.colossus.ai.ExperimentalAI
battleMove, cleanupBattle, evaluateCritterMove_Defender, evaluateCritterMove_Rangestrike, evaluateCritterMove_Strike, evaluateCritterMove_Titan, evaluateLegionBattleMoveAsAWhole, findLegionMoves, initBattle
Methods inherited from class net.sf.colossus.ai.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, summonAngel
Methods inherited from class net.sf.colossus.ai.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:
evaluateLegionBattleMove
in classSimpleAI
-
findBestLegionMove
Description copied from class:SimpleAI
Evaluate all legion moves in the list, and return the best one. Break out early if the time limit is exceeded.- Overrides:
findBestLegionMove
in classSimpleAI
-