private Vector<Vector<HashMap<FuzzyAllenIntervalConstraint.Type, Double>>> simplify(Vector<Vector<HashMap<FuzzyAllenIntervalConstraint.Type, Double>>> frelations) {
		int numVars = getNumVars();
		for (int i = 0; i < numVars; i++) {
			for (int j = 0; j < numVars; j++) {
				if (i != j) {
					//Variable from = this.getVariables()[i];
					//Variable to = this.getVariables()[j];
					Variable from = getSubVariable()[i];
					Variable to = getSubVariable()[j];
					FuzzyAllenIntervalConstraint direct = (FuzzyAllenIntervalConstraint) this.getConstraintNetwork().getConstraint(from, to);
					FuzzyAllenIntervalConstraint inverse = (FuzzyAllenIntervalConstraint) this.getConstraintNetwork().getConstraint(to, from);
					if (direct != null && inverse != null) {
						//System.out.println("DOING " + direct + "\nPLUS " + inverse);
						HashMap<FuzzyAllenIntervalConstraint.Type, Double> inversePossibilities = inverse.getInversePossibilities();
						updateRelation(frelations.get(i).get(j), inversePossibilities);
					}
				}
			}
		}
		return frelations;
	}
private Vector < Vector < HashMap < FuzzyAllenIntervalConstraint . Type , Double > > > simplify ( Vector < Vector < HashMap < FuzzyAllenIntervalConstraint . Type , Double > > > frelations ) { int numVars = getNumVars ( ) ; for ( int i = 0 ; i < numVars ; i ++ ) { for ( int j = 0 ; j < numVars ; j ++ ) { if ( i != j ) { Variable from = getSubVariable ( ) [ i ] ; Variable to = getSubVariable ( ) [ j ] ; FuzzyAllenIntervalConstraint direct = ( FuzzyAllenIntervalConstraint ) this . getConstraintNetwork ( ) . getConstraint ( from , to ) ; FuzzyAllenIntervalConstraint inverse = ( FuzzyAllenIntervalConstraint ) this . getConstraintNetwork ( ) . getConstraint ( to , from ) ; if ( direct != null && inverse != null ) { HashMap < FuzzyAllenIntervalConstraint . Type , Double > inversePossibilities = inverse . getInversePossibilities ( ) ; updateRelation ( frelations . get ( i ) . get ( j ) , inversePossibilities ) ; } } } } return frelations ; }
/*
private HashMap<FuzzyAllenIntervalConstraint.Type, Double> invertPossibilities(HashMap<FuzzyAllenIntervalConstraint.Type, Double> frelation) {
HashMap<Type, Double> ret = new HashMap<Type, Double>();
for (Type t : Type.values()) ret.put(t, 0.0);
for (Type t : frelation.keySet()) {
if (frelation.get(t) == 1.0) {
??? IS THIS CORRECT ??? --> Seems correct
get inverse of each relation that is 1.0
Type inverseRelation = FuzzyAllenIntervalConstraint.getComplement(t);

set poss of each inverse relation to 1.0
ret.put(inverseRelation, frelation.get(t));

calculate the Freksa N of each inverse relation
HashMap<FuzzyAllenIntervalConstraint.Type, Double> fr = new HashMap<FuzzyAllenIntervalConstraint.Type, Double>();
for(int i = 0; i <  FuzzyAllenIntervalConstraint.freksa_neighbor[inverseRelation.ordinal()].length; i++)
fr.put(FuzzyAllenIntervalConstraint.lookupTypeByInt(i), FuzzyAllenIntervalConstraint.getPossibilityDegree(FuzzyAllenIntervalConstraint.freksa_neighbor[inverseRelation.ordinal()][i]));

take the maximum between calculated Freksa N and previously added possibilities
(because this is an OR)
for(FuzzyAllenIntervalConstraint.Type t1: fr.keySet())
ret.put(t1, Math.max(ret.get(t1), fr.get(t1)));
}
}
return ret;
}