Package solver.constraints.nary.count

Examples of solver.constraints.nary.count.PropCountVar


     */
    public static Constraint count(IntVar VALUE, IntVar[] VARS, IntVar LIMIT) {
        if (VALUE.isInstantiated()) {
            return count(VALUE.getValue(), VARS, LIMIT);
        } else if (VALUE.hasEnumeratedDomain()) {
            return new Constraint("Count", new PropCountVar(VARS, VALUE, LIMIT));
        } else {
            IntVar EVALUE = VF.enumerated(StringUtils.randomName(), VALUE.getLB(), VALUE.getUB(), VALUE.getSolver());
            return new Constraint("Count",
                    new PropEqualX_Y(EVALUE, VALUE),
                    new PropCountVar(VARS, EVALUE, LIMIT));
        }
    }
View Full Code Here

TOP

Related Classes of solver.constraints.nary.count.PropCountVar

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.