de.uni.freiburg.iig.telematik.sepia.replay.ReplayCallableGenerator Maven / Gradle / Ivy
Show all versions of SEPIA Show documentation
package de.uni.freiburg.iig.telematik.sepia.replay;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import de.invation.code.toval.validate.Validate;
import de.uni.freiburg.iig.telematik.sepia.overlap.OverlapCallableGenerator;
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractFlowRelation;
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractMarking;
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractPetriNet;
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractPlace;
import de.uni.freiburg.iig.telematik.sepia.petrinet.abstr.AbstractTransition;
import de.uni.freiburg.iig.telematik.sepia.petrinet.properties.threaded.AbstractCallableGenerator;
import de.uni.freiburg.iig.telematik.sepia.replay.ReplayCallable.TerminationCriteria;
import de.uni.freiburg.iig.telematik.sewol.log.LogEntry;
import de.uni.freiburg.iig.telematik.sewol.log.LogTrace;
import de.uni.freiburg.iig.telematik.sewol.log.LogTraceUtils;
public class ReplayCallableGenerator< P extends AbstractPlace,
T extends AbstractTransition,
F extends AbstractFlowRelation,
M extends AbstractMarking,
S extends Object,
E extends LogEntry> extends AbstractCallableGenerator
{
private Map transitionLabelRelation = null;
private TerminationCriteria terminationCriteria = null;
protected List> activitySequences = null;
protected List> logTraces = null;
public ReplayCallableGenerator(OverlapCallableGenerator overlapGenerator){
super(overlapGenerator);
this.transitionLabelRelation = overlapGenerator.getTransitionLabelRelation();
this.terminationCriteria = overlapGenerator.getTerminationCriteria();
}
public ReplayCallableGenerator(AbstractPetriNet
petriNet) {
super(petriNet);
this.transitionLabelRelation = Replay.getDefaultTransitionLabelRelation(petriNet);
}
public Map getTransitionLabelRelation() {
return transitionLabelRelation;
}
public void setTransitionLabelRelation(Map transitionLabelRelation) {
this.transitionLabelRelation = transitionLabelRelation;
}
public TerminationCriteria getTerminationCriteria() {
return terminationCriteria;
}
public void setTerminationCriteria(TerminationCriteria terminationCriteria) {
this.terminationCriteria = terminationCriteria;
}
public void setLogTraces(Collection> logTraces){
Validate.notNull(logTraces);
if(logTraces instanceof List){
this.logTraces = (List>) logTraces;
} else {
this.logTraces = new ArrayList>(logTraces);
}
activitySequences = LogTraceUtils.createStringRepresentation(this.logTraces, true);
}
public void setLogSequences(Collection> logSequences){
Validate.notNull(logSequences);
this.logTraces = null;
if(logSequences instanceof List){
this.activitySequences = (List>) logSequences;
} else {
this.activitySequences = new ArrayList>(logSequences);
}
}
public List> getActivitySequences() {
return activitySequences;
}
public List> getLogTraces() {
return logTraces;
}
}