Package solver.variables.events

Examples of solver.variables.events.IntEventType


    }

    @Override
    public void transformEvent(IEventType evt, ICause cause) throws ContradictionException {
    RealEventType realevt;
    IntEventType intevt = (IntEventType) evt;
    switch (intevt){
      case INSTANTIATE:
      case BOUND:
        realevt = RealEventType.BOUND;break;
      case INCLOW:realevt = RealEventType.INCLOW;break;
View Full Code Here


    @Override
    public boolean removeValue(int value, ICause cause) throws ContradictionException {
        int inf = getLB();
        int sup = getUB();
        if (inf <= value && value <= sup) {
      IntEventType e = IntEventType.REMOVE;

            boolean done = var.removeValue(-value, this);

            if (value == inf) {
                e = IntEventType.INCLOW;
View Full Code Here

    @Override
    public boolean updateLowerBound(int value, ICause cause) throws ContradictionException {
        int old = this.getLB();
        if (old < value) {
      IntEventType e = IntEventType.INCLOW;
            boolean done = var.updateUpperBound(-value, this);
            if (isInstantiated()) {
                e = IntEventType.INSTANTIATE;
            }
            if (done) {
View Full Code Here

    @Override
    public boolean updateUpperBound(int value, ICause cause) throws ContradictionException {
        int old = this.getUB();
        if (old > value) {
      IntEventType e = IntEventType.DECUPP;
            boolean done = var.updateLowerBound(-value, this);
            if (isInstantiated()) {
                e = IntEventType.INSTANTIATE;
            }
            if (done) {
View Full Code Here

    public boolean removeValue(int value, ICause cause) throws ContradictionException {
        assert cause != null;
        int inf = getLB();
        int sup = getUB();
        if (inf <= value && value <= sup) {
      IntEventType e = IntEventType.REMOVE;

            boolean done = var.removeValue(value - cste, this);
            if (done) {
                if (value == inf) {
                    e = IntEventType.INCLOW;
View Full Code Here

    @Override
    public boolean updateLowerBound(int value, ICause cause) throws ContradictionException {
        assert cause != null;
        int old = this.getLB();
        if (old < value) {
      IntEventType e = IntEventType.INCLOW;
            boolean done = var.updateLowerBound(value - cste, this);
            if (isInstantiated()) {
                e = IntEventType.INSTANTIATE;
            }
            if (done) {
View Full Code Here

    @Override
    public boolean updateUpperBound(int value, ICause cause) throws ContradictionException {
        assert cause != null;
        int old = this.getUB();
        if (old > value) {
      IntEventType e = IntEventType.DECUPP;
            boolean done = var.updateUpperBound(value - cste, this);
            if (isInstantiated()) {
                e = IntEventType.INSTANTIATE;
            }
            if (done) {
View Full Code Here

                    solver.getExplainer().removeValue(this, value, cause);
                }
//            monitors.forEachRemVal(onContradiction.set(this, EventType.REMOVE, cause));
                this.contradiction(cause, IntEventType.REMOVE, MSG_REMOVE);
            }
      IntEventType e = IntEventType.REMOVE;
            this.VALUES.clear(aValue);
            this.SIZE.add(-1);
            if (reactOnRemoval) {
                delta.add(aValue + OFFSET, cause);
            }
View Full Code Here

                if (Configuration.PLUG_EXPLANATION) {
                    solver.getExplainer().updateLowerBound(this, old, oub + 1, cause);
                }
                this.contradiction(cause, IntEventType.INCLOW, MSG_LOW);
            } else {
        IntEventType e = IntEventType.INCLOW;

                int aValue = value - OFFSET;
                if (reactOnRemoval) {
                    //BEWARE: this loop significantly decreases performances
                    for (int i = old - OFFSET; i < aValue; i = VALUES.nextSetBit(i + 1)) {
View Full Code Here

                if (Configuration.PLUG_EXPLANATION) {
                    solver.getExplainer().updateUpperBound(this, old, olb - 1, cause);
                }
                this.contradiction(cause, IntEventType.DECUPP, MSG_UPP);
            } else {
        IntEventType e = IntEventType.DECUPP;
                int aValue = value - OFFSET;
                if (reactOnRemoval) {
                    //BEWARE: this loop significantly decreases performances
                    for (int i = old - OFFSET; i > aValue; i = VALUES.prevSetBit(i - 1)) {
                        delta.add(i + OFFSET, cause);
View Full Code Here

TOP

Related Classes of solver.variables.events.IntEventType

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.