| 1 | package com.takenoko.stats; | |
| 2 | ||
| 3 | import com.takenoko.bot.utils.GameProgress; | |
| 4 | import com.takenoko.engine.BotManager; | |
| 5 | import com.takenoko.engine.History; | |
| 6 | import java.util.HashMap; | |
| 7 | import java.util.List; | |
| 8 | ||
| 9 | public class HistoryStatistics extends HashMap<BotManager, HistoryStatisticsItem> { | |
| 10 | ||
| 11 | public HistoryStatistics() { | |
| 12 | super(); | |
| 13 | } | |
| 14 | ||
| 15 | public HistoryStatistics(List<BotManager> botManagers) { | |
| 16 | for (BotManager botManager : botManagers) { | |
| 17 | put(botManager, new HistoryStatisticsItem()); | |
| 18 | } | |
| 19 | } | |
| 20 | ||
| 21 | @Override | |
| 22 | public String toString() { | |
| 23 | StringBuilder historyStatistics = new StringBuilder(); | |
| 24 | for (Entry<BotManager, HistoryStatisticsItem> entry : entrySet()) { | |
| 25 | historyStatistics | |
| 26 | .append("======") | |
| 27 | .append(entry.getKey()) | |
| 28 | .append("======\n") | |
| 29 | .append(entry.getValue()) | |
| 30 | .append("\n"); | |
| 31 | } | |
| 32 |
1
1. toString : replaced return value with "" for com/takenoko/stats/HistoryStatistics::toString → TIMED_OUT |
return historyStatistics.toString(); |
| 33 | } | |
| 34 | ||
| 35 | public void updateEvolution(BotManager botManager, History history) { | |
| 36 |
1
1. updateEvolution : removed call to com/takenoko/stats/HistoryStatisticsItem::updateEvolution → TIMED_OUT |
get(botManager).updateEvolution(history, botManager.getUniqueID()); |
| 37 | } | |
| 38 | ||
| 39 | public void incrementNumberOfRounds(BotManager botManager, GameProgress gameProgress) { | |
| 40 |
1
1. incrementNumberOfRounds : removed call to com/takenoko/stats/GameProgressStatistics::incrementNbOfRounds → TIMED_OUT |
get(botManager).get(gameProgress).incrementNbOfRounds(); |
| 41 | } | |
| 42 | } | |
Mutations | ||
| 32 |
1.1 |
|
| 36 |
1.1 |
|
| 40 |
1.1 |