mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
fixed an issue with excessive mismatched merge states in MCTS AI
This commit is contained in:
parent
fcb9bc9351
commit
3231688855
1 changed files with 4 additions and 3 deletions
|
@ -29,15 +29,15 @@
|
||||||
package mage.cards;
|
package mage.cards;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.SortedSet;
|
|
||||||
import java.util.TreeSet;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
|
@ -214,11 +214,12 @@ public class CardsImpl extends LinkedHashSet<UUID> implements Cards, Serializabl
|
||||||
@Override
|
@Override
|
||||||
public String getValue(Game game) {
|
public String getValue(Game game) {
|
||||||
StringBuilder sb = threadLocalBuilder.get();
|
StringBuilder sb = threadLocalBuilder.get();
|
||||||
SortedSet<String> cards = new TreeSet<>();
|
List<String> cards = new ArrayList<>();
|
||||||
for (UUID cardId: this) {
|
for (UUID cardId: this) {
|
||||||
Card card = game.getCard(cardId);
|
Card card = game.getCard(cardId);
|
||||||
cards.add(card.getName());
|
cards.add(card.getName());
|
||||||
}
|
}
|
||||||
|
Collections.sort(cards);
|
||||||
for (String name: cards) {
|
for (String name: cards) {
|
||||||
sb.append(name).append(":");
|
sb.append(name).append(":");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue