コード例 #1
0
 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();
 }
コード例 #2
0
 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();
 }
コード例 #3
0
 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();
 }
コード例 #4
0
 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();
 }
コード例 #5
0
 public double getNumSoldiers(Region region, BotState state) {
   return region.getArmies();
 }
コード例 #6
0
 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;
 }