WeightDraftBot now picks the best value card more consistently; Isildur's Bane is now part of FP packs of FotR draft
This commit is contained in:
@@ -32,10 +32,17 @@ public class WeightDraftBot extends DraftPlayer implements DraftBot {
|
||||
|
||||
private List<String> getTopCards(List<String> cardsToPickFrom) {
|
||||
// Sort the cards by value in descending order
|
||||
return cardsToPickFrom.stream()
|
||||
List<String> sortedCards = cardsToPickFrom.stream()
|
||||
.sorted((card1, card2) -> Double.compare(cardValues.getOrDefault(card2, 0.1), cardValues.getOrDefault(card1, 0.1)))
|
||||
.limit(2) // Choose from two highest ranked cards
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// If we have at least one card, duplicate the best one
|
||||
if (!sortedCards.isEmpty()) {
|
||||
sortedCards.add(0, sortedCards.get(0)); // Add the better card twice to ensure at least 66 % to pick it
|
||||
}
|
||||
|
||||
return sortedCards;
|
||||
}
|
||||
|
||||
private double getTotalValue(List<String> topCards) {
|
||||
|
||||
@@ -60,6 +60,7 @@ public class FotrDraftBotsInitializer {
|
||||
if (!READ_NEW_DATA) {
|
||||
return getCachedValuesMap();
|
||||
} else {
|
||||
// Data from solo drafts do not contain one ring cards, add some value manually after
|
||||
Path summaryDir = Paths.get(AppConfig.getProperty("application.root"), "replay", "summaries");
|
||||
|
||||
System.out.println("Game history reading started at " + new SimpleDateFormat("HH.mm.ss").format(new java.util.Date()));
|
||||
@@ -254,6 +255,7 @@ public class FotrDraftBotsInitializer {
|
||||
|
||||
private Map<String, Double> getCachedValuesMap(){
|
||||
Map<String, Double> tbr = new HashMap<>();
|
||||
tbr.put("1_1", 0.5); // Manually added Isildur's Bane which was not part of solo draft data
|
||||
tbr.put("1_50", 1.0);
|
||||
tbr.put("1_90", 0.9832224243314389);
|
||||
tbr.put("1_313", 0.932889697325756);
|
||||
|
||||
@@ -63,6 +63,8 @@ public class FotrTableDraftBoosterProducer implements BoosterProducer {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Add the rare ring to draft manually - it is neither fp nor shadow card
|
||||
cardPools.get("rare-fotr-fp").add("1_1");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user