Ejemplo n.º 1
0
 public void clearNearestBlockade() throws SOSActionException {
   log.info("clearing NearestBlockade");
   PriorityQueue<Blockade> blockadesInRange =
       model().getBlockadesInRange(agent.me().getX(), agent.me().getY(), agent.clearDistance);
   log.debug("Blockades in Range=" + blockadesInRange);
   Blockade selectedBlock = null;
   if (!blockadesInRange.isEmpty()) selectedBlock = blockadesInRange.remove();
   log.debug("best blockade:" + selectedBlock);
   if (selectedBlock != null) clear(selectedBlock);
 }
Ejemplo n.º 2
0
  private int computeBlockadeValue(Blockade blockade) {
    return (int)
        (1000000 / Math.max(agent.me().getPositionPoint().distance(blockade.getCenteroid()), 1));
    // return 100000 / blockade.getRepairCost();
    // TODO
    // moteallegh be kodam sakhteman hastand.(CV)

  }