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:
jakub.salavec
2025-03-10 09:14:45 +01:00
parent a749c8144d
commit 0ae8c15573
3 changed files with 12 additions and 1 deletions

View File

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

View File

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

View File

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