// Path: src/main/java/org/chocosolver/graphsolver/variables/GraphEventType.java
// public enum GraphEventType implements IEventType {
// 
// 	VOID(0),
// 	REMOVE_NODE(1),
// 	ADD_NODE(2),
// 	REMOVE_ARC(4),
// 	ADD_ARC(8);
// 
// 	//***********************************************************************************
// 	// VARIABLES
// 	//***********************************************************************************
// 
// 	private final int mask;
// 
// 	//***********************************************************************************
// 	// CONSTRUCTORS
// 	//***********************************************************************************
// 
// 	GraphEventType(int mask) {
// 		this.mask = mask;
// 	}
// 
// 	//***********************************************************************************
// 	// METHODS
// 	//***********************************************************************************
// 
// 	public int getMask() {
// 		return mask;
// 	}
// 
// 	public int getStrengthenedMask() {
// 		return getMask();
// 	}
// 
// 	//******************************************************************************************************************
// 	//******************************************************************************************************************
// 
// 	public static boolean isAddNode(int mask) {
// 		return (mask & ADD_NODE.mask) != 0;
// 	}
// 
// 	public static boolean isAddArc(int mask) {
// 		return (mask & ADD_ARC.mask) != 0;
// 	}
// 
// 	public static boolean isRemNode(int mask) {
// 		return (mask & REMOVE_NODE.mask) != 0;
// 	}
// 
// 	public static boolean isRemArc(int mask) {
// 		return (mask & REMOVE_ARC.mask) != 0;
// 	}
// }


import org.chocosolver.solver.variables.delta.IDeltaMonitor;
import org.chocosolver.util.procedure.IntProcedure;
import org.chocosolver.util.procedure.PairProcedure;
import org.chocosolver.graphsolver.variables.GraphEventType;
import org.chocosolver.solver.ICause;
import org.chocosolver.solver.exception.ContradictionException;
import org.chocosolver.solver.search.loop.TimeStampedObject;
		if (needReset()) {
			for (int i = 0; i < 4; i++) {
				first[i] = 0;
			}
			resetStamp();
		}
		for (int i = 0; i < 3; i++) {
			frozenFirst[i] = first[i]; // freeze indices
			first[i] = frozenLast[i] = delta.getSize(i);
		}
		frozenFirst[3] = first[3]; // freeze indices
		first[3] = frozenLast[3] = delta.getSize(GraphDelta.AE_TAIL);
	}

	@Override
	public void unfreeze() {
		delta.lazyClear();    // fix 27/07/12
		resetStamp();
		for (int i = 0; i < 3; i++) {
			first[i] = delta.getSize(i);
		}
		first[3] = delta.getSize(GraphDelta.AE_TAIL);
	}

	/**
	 * Applies proc to every vertex which has just been removed or enforced, depending on evt.
	 * @param proc    an incremental procedure over vertices
	 * @param evt    either ENFORCENODE or REMOVENODE
	 * @throws ContradictionException if a failure occurs
	 */
// Path: src/main/java/org/chocosolver/graphsolver/variables/GraphEventType.java
// public enum GraphEventType implements IEventType {
// 
// 	VOID(0),
// 	REMOVE_NODE(1),
// 	ADD_NODE(2),
// 	REMOVE_ARC(4),
// 	ADD_ARC(8);
// 
// 	//***********************************************************************************
// 	// VARIABLES
// 	//***********************************************************************************
// 
// 	private final int mask;
// 
// 	//***********************************************************************************
// 	// CONSTRUCTORS
// 	//***********************************************************************************
// 
// 	GraphEventType(int mask) {
// 		this.mask = mask;
// 	}
// 
// 	//***********************************************************************************
// 	// METHODS
// 	//***********************************************************************************
// 
// 	public int getMask() {
// 		return mask;
// 	}
// 
// 	public int getStrengthenedMask() {
// 		return getMask();
// 	}
// 
// 	//******************************************************************************************************************
// 	//******************************************************************************************************************
// 
// 	public static boolean isAddNode(int mask) {
// 		return (mask & ADD_NODE.mask) != 0;
// 	}
// 
// 	public static boolean isAddArc(int mask) {
// 		return (mask & ADD_ARC.mask) != 0;
// 	}
// 
// 	public static boolean isRemNode(int mask) {
// 		return (mask & REMOVE_NODE.mask) != 0;
// 	}
// 
// 	public static boolean isRemArc(int mask) {
// 		return (mask & REMOVE_ARC.mask) != 0;
// 	}
// }


// Path: src/main/java/org/chocosolver/graphsolver/variables/delta/GraphDeltaMonitor.java
import org.chocosolver.solver.variables.delta.IDeltaMonitor;
import org.chocosolver.util.procedure.IntProcedure;
import org.chocosolver.util.procedure.PairProcedure;
import org.chocosolver.graphsolver.variables.GraphEventType;
import org.chocosolver.solver.ICause;
import org.chocosolver.solver.exception.ContradictionException;
import org.chocosolver.solver.search.loop.TimeStampedObject;

		if (needReset()) {
			for (int i = 0; i < 4; i++) {
				first[i] = 0;
			}
			resetStamp();
		}
		for (int i = 0; i < 3; i++) {
			frozenFirst[i] = first[i]; // freeze indices
			first[i] = frozenLast[i] = delta.getSize(i);
		}
		frozenFirst[3] = first[3]; // freeze indices
		first[3] = frozenLast[3] = delta.getSize(GraphDelta.AE_TAIL);
	}

	@Override
	public void unfreeze() {
		delta.lazyClear();    // fix 27/07/12
		resetStamp();
		for (int i = 0; i < 3; i++) {
			first[i] = delta.getSize(i);
		}
		first[3] = delta.getSize(GraphDelta.AE_TAIL);
	}

	/**
	 * Applies proc to every vertex which has just been removed or enforced, depending on evt.
	 * @param proc    an incremental procedure over vertices
	 * @param evt    either ENFORCENODE or REMOVENODE
	 * @throws ContradictionException if a failure occurs
	 */
	public void forEachNode(IntProcedure proc, GraphEventType evt) throws ContradictionException {