Package net.sf.cpsolver.ifs.model

Examples of net.sf.cpsolver.ifs.model.Neighbour


    }

    /** Neighbour selection  -- based on the phase, construction strategy is used first,
     * than it iterates between two or three given neighbour selections*/
    public Neighbour selectNeighbour(Solution solution) {
        Neighbour n = null;
        switch (iPhase) {
            case 0:
                n = iConstruct.selectNeighbour(solution);
                if (n != null)
                    return n;
View Full Code Here


                    ns = (NeighbourSelector)e.nextElement();
                    points -= (iUpdatePoints?ns.getPoints():ns.getBonus());
                    if (points<=0) break;
                }
            }
            Neighbour n = ns.selectNeighbour(solution);
            if (n!=null) {
                if (n instanceof ItcLazyNeighbour) {
                    ((ItcLazyNeighbour)n).setAcceptanceCriterion(this);
                    return n;
                } else if (n.value()<=0.0) return n;
            }
        }
        iIter = 0; iLastImprovingIter = 0; iT0 = -1;
        return null;
    }
View Full Code Here

         * update stats if desired.
         */
        public Neighbour selectNeighbour(Solution solution) {
            if (iUpdate) {
                long t0 = System.currentTimeMillis();
                Neighbour n = iSelection.selectNeighbour(solution);
                long t1 = System.currentTimeMillis();
                update(n, t1-t0);
                return n;
            } else
                return iSelection.selectNeighbour(solution);
View Full Code Here

                    points -= (iUpdatePoints ? ns.getPoints() : ns.getBonus());
                    if (points <= 0)
                        break;
                }
            }
            Neighbour n = ns.selectNeighbour(solution);
            if (n != null)
                return n;
        }
    }
View Full Code Here

        return false;
    }

    /** Neighbour selection */
    public Neighbour selectNeighbour(Solution solution) {
        Neighbour neighbour = null;
        while ((neighbour = genMove(solution)) != null) {
            iMoves++;
            if (accept(solution, neighbour)) {
                iAcceptedMoves++;
                break;
View Full Code Here

                    ns = (NeighbourSelector)e.nextElement();
                    points -= (iUpdatePoints?ns.getPoints():ns.getBonus());
                    if (points<=0) break;
                }
            }
            Neighbour n = ns.selectNeighbour(solution);
            if (n!=null) return n;
        }
    }
View Full Code Here

        return false;
    }
   
    /** Neighbour selection */
    public Neighbour selectNeighbour(Solution solution) {
        Neighbour neighbour = null;
        while ((neighbour=genMove(solution))!=null) {
            if (sInfo) {
                iMoves++; iAbsValue += neighbour.value() * neighbour.value();
            }
            if (accept(solution,neighbour)) break;
        }
        return (neighbour==null?null:neighbour);
    }
View Full Code Here

TOP

Related Classes of net.sf.cpsolver.ifs.model.Neighbour

Copyright © 2018 www.massapicom. 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.