public PriorityQueue<Patch> OptimizeCutsScenario3()
    {
        HashMap<Integer, Patch> candidateIDMap = new HashMap<>();
        StringBuilder modelContent = new StringBuilder();
        SolutionParser parser;
        org.neos.gams.Set patchSet = new org.neos.gams.Set("M", "patches");
        org.neos.gams.Set dimSet = new org.neos.gams.Set("N", "dimensions");

        Parameter subsidy = new Parameter("subsidy(M)", "subsidy cost");
        Parameter coord = new Parameter("coord(M,N)", "coordinates");

        dimSet.addValue("0");
        dimSet.addValue("1");

        for (Patch p : habitatCandidates) {
            String pID = String.valueOf(p.patchID);
            patchSet.addValue(pID);
            int subsidyCost = 50 - p.age;
            if (subsidyCost < 0) {
                subsidyCost = 0;
            }
            subsidy.add(pID, String.valueOf(subsidyCost));
            candidateIDMap.put(p.patchID, p);
            coord.add(pID + ".0", String.valueOf(p.x));
            coord.add(pID + ".1", String.valueOf(p.y));
        }
        Scalar minVal =
                new Scalar(
                "minVal",
                "Minimally acceptable value",
                String.valueOf(LumberCompany.MIN_VALUE));
        Scalar required =
                new Scalar(
                "requiredPatches",
                "Required number of patches to cut",
                String.valueOf(requiredHabitats - alreadySuitable));


        modelContent.append("$offdigit").append("\n");
        modelContent.append(patchSet.toString()).append("\n");
        modelContent.append(dimSet.toString()).append("\n");
        modelContent.append(subsidy.toString()).append("\n");
        modelContent.append(coord.toString()).append("\n");
        //modelContent.append(isCandidate.toString()).append("\n");
        modelContent.append(minVal.toString()).append("\n");
        modelContent.append(required.toString()).append("\n");
        modelContent.append(modelTemplateS1);
        
        NeosJobXml jobXml = new NeosJobXml("milp", "gurobi", "GAMS");
        jobXml.addParam("model", modelContent.toString());
        parser = NeosSubmit(jobXml);
        
        cutCandidates.clear();
        SolutionData bCut = parser.getSymbol("selected", SolutionData.VAR, 1);

        int cumulativeAge = 0;
        for (SolutionRow sRow : bCut.getRows()) {
            int level = sRow.getLevel().intValue();
            if (level == 1) {
                int pID = Integer.valueOf(sRow.getIndex(0));
                Patch cutPatch = candidateIDMap.get(pID);
                cumulativeAge += cutPatch.age;
                if (cutPatch != null) {
                    cutCandidates.add(cutPatch);
                }
            }
        }

        double shortAge = parser.getObjective();

        System.out.println("Total subsidy cost: " + shortAge);
        System.out.println("Cumulative age: " + cumulativeAge);

        if (cutCandidates.size() < requiredHabitats) {
            System.err.println("Bugged optimization.");
            try (FileWriter modelFile = new FileWriter(Calculation.outputModelPath)) {
                modelFile.write(modelContent.toString());
            } catch (IOException ioe) {
            }

            System.exit(-1);
        }
        
        return cutCandidates;
    }