Package org.optaplanner.core.api.solver

Examples of org.optaplanner.core.api.solver.Solver.addEventListener()


    public void solve(final HttpSession session) {
        final Solver solver = (Solver) session.getAttribute(CloudBalancingSessionAttributeName.SOLVER);
        final CloudBalance unsolvedSolution = (CloudBalance) session.getAttribute(CloudBalancingSessionAttributeName.SHOWN_SOLUTION);

        solver.addEventListener(new SolverEventListener<CloudBalance>() {
            public void bestSolutionChanged(BestSolutionChangedEvent<CloudBalance> event) {
                CloudBalance bestSolution = event.getNewBestSolution();
                session.setAttribute(CloudBalancingSessionAttributeName.SHOWN_SOLUTION, bestSolution);
            }
        });
View Full Code Here


    public void solve(final HttpSession session) {
        final Solver solver = (Solver) session.getAttribute(VrpSessionAttributeName.SOLVER);
        final VehicleRoutingSolution unsolvedSolution = (VehicleRoutingSolution) session.getAttribute(VrpSessionAttributeName.SHOWN_SOLUTION);

        solver.addEventListener(new SolverEventListener<VehicleRoutingSolution>() {
            public void bestSolutionChanged(BestSolutionChangedEvent<VehicleRoutingSolution> event) {
                VehicleRoutingSolution bestSolution = event.getNewBestSolution();
                session.setAttribute(VrpSessionAttributeName.SHOWN_SOLUTION, bestSolution);
            }
        });
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.