Examples of inConflict()


Examples of net.sf.cpsolver.ifs.model.Model.inConflict()

                        Value conflict = (Value)i.next();
                        eval -= iValueWeight*conflict.toDouble();
                        eval += iConflictWeight * (1.0+(iStat==null?0.0:iStat.countRemovals(solution.getIteration(), conflict, value)));
                    }
                } else {
                    if (model.inConflict(value)) continue;
                }
                if (iTabu!=null && iTabu.contains(tabuElement(value))) {
                    int un = model.nrUnassignedVariables()-(assigned==null?0:1);
                    if (un>model.getBestUnassignedVariables()) continue;
                    if (un==model.getBestUnassignedVariables() && model.getTotalValue()+eval>=solution.getBestValue()) continue;
View Full Code Here

Examples of net.sf.cpsolver.ifs.model.Model.inConflict()

    public Neighbour selectNeighbour(Solution solution) {
        Model model = solution.getModel();
        Variable variable = (Variable)ToolBox.random(model.variables());
        Value value = (Value)ToolBox.random(variable.values());
        if (value.equals(variable.getAssignment())) return null;
        if (model.inConflict(value)) return null;
        return new ItcSimpleNeighbour(variable,value);
    }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.