Package solver.constraints.nary.automata.FA.utils

Examples of solver.constraints.nary.automata.FA.utils.ICounter


        this.counters.add(counter);
    }


    public double getCost(int layer, int value) {
        ICounter zero = counters.get(0);
        return zero.cost(layer, value);
    }
View Full Code Here


        ICounter zero = counters.get(0);
        return zero.cost(layer, value);
    }

    public double getCostByState(int layer, int value, int state) {
        ICounter zero = counters.get(0);
        return zero.cost(layer, value, state);
    }
View Full Code Here

        ICounter zero = counters.get(0);
        return zero.cost(layer, value, state);
    }

    public double getCostByResource(int layer, int value, int counter) {
        ICounter aCounter = counters.get(counter);
        return aCounter.cost(layer, value);
    }
View Full Code Here

    public int getNbResources() {
        return counters.size();
    }

    public double getCostByResourceAndState(int layer, int value, int counter, int state) {
        ICounter aCounter = counters.get(counter);
        return aCounter.cost(layer, value, state);
    }
View Full Code Here

    public List<ICounter> getCounters() {
        return counters;
    }

    public static ICostAutomaton makeSingleResource(IAutomaton pi, int[][][] costs, int inf, int sup) {
        ICounter c = new CounterState(costs, inf, sup);
        ArrayList<ICounter> tmp = new ArrayList<ICounter>();
        tmp.add(c);
        return (pi == null) ? null :
                new CostAutomaton(pi, tmp);
    }
View Full Code Here

        return (pi == null) ? null :
                new CostAutomaton(pi, tmp);
    }

    public static ICostAutomaton makeSingleResource(IAutomaton pi, int[][] costs, int inf, int sup) {
        ICounter c = new Counter(costs, inf, sup);
        ArrayList<ICounter> tmp = new ArrayList<ICounter>();
        tmp.add(c);
        return (pi == null) ? null :
                new CostAutomaton(pi, tmp);
    }
View Full Code Here

        for (int i = 0; i < costs.length; i++) {
            costs[i][0][1] = 1;
            costs[i][1][1] = 1;
        }

        ICounter c = new CounterState(costs, 3, 4);

        auto.addCounter(c);

        solver.post(IntConstraintFactory.cost_regular(vars, cost, auto));
        solver.set(IntStrategyFactory.lexico_LB(vars));
View Full Code Here

        for (int i = 1; i < costs.length; i += 2) {
            costs[i][0] = 1;
            costs[i][1] = 1;
        }

        ICounter c = new Counter(costs, 0, 4);
        CostAutomaton cauto = new CostAutomaton(auto, c);

        solver.post(IntConstraintFactory.cost_regular(vars, cost, cauto));
        solver.set(IntStrategyFactory.lexico_LB(vars));
View Full Code Here

TOP

Related Classes of solver.constraints.nary.automata.FA.utils.ICounter

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.