IncrementalPM/src/evaluation/Evaluation.java
private void prefixsuffixEvaluation(UIPluginContext context) throws Exception{
		//String[] inputNames = {"Road_Traffic_Fines_Management_Process"};

		String[] inputNames = {"BPI_Challenge_2012"};
		System.out.println("Evaluating prefix-suffix based deviations");
		int repetitions =5;
		for(String input : inputNames) {
			System.out.println("	>"+input);
			String NET_PATH = "input/" + input + ".pnml";
			String LOG_PATH = "input/" + input + ".xes";
			XLog log = loadLog(LOG_PATH);
			PetrinetGraph net = importPNML(NET_PATH, context);
			System.out.println("	>Loaded log and net");
			
			XEventClassifier classifier = deriveClassifierForLog(input);		
			TransEvClassMapping mapping = computeTransEventMapping(input, log, net, classifier);				
			
			PrintWriter prefixsuffix = new PrintWriter(input+"_prefixsuffix.csv", "UTF-8");
			prefixsuffix.write(String.join(";","delta","alpha","epsilon","k","time","logSize","variants","approximated","fitness","deviations","approximationMode","resources\n"));
				
			ArrayList<IccParameter> list = new ArrayList<IccParameter>();
			//deviations approximated - prefix suffix
			//list.add(new IccParameter(0.01, 0.99, 0.01, 0.3  , IncrementalConformanceChecker.Goals.DEVIATIONS, true, IncrementalConformanceChecker.Heuristics.PREFIXSUFFIX, false, false));
			//list.add(new IccParameter(0.01, 0.99, 0.01, 0.2  , IncrementalConformanceChecker.Goals.DEVIATIONS, true, IncrementalConformanceChecker.Heuristics.PREFIXSUFFIX, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.01  , IncrementalConformanceChecker.Goals.DEVIATIONS, true, IncrementalConformanceChecker.Heuristics.PREFIXSUFFIX, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.05  , IncrementalConformanceChecker.Goals.DEVIATIONS, true, IncrementalConformanceChecker.Heuristics.PREFIXSUFFIX, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.1   , IncrementalConformanceChecker.Goals.DEVIATIONS, true, IncrementalConformanceChecker.Heuristics.PREFIXSUFFIX, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.10, 0.01  , IncrementalConformanceChecker.Goals.DEVIATIONS, true, IncrementalConformanceChecker.Heuristics.PREFIXSUFFIX, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.10, 0.05  , IncrementalConformanceChecker.Goals.DEVIATIONS, true, IncrementalConformanceChecker.Heuristics.PREFIXSUFFIX, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.10, 0.1   , IncrementalConformanceChecker.Goals.DEVIATIONS, true, IncrementalConformanceChecker.Heuristics.PREFIXSUFFIX, false, false));
			
			int cnt=1;
			int total=list.size()*repetitions;
			for(IccParameter parameter : list) {
				for(int i=0;i<repetitions;i++) {
					System.out.println("prefixSuffix Evaluation>"+input+" - repetition "+cnt+"/"+total);
					XLog copyLog=(XLog) log.clone();
					//Replayer replayer = ReplayerFactory.createReplayer(net, copyLog, mapping, true);
					IncrementalTraceAnalyzer<?> analyzer = TraceAnalyzerFactory.createTraceAnalyzer(parameter, mapping, classifier, log, net, null);
					long start = System.currentTimeMillis();
					GlobalConformanceResult result = checkForGlobalConformanceWithICC(context, net, copyLog, analyzer, parameter, null, null, SEEDS[i]);
					long 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);
					prefixsuffix.write(out);
					cnt++;
				}
			}
			prefixsuffix.close();

		}
	}
/**
	 * evaluate the approximation-based deviating activity use case using the prefixsuffix heuristic.
	 * This heuristic needs more granular fine tuning than the others, hence it's own evaluation run
	 * @param context
	 * @throws Exception
	 */
