public double CheckDistances(PriorityQueue<Patch> cutTargets)
    {
        StringBuilder modelContent = new StringBuilder();
        org.neos.gams.Set patchSet = new org.neos.gams.Set("M", "patches");
        org.neos.gams.Set dimSet = new org.neos.gams.Set("N", "dimensions");
        
        dimSet.addValue("0");
        dimSet.addValue("1");

        Parameter coord = new Parameter("coord(M,N)", "coordinates");
        
        for (Patch p : cutTargets) {
            String pID = String.valueOf(p.patchID);
            patchSet.addValue(pID);
            double subsidyCost = 250 - p.lumberProfit;
            if (subsidyCost < 0) {
                subsidyCost = 0;
            }

            coord.add(pID + ".0", String.valueOf(p.x));
            coord.add(pID + ".1", String.valueOf(p.y));
        }
        
        modelContent.append("$offdigit").append("\n");
        modelContent.append(patchSet.toString()).append("\n");
        modelContent.append(dimSet.toString()).append("\n");
        modelContent.append(coord.toString()).append("\n");
        modelContent.append(distTemplate);
        
        NeosJobXml jobXml = new NeosJobXml("socp", "mosek", "GAMS");
        jobXml.addParam("model", modelContent.toString());
        
        SolutionParser parser = NeosSubmit(jobXml);
        if(parser == null)
            return 0;
        
        double solution = parser.getObjective();
        
        return solution;
    }