IncrementalPM/src/conformance/traceAnalysis/IncrementalTraceAnalyzer.java
private Pair<TraceAnalysisResult<T>, TraceEditDistance> mostSimilarTrace(XTrace trace) {
		TraceEditDistance minDist=new TraceEditDistance("","");
		minDist.distance=Integer.MAX_VALUE;
		TraceAnalysisResult<T> referenceTrace = null;
		for (TraceAnalysisResult<T> alignmentInfo : results.values()) {
			//TODO check if pruning is correct
			if (alignmentInfo.approximated||Math.abs((trace.size()-alignmentInfo.getTrace().size())/(trace.size()+alignmentInfo.getTrace().size()))>this.parameter.getK())
				continue;
			//get trace edit distance
			TraceEditDistance distance=new TraceEditDistance(trace,alignmentInfo.getTrace());
			if(distance.getDistance()<minDist.distance) {
				minDist=distance;
				referenceTrace = alignmentInfo;
			}
		}
		return new ImmutablePair<TraceAnalysisResult<T>, TraceEditDistance>(referenceTrace, minDist);
	}
/**
	 * find reference trace, that is most similar to given trace (in terms of edit distance)
	 * @param trace
	 * @return closest trace
	 */
find reference trace, that is most similar to given trace (in terms of edit distance)
@param trace
@return closest trace
find reference trace that is most similar to given trace ( in terms of edit distance ) @param trace @return closest trace
private Pair<TraceAnalysisResult<T>, TraceEditDistance> mostSimilarTrace(XTrace trace) {
		TraceEditDistance minDist=new TraceEditDistance("","");
		minDist.distance=Integer.MAX_VALUE;
		TraceAnalysisResult<T> referenceTrace = null;
		for (TraceAnalysisResult<T> alignmentInfo : results.values()) {
			if (alignmentInfo.approximated||Math.abs((trace.size()-alignmentInfo.getTrace().size())/(trace.size()+alignmentInfo.getTrace().size()))>this.parameter.getK())
				continue;
			TraceEditDistance distance=new TraceEditDistance(trace,alignmentInfo.getTrace());
			if(distance.getDistance()<minDist.distance) {
				minDist=distance;
				referenceTrace = alignmentInfo;
			}
		}
		return new ImmutablePair<TraceAnalysisResult<T>, TraceEditDistance>(referenceTrace, minDist);
	}
private Pair < TraceAnalysisResult < T > , TraceEditDistance > mostSimilarTrace ( XTrace trace ) { TraceEditDistance minDist = new TraceEditDistance ( "" , "" ) ; minDist . distance = Integer . MAX_VALUE ; TraceAnalysisResult < T > referenceTrace = null ; for ( TraceAnalysisResult < T > alignmentInfo : results . values ( ) ) { if ( alignmentInfo . approximated || Math . abs ( ( trace . size ( ) - alignmentInfo . getTrace ( ) . size ( ) ) / ( trace . size ( ) + alignmentInfo . getTrace ( ) . size ( ) ) ) > this . parameter . getK ( ) ) continue ; TraceEditDistance distance = new TraceEditDistance ( trace , alignmentInfo . getTrace ( ) ) ; if ( distance . getDistance ( ) < minDist . distance ) { minDist = distance ; referenceTrace = alignmentInfo ; } } return new ImmutablePair < TraceAnalysisResult < T > , TraceEditDistance > ( referenceTrace , minDist ) ; }
find reference trace, that is most similar to given trace (in terms of edit distance)
 @param trace
 @return closest trace
find reference trace that is most similar to given trace ( in terms of edit distance ) @param trace @return closest trace
//TODO check if pruning is correct //get trace edit distance