evaluate the approximation-based deviating activity use case using the prefixsuffix heuristic.
This heuristic needs more granular fine tuning than the others, hence it's own evaluation run
@param context
@throws Exception
evaluate the approximation - based deviating activity use case using the prefixsuffix heuristic . This heuristic needs more granular fine tuning than the others hence it ' s own evaluation run @param context @throws Exception
private void prefixsuffixEvaluation(UIPluginContext context) throws Exception{
		String[] inputNames = {"BPI_Challenge_2012"};
		System.out.println("Evaluating prefix-suffix based deviations");
		int repetitions =5;
		for(String input : inputNames) {
			System.out.println("	>"+input);
			String NET_PATH = "input/" + input + ".pnml";
			String LOG_PATH = "input/" + input + ".xes";
			XLog log = loadLog(LOG_PATH);
			PetrinetGraph net = importPNML(NET_PATH, context);
			System.out.println("	>Loaded log and net");
			XEventClassifier classifier = deriveClassifierForLog(input);		
			TransEvClassMapping mapping = computeTransEventMapping(input, log, net, classifier);				
			PrintWriter prefixsuffix = new PrintWriter(input+"_prefixsuffix.csv", "UTF-8");
			prefixsuffix.write(String.join(";","delta","alpha","epsilon","k","time","logSize","variants","approximated","fitness","deviations","approximationMode","resources\n"));
			ArrayList<IccParameter> list = new ArrayList<IccParameter>();
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.01  , IncrementalConformanceChecker.Goals.DEVIATIONS, true, IncrementalConformanceChecker.Heuristics.PREFIXSUFFIX, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.05  , IncrementalConformanceChecker.Goals.DEVIATIONS, true, IncrementalConformanceChecker.Heuristics.PREFIXSUFFIX, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.01, 0.1   , IncrementalConformanceChecker.Goals.DEVIATIONS, true, IncrementalConformanceChecker.Heuristics.PREFIXSUFFIX, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.10, 0.01  , IncrementalConformanceChecker.Goals.DEVIATIONS, true, IncrementalConformanceChecker.Heuristics.PREFIXSUFFIX, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.10, 0.05  , IncrementalConformanceChecker.Goals.DEVIATIONS, true, IncrementalConformanceChecker.Heuristics.PREFIXSUFFIX, false, false));
			list.add(new IccParameter(0.01, 0.99, 0.10, 0.1   , IncrementalConformanceChecker.Goals.DEVIATIONS, true, IncrementalConformanceChecker.Heuristics.PREFIXSUFFIX, false, false));
			int cnt=1;
			int total=list.size()*repetitions;
			for(IccParameter parameter : list) {
				for(int i=0;i<repetitions;i++) {
					System.out.println("prefixSuffix Evaluation>"+input+" - repetition "+cnt+"/"+total);
					XLog copyLog=(XLog) log.clone();
					IncrementalTraceAnalyzer<?> analyzer = TraceAnalyzerFactory.createTraceAnalyzer(parameter, mapping, classifier, log, net, null);
					long start = System.currentTimeMillis();
					GlobalConformanceResult result = checkForGlobalConformanceWithICC(context, net, copyLog, analyzer, parameter, null, null, SEEDS[i]);
					long 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);
					prefixsuffix.write(out);
					cnt++;
				}
			}
			prefixsuffix.close();
		}
	}
private void prefixsuffixEvaluation ( UIPluginContext context ) throws Exception { String [ ] inputNames = { "BPI_Challenge_2012" } ; System . out . println ( "Evaluating prefix-suffix based deviations" ) ; int repetitions = 5 ; for ( String input : inputNames ) { System . out . println ( "	>" + input ) ; String NET_PATH = "input/" + input + ".pnml" ; String LOG_PATH = "input/" + input + ".xes" ; XLog log = loadLog ( LOG_PATH ) ; PetrinetGraph net = importPNML ( NET_PATH , context ) ; System . out . println ( "	>Loaded log and net" ) ; XEventClassifier classifier = deriveClassifierForLog ( input ) ; TransEvClassMapping mapping = computeTransEventMapping ( input , log , net , classifier ) ; PrintWriter prefixsuffix = new PrintWriter ( input + "_prefixsuffix.csv" , "UTF-8" ) ; prefixsuffix . write ( String . join ( ";" , "delta" , "alpha" , "epsilon" , "k" , "time" , "logSize" , "variants" , "approximated" , "fitness" , "deviations" , "approximationMode" , "resources\n" ) ) ; ArrayList < IccParameter > list = new ArrayList < IccParameter > ( ) ; list . add ( new IccParameter ( 0.01 , 0.99 , 0.01 , 0.01 , IncrementalConformanceChecker . Goals . DEVIATIONS , true , IncrementalConformanceChecker . Heuristics . PREFIXSUFFIX , false , false ) ) ; list . add ( new IccParameter ( 0.01 , 0.99 , 0.01 , 0.05 , IncrementalConformanceChecker . Goals . DEVIATIONS , true , IncrementalConformanceChecker . Heuristics . PREFIXSUFFIX , false , false ) ) ; list . add ( new IccParameter ( 0.01 , 0.99 , 0.01 , 0.1 , IncrementalConformanceChecker . Goals . DEVIATIONS , true , IncrementalConformanceChecker . Heuristics . PREFIXSUFFIX , false , false ) ) ; list . add ( new IccParameter ( 0.01 , 0.99 , 0.10 , 0.01 , IncrementalConformanceChecker . Goals . DEVIATIONS , true , IncrementalConformanceChecker . Heuristics . PREFIXSUFFIX , false , false ) ) ; list . add ( new IccParameter ( 0.01 , 0.99 , 0.10 , 0.05 , IncrementalConformanceChecker . Goals . DEVIATIONS , true , IncrementalConformanceChecker . Heuristics . PREFIXSUFFIX , false , false ) ) ; list . add ( new IccParameter ( 0.01 , 0.99 , 0.10 , 0.1 , IncrementalConformanceChecker . Goals . DEVIATIONS , true , IncrementalConformanceChecker . Heuristics . PREFIXSUFFIX , false , false ) ) ; int cnt = 1 ; int total = list . size ( ) * repetitions ; for ( IccParameter parameter : list ) { for ( int i = 0 ; i < repetitions ; i ++ ) { System . out . println ( "prefixSuffix Evaluation>" + input + " - repetition " + cnt + "/" + total ) ; XLog copyLog = ( XLog ) log . clone ( ) ; IncrementalTraceAnalyzer < ? > analyzer = TraceAnalyzerFactory . createTraceAnalyzer ( parameter , mapping , classifier , log , net , null ) ; long start = System . currentTimeMillis ( ) ; GlobalConformanceResult result = checkForGlobalConformanceWithICC ( context , net , copyLog , analyzer , parameter , null , null , SEEDS [ i ] ) ; long 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 ) ; prefixsuffix . write ( out ) ; cnt ++ ; } } prefixsuffix . close ( ) ; } }
evaluate the approximation-based deviating activity use case using the prefixsuffix heuristic.
evaluate the approximation - based deviating activity use case using the prefixsuffix heuristic .
//String[] inputNames = {"Road_Traffic_Fines_Management_Process"}; //deviations approximated - prefix suffix //list.add(new IccParameter(0.01, 0.99, 0.01, 0.3  , IncrementalConformanceChecker.Goals.DEVIATIONS, true, IncrementalConformanceChecker.Heuristics.PREFIXSUFFIX, false, false)); //list.add(new IccParameter(0.01, 0.99, 0.01, 0.2  , IncrementalConformanceChecker.Goals.DEVIATIONS, true, IncrementalConformanceChecker.Heuristics.PREFIXSUFFIX, false, false)); //Replayer replayer = ReplayerFactory.createReplayer(net, copyLog, mapping, true);