|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.colossus.ai.AbstractAI
net.sf.colossus.ai.SimpleAI
net.sf.colossus.ai.RationalAI
public class RationalAI
Simple implementation of a Titan AI
Nested Class Summary | |
---|---|
(package private) static class |
RationalAI.BattleResults
|
class |
RationalAI.CompCreaturesByValueName
|
private class |
RationalAI.LegionBoardMove
|
private class |
RationalAI.MoveFinder
|
(package private) class |
RationalAI.MusteredCreatures
|
Nested 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 | |
---|---|
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
|
Fields 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 | |
---|---|
RationalAI(Client client)
|
Method Summary | |
---|---|
(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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.util.logging.Logger logger
boolean I_HATE_HUMANS
private final java.util.List<Legion> legionsToSplit
private java.util.Map<MasterHex,java.util.List<Legion>>[] enemyAttackMap
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
Constructor Detail |
---|
public RationalAI(Client client)
Method Detail |
---|
private static double r3(double value)
public boolean split()
AI
split
in interface AI
split
in class SimpleAI
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 double hexRisk(Legion legion, MasterHex hex, boolean invert)
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)
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
flee
in interface AI
flee
in class SimpleAI
public boolean concede(Legion legion, Legion enemy)
AI
concede
in interface AI
concede
in class SimpleAI
public java.util.List<SimpleAI.PowerSkill> getCombatList(Legion legion, MasterBoardTerrain terrain, boolean defender)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |