IncrementalPM/src/evaluation/Evaluation.java
private void referenceEvaluation(UIPluginContext context) throws Exception{
		//log and petri net files to be used
		String[] logNames = {"Road_Traffic_Fines_Management_Process"};
		String[] netNames = {"Road_Traffic_Fines_Management_Process"};
		
		System.out.println("Evaluating parameters");
		for(int k=0; k<logNames.length; k++) {
			System.out.println(">Loading log "+logNames[k]+" and net "+netNames[k]);
			String NET_PATH = "input/Misc/" + netNames[k] + ".pnml";
			String LOG_PATH = "input/Misc/" + logNames[k] + ".xes";
			XLog log = loadLog(LOG_PATH);
			PetrinetGraph net = importPNML(NET_PATH, context);
			System.out.println(">Done");
			
		//manually set event classifier and log-to-net mapping
			XEventClassifier classifier = XLogInfoImpl.STANDARD_CLASSIFIER;
			TransEvClassMapping mapping = computeTransEventMapping(logNames[k], log, net, classifier);	
			
		//or create ui for both and let user do this manually
			//IncrementalPNReplayerUI pnReplayerUI = new IncrementalPNReplayerUI();
			//Object[] resultConfiguration = pnReplayerUI.getConfiguration(context, net, log);
			//TransEvClassMapping mapping = (TransEvClassMapping) resultConfiguration[PNReplayerUI.MAPPING];
			//XEventClassifier classifier = pnReplayerUI.classifier;

			
			
			ArrayList<IccParameter> list = new ArrayList<IccParameter>();
			//fitness
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.1 , IncrementalConformanceChecker.Goals.FITNESS, false, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.1 , IncrementalConformanceChecker.Goals.FITNESS, true, false, false));
			//deviations
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.1 , IncrementalConformanceChecker.Goals.DEVIATIONS, false, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.1 , IncrementalConformanceChecker.Goals.DEVIATIONS, true, IncrementalConformanceChecker.Heuristics.NONALIGNING_ALL, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.1 , IncrementalConformanceChecker.Goals.DEVIATIONS, true, IncrementalConformanceChecker.Heuristics.NONALIGNING_KNOWN, false, false));
			//resources - ensure that resource
			ResourceAssignmentComputer assignmentComputer = new ResourceAssignmentComputer(0.20);
			ResourceAssignment resAssignment = assignmentComputer.createResourceAssignment(log);
			
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.1 , IncrementalConformanceChecker.Goals.RESOURCES, false, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.1 , IncrementalConformanceChecker.Goals.RESOURCES, true, IncrementalConformanceChecker.Heuristics.NONALIGNING_ALL, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.1 , IncrementalConformanceChecker.Goals.RESOURCES, true, IncrementalConformanceChecker.Heuristics.NONALIGNING_KNOWN, false, false));

			//first check whether baseline replay algorithm works correctly
			XLog copyLog = (XLog) log.clone();
			Replayer replayer = ReplayerFactory.createReplayer(net, copyLog, mapping, classifier, false);
			long start = System.currentTimeMillis();
			PNRepResult baselineResult = replayer.computePNRepResult(Progress.INVISIBLE, copyLog);
			long end = System.currentTimeMillis();
			System.out.println("replay time of Baseline:"+(end-start)+"\n");
			
			
			//then conduct experiments for sampling variants
			for(IccParameter parameter : list) {
				System.out.println("Parameter Evaluation>"+logNames[k]+" and net "+netNames[k]);
				
				copyLog=(XLog) log.clone();
				IncrementalTraceAnalyzer<?> analyzer = TraceAnalyzerFactory.createTraceAnalyzer(parameter, mapping, classifier, log, net, resAssignment);
				start = System.currentTimeMillis();
				
				//last param is seed for java.rndm - replace with fixed ssed if reproducability is desired
				GlobalConformanceResult result = checkForGlobalConformanceWithICC(context, net, copyLog, analyzer, parameter, null, null, System.currentTimeMillis());
				end = System.currentTimeMillis();
				String out=String.join(";", 
						Double.toString(parameter.getDelta()),Double.toString(parameter.getAlpha()),Double.toString(parameter.getEpsilon()),Double.toString(parameter.getK()),
						Long.toString(end-start), Integer.toString(result.getCnt()),Integer.toString(result.getTotalVariants()), Integer.toString(result.getApproximatedVariants()),
						Double.toString(result.getFitness()), result.getDeviations().toString(), parameter.getApproximationHeuristic().toString(), result.getResourceDeviations().toString()+"\n");
				System.out.println(out+"\n");
			}
		}
	}
/**
	*
	* Reference function, running one iteration of a baseline conformance calculation without sampling and each of the proposed use cases
	*
	**/
