IncrementalPM/src/conformance/traceAnalysis/resourceDeviation/ResourceDeviationConformanceCalculator.java
public double update(Map<String, Map<String, Double>> deviations) {
		Map<String, Map<String, Double>> newDeviations=new HashMap<String, Map<String, Double>>();
		Map<String, Double> newCnts=new HashMap<String, Double>();
		Map<String, Double> deviationCnts =new HashMap<String, Double>();
		
		updateAndGetLocalCopy(newDeviations, newCnts, deviationCnts, deviations);
		//from the curretn state, recreate the old state and compare for significant change
		Map<String, Map<String, Double>> oldDeviationsRelative=new HashMap<String, Map<String, Double>>();
		Map<String, Map<String, Double>> newDeviationsRelative=new HashMap<String, Map<String, Double>>();
		for (String activity : newDeviations.keySet()) {
			newDeviationsRelative.put(activity, new HashMap<String, Double>());
			oldDeviationsRelative.put(activity, new HashMap<String, Double>());
			for(Entry<String, Double> resources : newDeviations.get(activity).entrySet()) {
				double deviation=0.0;
				if(deviations.containsKey(activity)) {
					deviation=deviations.get(activity).getOrDefault(resources.getKey(), 0.0);
				}
				newDeviationsRelative.get(activity).put(resources.getKey(), resources.getValue()/newCnts.get(activity));
				oldDeviationsRelative.get(activity).put(resources.getKey(), (resources.getValue()-deviation)/(newCnts.get(activity)-deviationCnts.getOrDefault(activity, 0.0)));
			}
		}
		return calculateDistance(oldDeviationsRelative, newDeviationsRelative);
	}
/**
 * update the current state and return whether it yields significant change
 * update is synchronous, while significant change test is done locally on local copies of the state
 * local copies gained after updateAndGetLocalcopy are of absolute values, these are convertred to relative frequencies locally to reduce time in synchronicity
 */
update the current state and return whether it yields significant change
update is synchronous, while significant change test is done locally on local copies of the state
local copies gained after updateAndGetLocalcopy are of absolute values, these are convertred to relative frequencies locally to reduce time in synchronicity
update the current state and return whether it yields significant change update is synchronous while significant change test is done locally on local copies of the state local copies gained after updateAndGetLocalcopy are of absolute values these are convertred to relative frequencies locally to reduce time in synchronicity
public double update(Map<String, Map<String, Double>> deviations) {
		Map<String, Map<String, Double>> newDeviations=new HashMap<String, Map<String, Double>>();
		Map<String, Double> newCnts=new HashMap<String, Double>();
		Map<String, Double> deviationCnts =new HashMap<String, Double>();
		updateAndGetLocalCopy(newDeviations, newCnts, deviationCnts, deviations);
		Map<String, Map<String, Double>> oldDeviationsRelative=new HashMap<String, Map<String, Double>>();
		Map<String, Map<String, Double>> newDeviationsRelative=new HashMap<String, Map<String, Double>>();
		for (String activity : newDeviations.keySet()) {
			newDeviationsRelative.put(activity, new HashMap<String, Double>());
			oldDeviationsRelative.put(activity, new HashMap<String, Double>());
			for(Entry<String, Double> resources : newDeviations.get(activity).entrySet()) {
				double deviation=0.0;
				if(deviations.containsKey(activity)) {
					deviation=deviations.get(activity).getOrDefault(resources.getKey(), 0.0);
				}
				newDeviationsRelative.get(activity).put(resources.getKey(), resources.getValue()/newCnts.get(activity));
				oldDeviationsRelative.get(activity).put(resources.getKey(), (resources.getValue()-deviation)/(newCnts.get(activity)-deviationCnts.getOrDefault(activity, 0.0)));
			}
		}
		return calculateDistance(oldDeviationsRelative, newDeviationsRelative);
	}
public double update ( Map < String , Map < String , Double > > deviations ) { Map < String , Map < String , Double > > newDeviations = new HashMap < String , Map < String , Double > > ( ) ; Map < String , Double > newCnts = new HashMap < String , Double > ( ) ; Map < String , Double > deviationCnts = new HashMap < String , Double > ( ) ; updateAndGetLocalCopy ( newDeviations , newCnts , deviationCnts , deviations ) ; Map < String , Map < String , Double > > oldDeviationsRelative = new HashMap < String , Map < String , Double > > ( ) ; Map < String , Map < String , Double > > newDeviationsRelative = new HashMap < String , Map < String , Double > > ( ) ; for ( String activity : newDeviations . keySet ( ) ) { newDeviationsRelative . put ( activity , new HashMap < String , Double > ( ) ) ; oldDeviationsRelative . put ( activity , new HashMap < String , Double > ( ) ) ; for ( Entry < String , Double > resources : newDeviations . get ( activity ) . entrySet ( ) ) { double deviation = 0.0 ; if ( deviations . containsKey ( activity ) ) { deviation = deviations . get ( activity ) . getOrDefault ( resources . getKey ( ) , 0.0 ) ; } newDeviationsRelative . get ( activity ) . put ( resources . getKey ( ) , resources . getValue ( ) / newCnts . get ( activity ) ) ; oldDeviationsRelative . get ( activity ) . put ( resources . getKey ( ) , ( resources . getValue ( ) - deviation ) / ( newCnts . get ( activity ) - deviationCnts . getOrDefault ( activity , 0.0 ) ) ) ; } } return calculateDistance ( oldDeviationsRelative , newDeviationsRelative ) ; }
update the current state and return whether it yields significant change
 update is synchronous, while significant change test is done locally on local copies of the state
 local copies gained after updateAndGetLocalcopy are of absolute values, these are convertred to relative frequencies locally to reduce time in synchronicity
update the current state and return whether it yields significant change update is synchronous while significant change test is done locally on local copies of the state local copies gained after updateAndGetLocalcopy are of absolute values these are convertred to relative frequencies locally to reduce time in synchronicity
//from the curretn state, recreate the old state and compare for significant change