Revert "Added missing fields to many copy constructors. (#8957)" (#8999)

This reverts commit 82708e4273.

Some of these (AI related result in bloated memory usage, needs more investigation).
This commit is contained in:
Alex Vasile 2022-05-25 12:57:24 -06:00 committed by GitHub
parent 2f3831599d
commit 015cdf3136
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
79 changed files with 597 additions and 811 deletions

View file

@ -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);