Reference function, running one iteration of a baseline conformance calculation without sampling and each of the proposed use cases
Reference function running one iteration of a baseline conformance calculation without sampling and each of the proposed use cases
private void referenceEvaluation(UIPluginContext context) throws Exception{
		String[] logNames = {"Road_Traffic_Fines_Management_Process"};
		String[] netNames = {"Road_Traffic_Fines_Management_Process"};
		System.out.println("Evaluating parameters");
		for(int k=0; k<logNames.length; k++) {
			System.out.println(">Loading log "+logNames[k]+" and net "+netNames[k]);
			String NET_PATH = "input/Misc/" + netNames[k] + ".pnml";
			String LOG_PATH = "input/Misc/" + logNames[k] + ".xes";
			XLog log = loadLog(LOG_PATH);
			PetrinetGraph net = importPNML(NET_PATH, context);
			System.out.println(">Done");
			XEventClassifier classifier = XLogInfoImpl.STANDARD_CLASSIFIER;
			TransEvClassMapping mapping = computeTransEventMapping(logNames[k], log, net, classifier);	
			ArrayList<IccParameter> list = new ArrayList<IccParameter>();
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.1 , IncrementalConformanceChecker.Goals.FITNESS, false, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.1 , IncrementalConformanceChecker.Goals.FITNESS, true, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.1 , IncrementalConformanceChecker.Goals.DEVIATIONS, false, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.1 , IncrementalConformanceChecker.Goals.DEVIATIONS, true, IncrementalConformanceChecker.Heuristics.NONALIGNING_ALL, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.1 , IncrementalConformanceChecker.Goals.DEVIATIONS, true, IncrementalConformanceChecker.Heuristics.NONALIGNING_KNOWN, false, false));
			ResourceAssignmentComputer assignmentComputer = new ResourceAssignmentComputer(0.20);
			ResourceAssignment resAssignment = assignmentComputer.createResourceAssignment(log);
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.1 , IncrementalConformanceChecker.Goals.RESOURCES, false, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.1 , IncrementalConformanceChecker.Goals.RESOURCES, true, IncrementalConformanceChecker.Heuristics.NONALIGNING_ALL, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.1 , IncrementalConformanceChecker.Goals.RESOURCES, true, IncrementalConformanceChecker.Heuristics.NONALIGNING_KNOWN, false, false));
			XLog copyLog = (XLog) log.clone();
			Replayer replayer = ReplayerFactory.createReplayer(net, copyLog, mapping, classifier, false);
			long start = System.currentTimeMillis();
			PNRepResult baselineResult = replayer.computePNRepResult(Progress.INVISIBLE, copyLog);
			long end = System.currentTimeMillis();
			System.out.println("replay time of Baseline:"+(end-start)+"\n");
			for(IccParameter parameter : list) {
				System.out.println("Parameter Evaluation>"+logNames[k]+" and net "+netNames[k]);
				copyLog=(XLog) log.clone();
				IncrementalTraceAnalyzer<?> analyzer = TraceAnalyzerFactory.createTraceAnalyzer(parameter, mapping, classifier, log, net, resAssignment);
				start = System.currentTimeMillis();
				GlobalConformanceResult result = checkForGlobalConformanceWithICC(context, net, copyLog, analyzer, parameter, null, null, System.currentTimeMillis());
				end = System.currentTimeMillis();
				String out=String.join(";", 
						Double.toString(parameter.getDelta()),Double.toString(parameter.getAlpha()),Double.toString(parameter.getEpsilon()),Double.toString(parameter.getK()),
						Long.toString(end-start), Integer.toString(result.getCnt()),Integer.toString(result.getTotalVariants()), Integer.toString(result.getApproximatedVariants()),
						Double.toString(result.getFitness()), result.getDeviations().toString(), parameter.getApproximationHeuristic().toString(), result.getResourceDeviations().toString()+"\n");
				System.out.println(out+"\n");
			}
		}
	}
private void referenceEvaluation ( UIPluginContext context ) throws Exception { String [ ] logNames = { "Road_Traffic_Fines_Management_Process" } ; String [ ] netNames = { "Road_Traffic_Fines_Management_Process" } ; System . out . println ( "Evaluating parameters" ) ; for ( int k = 0 ; k < logNames . length ; k ++ ) { System . out . println ( ">Loading log " + logNames [ k ] + " and net " + netNames [ k ] ) ; String NET_PATH = "input/Misc/" + netNames [ k ] + ".pnml" ; String LOG_PATH = "input/Misc/" + logNames [ k ] + ".xes" ; XLog log = loadLog ( LOG_PATH ) ; PetrinetGraph net = importPNML ( NET_PATH , context ) ; System . out . println ( ">Done" ) ; XEventClassifier classifier = XLogInfoImpl . STANDARD_CLASSIFIER ; TransEvClassMapping mapping = computeTransEventMapping ( logNames [ k ] , log , net , classifier ) ; ArrayList < IccParameter > list = new ArrayList < IccParameter > ( ) ; list . add ( new IccParameter ( 0.01 , 0.99 , 0.01 , 0.1 , IncrementalConformanceChecker . Goals . FITNESS , false , false , false ) ) ; list . add ( new IccParameter ( 0.01 , 0.99 , 0.01 , 0.1 , IncrementalConformanceChecker . Goals . FITNESS , true , false , false ) ) ; list . add ( new IccParameter ( 0.01 , 0.99 , 0.01 , 0.1 , IncrementalConformanceChecker . Goals . DEVIATIONS , false , false , false ) ) ; list . add ( new IccParameter ( 0.01 , 0.99 , 0.01 , 0.1 , IncrementalConformanceChecker . Goals . DEVIATIONS , true , IncrementalConformanceChecker . Heuristics . NONALIGNING_ALL , false , false ) ) ; list . add ( new IccParameter ( 0.01 , 0.99 , 0.01 , 0.1 , IncrementalConformanceChecker . Goals . DEVIATIONS , true , IncrementalConformanceChecker . Heuristics . NONALIGNING_KNOWN , false , false ) ) ; ResourceAssignmentComputer assignmentComputer = new ResourceAssignmentComputer ( 0.20 ) ; ResourceAssignment resAssignment = assignmentComputer . createResourceAssignment ( log ) ; list . add ( new IccParameter ( 0.01 , 0.99 , 0.01 , 0.1 , IncrementalConformanceChecker . Goals . RESOURCES , false , false , false ) ) ; list . add ( new IccParameter ( 0.01 , 0.99 , 0.01 , 0.1 , IncrementalConformanceChecker . Goals . RESOURCES , true , IncrementalConformanceChecker . Heuristics . NONALIGNING_ALL , false , false ) ) ; list . add ( new IccParameter ( 0.01 , 0.99 , 0.01 , 0.1 , IncrementalConformanceChecker . Goals . RESOURCES , true , IncrementalConformanceChecker . Heuristics . NONALIGNING_KNOWN , false , false ) ) ; XLog copyLog = ( XLog ) log . clone ( ) ; Replayer replayer = ReplayerFactory . createReplayer ( net , copyLog , mapping , classifier , false ) ; long start = System . currentTimeMillis ( ) ; PNRepResult baselineResult = replayer . computePNRepResult ( Progress . INVISIBLE , copyLog ) ; long end = System . currentTimeMillis ( ) ; System . out . println ( "replay time of Baseline:" + ( end - start ) + "\n" ) ; for ( IccParameter parameter : list ) { System . out . println ( "Parameter Evaluation>" + logNames [ k ] + " and net " + netNames [ k ] ) ; copyLog = ( XLog ) log . clone ( ) ; IncrementalTraceAnalyzer < ? > analyzer = TraceAnalyzerFactory . createTraceAnalyzer ( parameter , mapping , classifier , log , net , resAssignment ) ; start = System . currentTimeMillis ( ) ; GlobalConformanceResult result = checkForGlobalConformanceWithICC ( context , net , copyLog , analyzer , parameter , null , null , System . currentTimeMillis ( ) ) ; end = System . currentTimeMillis ( ) ; String out = String . join ( ";" , Double . toString ( parameter . getDelta ( ) ) , Double . toString ( parameter . getAlpha ( ) ) , Double . toString ( parameter . getEpsilon ( ) ) , Double . toString ( parameter . getK ( ) ) , Long . toString ( end - start ) , Integer . toString ( result . getCnt ( ) ) , Integer . toString ( result . getTotalVariants ( ) ) , Integer . toString ( result . getApproximatedVariants ( ) ) , Double . toString ( result . getFitness ( ) ) , result . getDeviations ( ) . toString ( ) , parameter . getApproximationHeuristic ( ) . toString ( ) , result . getResourceDeviations ( ) . toString ( ) + "\n" ) ; System . out . println ( out + "\n" ) ; } } }
Reference function, running one iteration of a baseline conformance calculation without sampling and each of the proposed use cases
Reference function running one iteration of a baseline conformance calculation without sampling and each of the proposed use cases
//log and petri net files to be used //manually set event classifier and log-to-net mapping //or create ui for both and let user do this manually //IncrementalPNReplayerUI pnReplayerUI = new IncrementalPNReplayerUI(); //Object[] resultConfiguration = pnReplayerUI.getConfiguration(context, net, log); //TransEvClassMapping mapping = (TransEvClassMapping) resultConfiguration[PNReplayerUI.MAPPING]; //XEventClassifier classifier = pnReplayerUI.classifier; //fitness //deviations //resources - ensure that resource //first check whether baseline replay algorithm works correctly //then conduct experiments for sampling variants //last param is seed for java.rndm - replace with fixed ssed if reproducability is desired