public PriorityQueue<Patch> bOptimizeCutsScenario4()
    {
        String results;
        StringBuilder modelContent = new StringBuilder();
        HashMap<Integer, Patch> candidateIDMap = new HashMap<>();
        org.neos.gams.Set patchSet = new org.neos.gams.Set("M", "patches");
        
        Parameter subsidy = new Parameter("subsidy(M)", "subsidy cost");
        
        Scalar requiredPatchScalar = new Scalar("requiredPatches", "required number of patces", String.valueOf(requiredHabitats - alreadySuitable));
        
        for(Patch p : habitatCandidates)
        {
            String pID = String.valueOf(p.patchID);
            patchSet.addValue(pID);
            double subsidyCost = 250 - p.lumberProfit;
            if(subsidyCost < 0) subsidyCost = 0;
            subsidy.add(pID, String.valueOf(subsidyCost));
            candidateIDMap.put(p.patchID, p);
        }
        
        modelContent.append("$offdigit\n");
        modelContent.append(patchSet.toString()).append("\n");
        modelContent.append(requiredPatchScalar.toString());
        modelContent.append(subsidy.toString()).append("\n");
        modelContent.append(modelTemplateS4);
        
        try (FileWriter modelFile = new FileWriter(Calculation.outputModelPathS4)) {
            modelFile.write(modelContent.toString());
            modelFile.close();
        }
        catch(IOException ioe)
        {
            
        }
        
        NeosClient neosClient = new NeosClient(Calculation.NEOS_HOST, Calculation.NEOS_PORT);
        NeosJobXml jobXml = new NeosJobXml("milp", "gurobi", "GAMS");
        jobXml.addParam("model", modelContent.toString());
        jobXml.addParam("email", "ziliang@cs.wisc.edu");
        NeosJob neosJob;
        while ((neosJob = neosClient.submitJob(jobXml.toXMLString())) == null) {
            System.err.println("Error: failed to submit job to NEOS.");
        }
        
        System.out.println("Job ID: " + neosJob.getJobNo());
        System.out.println("Job password: " + neosJob.getJobPass());
        results = neosJob.getResult();
        
        SolutionParser parser = new SolutionParser(results);
        if (parser.getModelStatusCode() != 8 && parser.getModelStatusCode() != 1) {
            return null;
        }

        cutCandidates.clear();
        SolutionData bCut = parser.getSymbol("selected", SolutionData.VAR, 1);
        
        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);
                if (cutPatch != null) {
                    cutCandidates.add(cutPatch);
                }
            }
        }
        
        return cutCandidates;
    }