public double getSuperRegionScore(Region region, BotState state) { return region.getSuperRegion().getArmiesReward() / region.getSuperRegion().getSubRegions().size(); // return (region.getSuperRegion().getSubRegions().size() - // region.getSuperRegion().getArmiesReward()); // return region.getSuperRegion().getArmiesReward(); }
public double getRegionNeighbourAllegianceScore(Region region, BotState state) { double total = 0.0; for (Region neighbour : region.getNeighbors()) { if (neighbour.ownedByPlayer(state.getMyPlayerName())) total -= 1; else if (neighbour.ownedByPlayer(state.getOpponentPlayerName())) total += 1; } return total / region.getNeighbors().size(); }
public double getSuperRegionAllegianceScore(Region region, BotState state) { double total = 0.0; for (Region subRegion : region.getSuperRegion().getSubRegions()) { if (subRegion.ownedByPlayer(state.getMyPlayerName())) total -= 1; else if (subRegion.ownedByPlayer(state.getOpponentPlayerName())) total += 1; } return total / region.getSuperRegion().getSubRegions().size(); }
public double getAvgNeighbourScore(Region region, BotState state) { LinkedList<Region> neighbours = region.getNeighbors(); double sum = 0; for (Region neighbour : neighbours) { if (neighbour.ownedByPlayer(state.getMyPlayerName())) sum += 0.5; else if (neighbour.ownedByPlayer(state.getOpponentPlayerName())) sum += 1; else sum += 0.1; } return sum / neighbours.size(); }
public double getNumSoldiers(Region region, BotState state) { return region.getArmies(); }
public double getAllegiance(Region region, BotState state) { if (region.ownedByPlayer(state.getMyPlayerName())) return 1; else if (region.ownedByPlayer(state.getOpponentPlayerName())) return -1; else return 0; }