@Test public static void testZone() { assertTrue(zone1.equals(zone2)); }
public Zone(int[] timers, int[][] matrix) { _hashCode = -1; _indexToTimer = Arrays.copyOf(timers, timers.length); Arrays.sort(_indexToTimer); if(_indexToTimer[0] != -1) { int[] newIndexToTimer = new int[_indexToTimer.length+1]; for(int i=0; i<_indexToTimer.length; i++) { newIndexToTimer[i+1] = _indexToTimer[i]; } _indexToTimer = newIndexToTimer; _indexToTimer[0] = -1; } HashMap<Integer, Integer> newIndex = new HashMap<Integer, Integer>(); for(int i=0; i<timers.length; i++) { newIndex.put(i+1, Arrays.binarySearch(_indexToTimer, timers[i])); } newIndex.put(0, 0); _matrix = new int[matrixSize()][matrixSize()]; for(int i=0; i<dbmSize(); i++) { for(int j=0; j<dbmSize(); j++) { setDbmEntry(newIndex.get(i), newIndex.get(j), matrix[dbmIndexToMatrixIndex(i)][dbmIndexToMatrixIndex(j)]); } } for(int i=1; i< dbmSize(); i++) { setUpperBoundbydbmIndex(newIndex.get(i), matrix[0][dbmIndexToMatrixIndex(i)]); setLowerBoundbydbmIndex(newIndex.get(i), -1*matrix[dbmIndexToMatrixIndex(i)][0]); } recononicalize(); }
Zone extends ZoneType { public Zone(int[] timers, int[][] matrix) { _hashCode = -1; _indexToTimer = Arrays.copyOf(timers, timers.length); Arrays.sort(_indexToTimer); if(_indexToTimer[0] != -1) { int[] newIndexToTimer = new int[_indexToTimer.length+1]; for(int i=0; i<_indexToTimer.length; i++) { newIndexToTimer[i+1] = _indexToTimer[i]; } _indexToTimer = newIndexToTimer; _indexToTimer[0] = -1; } HashMap<Integer, Integer> newIndex = new HashMap<Integer, Integer>(); for(int i=0; i<timers.length; i++) { newIndex.put(i+1, Arrays.binarySearch(_indexToTimer, timers[i])); } newIndex.put(0, 0); _matrix = new int[matrixSize()][matrixSize()]; for(int i=0; i<dbmSize(); i++) { for(int j=0; j<dbmSize(); j++) { setDbmEntry(newIndex.get(i), newIndex.get(j), matrix[dbmIndexToMatrixIndex(i)][dbmIndexToMatrixIndex(j)]); } } for(int i=1; i< dbmSize(); i++) { setUpperBoundbydbmIndex(newIndex.get(i), matrix[0][dbmIndexToMatrixIndex(i)]); setLowerBoundbydbmIndex(newIndex.get(i), -1*matrix[dbmIndexToMatrixIndex(i)][0]); } recononicalize(); } }
Zone extends ZoneType { public Zone(int[] timers, int[][] matrix) { _hashCode = -1; _indexToTimer = Arrays.copyOf(timers, timers.length); Arrays.sort(_indexToTimer); if(_indexToTimer[0] != -1) { int[] newIndexToTimer = new int[_indexToTimer.length+1]; for(int i=0; i<_indexToTimer.length; i++) { newIndexToTimer[i+1] = _indexToTimer[i]; } _indexToTimer = newIndexToTimer; _indexToTimer[0] = -1; } HashMap<Integer, Integer> newIndex = new HashMap<Integer, Integer>(); for(int i=0; i<timers.length; i++) { newIndex.put(i+1, Arrays.binarySearch(_indexToTimer, timers[i])); } newIndex.put(0, 0); _matrix = new int[matrixSize()][matrixSize()]; for(int i=0; i<dbmSize(); i++) { for(int j=0; j<dbmSize(); j++) { setDbmEntry(newIndex.get(i), newIndex.get(j), matrix[dbmIndexToMatrixIndex(i)][dbmIndexToMatrixIndex(j)]); } } for(int i=1; i< dbmSize(); i++) { setUpperBoundbydbmIndex(newIndex.get(i), matrix[0][dbmIndexToMatrixIndex(i)]); setLowerBoundbydbmIndex(newIndex.get(i), -1*matrix[dbmIndexToMatrixIndex(i)][0]); } recononicalize(); } Zone(int[] timers, int[][] matrix);  Zone(State initialState); private  Zone(); }
Zone extends ZoneType { public Zone(int[] timers, int[][] matrix) { _hashCode = -1; _indexToTimer = Arrays.copyOf(timers, timers.length); Arrays.sort(_indexToTimer); if(_indexToTimer[0] != -1) { int[] newIndexToTimer = new int[_indexToTimer.length+1]; for(int i=0; i<_indexToTimer.length; i++) { newIndexToTimer[i+1] = _indexToTimer[i]; } _indexToTimer = newIndexToTimer; _indexToTimer[0] = -1; } HashMap<Integer, Integer> newIndex = new HashMap<Integer, Integer>(); for(int i=0; i<timers.length; i++) { newIndex.put(i+1, Arrays.binarySearch(_indexToTimer, timers[i])); } newIndex.put(0, 0); _matrix = new int[matrixSize()][matrixSize()]; for(int i=0; i<dbmSize(); i++) { for(int j=0; j<dbmSize(); j++) { setDbmEntry(newIndex.get(i), newIndex.get(j), matrix[dbmIndexToMatrixIndex(i)][dbmIndexToMatrixIndex(j)]); } } for(int i=1; i< dbmSize(); i++) { setUpperBoundbydbmIndex(newIndex.get(i), matrix[0][dbmIndexToMatrixIndex(i)]); setLowerBoundbydbmIndex(newIndex.get(i), -1*matrix[dbmIndexToMatrixIndex(i)][0]); } recononicalize(); } Zone(int[] timers, int[][] matrix);  Zone(State initialState); private  Zone(); @Override int getUpperBoundbyTransitionIndex(int timer); @Override int getUpperBoundbydbmIndex(int index); void setUpperBoundbyTransitionIndex(int timer, int value); void setUpperBoundbydbmIndex(int index, int value); @Override int getLowerBoundbyTransitionIndex(int timer); @Override int getLowerBoundbydbmIndex(int index); void setLowerBoundbyTransitionIndex(int timer, int value); void setLowerBoundbydbmIndex(int index, int value); @Override int getDbmEntry(int i, int j); @Override String toString(); @Override boolean equals(Object o); boolean equals(Zone otherZone); @Override boolean subset(ZoneType otherZone); @Override int hashCode(); @Override boolean exceedsLowerBoundbyTransitionIndex(int timer); @Override boolean exceedsLowerBoundbydbmIndex(int index); @Override ZoneType fireTransitionbyTransitionIndex(int timer, int[] enabledTimers, 
			State state); @Override ZoneType fireTransitionbydbmIndex(int index, int[] enabledTimers,
			State state); ZoneType mergeZones(Zone otherZone); static ZoneType mergeZones(Zone firstZone, Zone secondZone); @Override Zone clone(); @Override List<Transition> getEnabledTransitions(); @Override HashMap<Integer, Transition> getLexicon(); static void setLexicon(HashMap<Integer, Transition> lexicon); int[] getIndexToTimer(); static void testZoneGraphMinimization(Zone z, boolean popUp); void toDot(PrintStream writer); static void clearLexicon(); }
