add stub MovesBlackList and integrate it with MMAB

master
melvinzhang 2015-11-12 18:02:43 +08:00
parent db3004bd56
commit 96fddc9483
2 changed files with 12 additions and 2 deletions

View File

@ -46,7 +46,6 @@ public class MMAB implements MagicAI {
final MagicEvent event = choiceGame.getNextEvent();
final List<Object[]> choices = event.getArtificialChoiceResults(choiceGame);
final int size = choices.size();
choiceGame = null;
assert size != 0 : "ERROR: no choices available for MMAB";
@ -109,7 +108,8 @@ public class MMAB implements MagicAI {
ArtificialScore bestScore = ArtificialScore.INVALID_SCORE;
ArtificialChoiceResults bestAchoice = achoices.get(0);
for (final ArtificialChoiceResults achoice : achoices) {
if (bestScore.isBetter(achoice.aiScore,true)) {
if (bestScore.isBetter(achoice.aiScore, true) &&
MovesBlackList.isBlackListed(choiceGame, event, achoice.choiceResults) == false) {
bestScore = achoice.aiScore;
bestAchoice = achoice;
}

View File

@ -0,0 +1,10 @@
package magic.ai;
import magic.model.MagicGame;
import magic.model.event.MagicEvent;
public class MovesBlackList {
public static boolean isBlackListed(final MagicGame game, final MagicEvent event, final Object[] move) {
return false;
}
}