@@ -0,0 +1,1837 @@
+/*%0A *%0A *  * Project to resolve 2D cutting stock problem for Discreet Optimizations course at Polytech Lyon%0A *  * Copyright (C) 2015.  CARON Antoine and CHAUSSENDE Adrien%0A *  *%0A *  * This program is free software: you can redistribute it and/or modify%0A *  * it under the terms of the GNU Affero General Public License as%0A *  * published by the Free Software Foundation, either version 3 of the%0A *  * License, or (at your option) any later version.%0A *  *%0A *  * This program is distributed in the hope that it will be useful,%0A *  * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A *  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A *  * GNU Affero General Public License for more details.%0A *  *%0A *  * You should have received a copy of the GNU Affero General Public License%0A *  * along with this program.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A *%0A */%0A%0Apackage com.polytech4A.cuttingstock.core.solver.neighbour;%0A%0Aimport com.polytech4A.cuttingstock.core.model.Solution;%0A%0Aimport java.util.Random;%0A%0A/**%0A * Created by Antoine CARON on 16/04/2015.%0A *%0A * @author Antoine CARON%0A * @version 1.0%0A *          %3Cp%3E%0A *          Neighbour generated from a solution by removing a random pattern from the solution.%0A */%0Apublic class RemovePatternNeighbour implements INeighbourUtils %7B%0A    /**%0A     * Get neighbours for this solution.%0A     *%0A     * @param s current solution.%0A     * @return Generated neighbour for this solution.%0A     */%0A    @Override%0A    public Solution getRandomNeighbour(Solution s) %7B%0A        if (s.getPatterns().size() %3E 0) %7B%0A            Solution clSolution = s.clone();%0A            Random random = new Random(System.currentTimeMillis());%0A            clSolution.getPatterns().remove(random.nextInt(clSolution.getPatterns().size()));%0A            return clSolution;%0A        %7D%0A        return s;%0A    %7D%0A%7D%0A

Add RemovePatternNeighbour