Zone extends ZoneType { public Zone(int[] timers, int[][] matrix) { _hashCode = -1; _indexToTimer = Arrays.copyOf(timers, timers.length); Arrays.sort(_indexToTimer); if(_indexToTimer[0] != -1) { int[] newIndexToTimer = new int[_indexToTimer.length+1]; for(int i=0; i<_indexToTimer.length; i++) { newIndexToTimer[i+1] = _indexToTimer[i]; } _indexToTimer = newIndexToTimer; _indexToTimer[0] = -1; } HashMap<Integer, Integer> newIndex = new HashMap<Integer, Integer>(); for(int i=0; i<timers.length; i++) { newIndex.put(i+1, Arrays.binarySearch(_indexToTimer, timers[i])); } newIndex.put(0, 0); _matrix = new int[matrixSize()][matrixSize()]; for(int i=0; i<dbmSize(); i++) { for(int j=0; j<dbmSize(); j++) { setDbmEntry(newIndex.get(i), newIndex.get(j), matrix[dbmIndexToMatrixIndex(i)][dbmIndexToMatrixIndex(j)]); } } for(int i=1; i< dbmSize(); i++) { setUpperBoundbydbmIndex(newIndex.get(i), matrix[0][dbmIndexToMatrixIndex(i)]); setLowerBoundbydbmIndex(newIndex.get(i), -1*matrix[dbmIndexToMatrixIndex(i)][0]); } recononicalize(); } Zone(int[] timers, int[][] matrix);  Zone(State initialState); private  Zone(); @Override int getUpperBoundbyTransitionIndex(int timer); @Override int getUpperBoundbydbmIndex(int index); void setUpperBoundbyTransitionIndex(int timer, int value); void setUpperBoundbydbmIndex(int index, int value); @Override int getLowerBoundbyTransitionIndex(int timer); @Override int getLowerBoundbydbmIndex(int index); void setLowerBoundbyTransitionIndex(int timer, int value); void setLowerBoundbydbmIndex(int index, int value); @Override int getDbmEntry(int i, int j); @Override String toString(); @Override boolean equals(Object o); boolean equals(Zone otherZone); @Override boolean subset(ZoneType otherZone); @Override int hashCode(); @Override boolean exceedsLowerBoundbyTransitionIndex(int timer); @Override boolean exceedsLowerBoundbydbmIndex(int index); @Override ZoneType fireTransitionbyTransitionIndex(int timer, int[] enabledTimers, 
			State state); @Override ZoneType fireTransitionbydbmIndex(int index, int[] enabledTimers,
			State state); ZoneType mergeZones(Zone otherZone); static ZoneType mergeZones(Zone firstZone, Zone secondZone); @Override Zone clone(); @Override List<Transition> getEnabledTransitions(); @Override HashMap<Integer, Transition> getLexicon(); static void setLexicon(HashMap<Integer, Transition> lexicon); int[] getIndexToTimer(); static void testZoneGraphMinimization(Zone z, boolean popUp); void toDot(PrintStream writer); static void clearLexicon();  }