Auto-starting a Table/Match

I'm having trouble getting the code to auto-start a Table and Match. The goal here is to start a match with computer AIs as soon as a match ends. This is for a genetic algorithm designed to modify decks to find decks that win most often. I already have it set up so that the the AIs use random decks (which will be changed to decks that win most often)
In the endGame code I have something like this - which isn't working for me;
In the endGame code I have something like this - which isn't working for me;
- Code: Select all
if (checkIfMatchEnds){
// create a new match
MatchOptions edt = this.getOptions();
try {
EvolvingDuelMatch m = new EvolvingDuelMatch(edt);
/*for (OmniDeck deck:setDecks.values()){
m.addPlayer(new MonteCarloPlayer2("comp", RangeOfInfluence.ALL, 10), deck);
}*/
List<String> playerTypes = new ArrayList<String>();
playerTypes.add("Computer - montecarlo");
playerTypes.add("Computer - montecarlo");
DeckValidator dv = DeckValidatorFactory.getInstance().createDeckValidator(this.getOptions().getGameType());
Table T = new Table(UUID.randomUUID(),this.getOptions().getGameType(),"Evolving Duel","",dv, playerTypes,
TableRecorderImpl.getInstance(), m);
T.initGame();
} catch (GameException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}