Package net.sf.cpsolver.ifs.model

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


    /** Initialization */
    public void init(Solver solver) {}
    /** Neighbour selection */
    public Neighbour selectNeighbour(Solution solution) {
        Model model = solution.getModel();
        Variable variable = (Variable)ToolBox.random(model.variables());
        if (!(variable instanceof Swapable)) return null;
        Variable anotherVariable = (Variable)ToolBox.random(model.variables());
        if (variable.equals(anotherVariable)) return null;
        return ((Swapable)variable).findSwap(anotherVariable);
    }
View Full Code Here


    /** Neighbour selection */
    public Neighbour selectNeighbour(Solution solution) {
        Model model = solution.getModel();
        Variable variable = (Variable)ToolBox.random(model.variables());
        if (!(variable instanceof Swapable)) return null;
        Variable anotherVariable = (Variable)ToolBox.random(model.variables());
        if (variable.equals(anotherVariable)) return null;
        return ((Swapable)variable).findSwap(anotherVariable);
    }
}
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.