public class RationalAI extends SimpleAI
Modifier and Type | Class and Description |
---|---|
(package private) static class |
RationalAI.BattleResults |
class |
RationalAI.CompCreaturesByValueName |
private class |
RationalAI.LegionBoardMove |
private class |
RationalAI.MoveFinder |
(package private) class |
RationalAI.MusteredCreatures |
SimpleAI.PowerSkill, SimpleAI.TriggerTimeIsUp
AbstractAI.AbstractAIOracle, AbstractAI.CreatureValueConstants, AbstractAI.MoveInfo
Modifier and Type | Field and Description |
---|---|
private java.util.List<RationalAI.LegionBoardMove> |
bestMoveList |
private java.util.Iterator<RationalAI.LegionBoardMove> |
bestMoveListIter |
private java.util.Map<MasterHex,java.util.List<Legion>>[] |
enemyAttackMap |
private java.util.Map<java.lang.String,java.lang.Integer> |
evaluateMoveMap |
(package private) boolean |
I_HATE_HUMANS |
(package private) double |
KILLPOINTS |
private java.util.List<Legion> |
legionsToSplit |
private static java.util.logging.Logger |
logger |
(package private) static int |
RECRUIT_AT_7 |
(package private) static int |
RECRUIT_FALSE |
(package private) static int |
RECRUIT_TRUE |
(package private) int |
TITAN_SURVIVAL |
MIN_ITERATIONS, timeIsUp, timeLimit
bec, client, cvc, hintSectionUsed, random, variant
Constructor and Description |
---|
RationalAI(Client client) |
Modifier and Type | Method and Description |
---|---|
(package private) RationalAI.MusteredCreatures |
chooseCreaturesToSplitOut(Legion legion,
boolean at_risk)
Decide how to split this legion, and return a list of
Creatures to remove + status flag indicating if these
creatures have mustered or not
|
boolean |
concede(Legion legion,
Legion enemy)
choose whether legion should concede to enemy
|
(package private) RationalAI.BattleResults |
estimateBattleResults(Legion attacker,
Legion defender,
MasterHex hex) |
private RationalAI.BattleResults |
estimateBattleResults(Legion attacker,
Legion defender,
MasterHex hex,
CreatureType callable) |
private int |
evaluateCombat(Legion attacker,
Legion defender,
MasterHex hex) |
private int |
evaluateHexAttack(Legion attacker,
MasterHex hex,
int canRecruitHere) |
private int |
evaluateMove(Legion legion,
MasterHex hex,
int canRecruitHere,
int depth,
boolean addHexRisk)
Memoizing wrapper for evaluateMoveInner
|
private int |
evaluateMoveInner(Legion legion,
MasterHex hex,
int canRecruitHere,
int depth,
boolean normalHexRisk) |
private double |
expectedValueSplitLegion(LegionClientSide legion,
LegionClientSide child_legion) |
private boolean |
findMoveList(java.util.List<? extends Legion> legions,
java.util.List<java.util.List<RationalAI.LegionBoardMove>> all_legionMoves,
MultiSet<MasterHex> occupiedHexes,
boolean teleportsOnly) |
private boolean |
fireSplits()
Return true if done with all splits and callbacks
|
boolean |
flee(Legion legion,
Legion enemy)
choose whether legion should flee from enemy
|
java.util.List<SimpleAI.PowerSkill> |
getCombatList(Legion legion,
MasterBoardTerrain terrain,
boolean defender) |
private boolean |
handleForcedSingleMove(Player player) |
private boolean |
handleForcedSplitMoves(Player player) |
private boolean |
handleVoluntaryMoves(Player player)
Return true if we moved something and need to be called again.
|
private double |
hexRisk(Legion legion,
MasterHex hex,
boolean invert) |
boolean |
masterMove()
Return true if we need to run this method again after the server
updates the client with the results of a move or mulligan.
|
private static double |
r3(double value) |
private double |
recruitValue(Legion legion,
MasterHex hex,
Legion enemy,
MasterBoardTerrain terrain)
Find value of recruiting, including possibly attacking an enemy
set enemy = null to indicate no enemy
|
private java.util.List<CreatureType> |
removeMustered(java.util.List<CreatureType> sortedCreatures) |
private java.util.List<CreatureType> |
sortCreaturesByValueName(Legion legion) |
boolean |
split()
make splits for current player.
|
boolean |
splitCallback(Legion parent,
Legion child)
If parentId and childId are null, this is a callback to
an undo split
|
(package private) boolean |
splitOneLegion(Player player,
Legion legion)
Return true if done, false if waiting for callback.
|
private boolean |
splitOneLegionCallback(LegionClientSide parent,
LegionClientSide child)
Return true if done, false if waiting for undo split
|
acquireAngel, battleMove, chooseRecruit, doInitialGameSplit, evaluateCritterMove_Defender, evaluateCritterMove_Rangestrike, evaluateCritterMove_Strike, evaluateCritterMove_Titan, evaluateLegionBattleMove, evaluateLegionBattleMoveAsAWhole, findBestLegionMove, findLegionMoves, findWeakestTwoCritters, getCreatureMoveLimit, getNativeValue, handleCarries, handleMulligans, muster, pickColor, pickEngagement, pickEntrySide, pickMarker, pickStrikePenalty, RATIO_DRAW, RATIO_LOSE_HEAVY_LOSS, RATIO_WIN_HEAVY_LOSS, RATIO_WIN_MINIMAL_LOSS, reinforce, retryFailedBattleMoves, setupTimer, strike, summonAngel
buildEnemyAttackMap, cleanupBattle, couldRecruitUp, countCreatureAccrossAllLegionFromPlayer, findStrikeMap, generateDamageMap, generateLegionMoves, getAcqStepValue, getBattleStrike, getBattleUnit, getCaretaker, getHintedRecruitmentValue, getHintedRecruitmentValueNonTitan, getHintedRecruitmentValueNonTitan, getInitialSplitHint, getKillValue, getKillValue, getNumberOfWaysToTerrain, getVariantRecruitHint, hasOpponentNativeCreature, initBattle, isHumanLegion, makeLegionMove, rangeToClosestOpponent, setVariant
private static final java.util.logging.Logger logger
boolean I_HATE_HUMANS
private final java.util.List<Legion> legionsToSplit
private final java.util.Map<java.lang.String,java.lang.Integer> evaluateMoveMap
private java.util.List<RationalAI.LegionBoardMove> bestMoveList
private java.util.Iterator<RationalAI.LegionBoardMove> bestMoveListIter
final int TITAN_SURVIVAL
static final int RECRUIT_FALSE
static final int RECRUIT_TRUE
static final int RECRUIT_AT_7
final double KILLPOINTS
public RationalAI(Client client)
private static double r3(double value)
public boolean split()
AI
private boolean fireSplits()
public boolean splitCallback(Legion parent, Legion child)
splitCallback
in interface AI
splitCallback
in class SimpleAI
private double expectedValueSplitLegion(LegionClientSide legion, LegionClientSide child_legion)
boolean splitOneLegion(Player player, Legion legion)
private boolean splitOneLegionCallback(LegionClientSide parent, LegionClientSide child)
private double recruitValue(Legion legion, MasterHex hex, Legion enemy, MasterBoardTerrain terrain)
private java.util.List<CreatureType> removeMustered(java.util.List<CreatureType> sortedCreatures)
private java.util.List<CreatureType> sortCreaturesByValueName(Legion legion)
RationalAI.MusteredCreatures chooseCreaturesToSplitOut(Legion legion, boolean at_risk)
public boolean masterMove()
masterMove
in interface AI
masterMove
in class SimpleAI
private boolean findMoveList(java.util.List<? extends Legion> legions, java.util.List<java.util.List<RationalAI.LegionBoardMove>> all_legionMoves, MultiSet<MasterHex> occupiedHexes, boolean teleportsOnly)
private boolean handleVoluntaryMoves(Player player)
private boolean handleForcedSplitMoves(Player player)
private boolean handleForcedSingleMove(Player player)
private int evaluateMove(Legion legion, MasterHex hex, int canRecruitHere, int depth, boolean addHexRisk)
private int evaluateMoveInner(Legion legion, MasterHex hex, int canRecruitHere, int depth, boolean normalHexRisk)
RationalAI.BattleResults estimateBattleResults(Legion attacker, Legion defender, MasterHex hex)
private RationalAI.BattleResults estimateBattleResults(Legion attacker, Legion defender, MasterHex hex, CreatureType callable)
public boolean flee(Legion legion, Legion enemy)
AI
public boolean concede(Legion legion, Legion enemy)
AI
public java.util.List<SimpleAI.PowerSkill> getCombatList(Legion legion, MasterBoardTerrain terrain, boolean defender)