@Override
    public Integer heuristicValue(State goal) {
        Integer toReturn = 0;

        //The peasant is carrying something
        if (state.getUnitBy(unitID).getPayloadSize() > 0) {
            for (Unit townhall : state.getAllOf(Unit.TOWN_HALL)) {
                if (destination.isAdjacent(townhall.getLocation())) {
                    toReturn += BIG_VALUE;
                    toReturn -= state.getUnitBy(unitID).getLocation().distanceTo(destination);
                }
            }
        } else { //The peasant is empty-handed
            if (goal.WOOD_AMOUNT > state.WOOD_AMOUNT) { //If we need more wood
                for (Unit forest : state.getAllOf(Unit.FOREST)) {
                    if (forest.getLocation().isAdjacent(destination)) {
                        toReturn += SMALL_VALUE;
//                        toReturn += 50 - state.getUnitBy(unitID).getLocation().distanceTo(destination);
                    }
                }
            }

            if (goal.GOLD_AMOUNT > state.GOLD_AMOUNT) { //If we need more gold
                for (Unit mine : state.getAllOf(Unit.GOLD_MINE)) {
                    if (mine.getLocation().isAdjacent(destination)) {
                        toReturn += SMALL_VALUE;
//                        toReturn += 40 -  state.getUnitBy(unitID).getLocation().distanceTo(destination);
                    }
                }
            }
        }

        return toReturn;
    }