forked from External/mage
This reverts commit 82708e4273.
Some of these (AI related result in bloated memory usage, needs more investigation).
This commit is contained in:
parent
2f3831599d
commit
015cdf3136
79 changed files with 597 additions and 811 deletions
|
|
@ -31,13 +31,10 @@ public class ComputerPlayerMCTS extends ComputerPlayer implements Player {
|
|||
private static final int THINK_MAX_RATIO = 100;
|
||||
private static final double THINK_TIME_MULTIPLIER = 2.0;
|
||||
private static final boolean USE_MULTIPLE_THREADS = true;
|
||||
private static final Logger logger = Logger.getLogger(ComputerPlayerMCTS.class);
|
||||
|
||||
protected transient MCTSNode root;
|
||||
protected String lastPhase = "";
|
||||
protected long totalThinkTime;
|
||||
protected long totalSimulations;
|
||||
protected int maxThinkTime;
|
||||
private static final Logger logger = Logger.getLogger(ComputerPlayerMCTS.class);
|
||||
private int poolSize;
|
||||
|
||||
public ComputerPlayerMCTS(String name, RangeOfInfluence range, int skill) {
|
||||
|
|
@ -53,11 +50,6 @@ public class ComputerPlayerMCTS extends ComputerPlayer implements Player {
|
|||
|
||||
public ComputerPlayerMCTS(final ComputerPlayerMCTS player) {
|
||||
super(player);
|
||||
this.maxThinkTime = player.maxThinkTime;
|
||||
this.poolSize = player.poolSize;
|
||||
this.lastPhase = player.lastPhase;
|
||||
this.totalSimulations = player.totalSimulations;
|
||||
this.totalThinkTime = player.totalThinkTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -65,6 +57,8 @@ public class ComputerPlayerMCTS extends ComputerPlayer implements Player {
|
|||
return new ComputerPlayerMCTS(this);
|
||||
}
|
||||
|
||||
protected String lastPhase = "";
|
||||
|
||||
@Override
|
||||
public boolean priority(Game game) {
|
||||
if (game.getStep().getType() == PhaseStep.UPKEEP) {
|
||||
|
|
@ -158,6 +152,9 @@ public class ComputerPlayerMCTS extends ComputerPlayer implements Player {
|
|||
MCTSNode.logHitMiss();
|
||||
}
|
||||
|
||||
protected long totalThinkTime = 0;
|
||||
protected long totalSimulations = 0;
|
||||
|
||||
protected void applyMCTS(final Game game, final NextAction action) {
|
||||
|
||||
int thinkTime = calculateThinkTime(game, action);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue