本文整理汇总了Java中org.deckfour.xes.model.XTrace类的典型用法代码示例。如果您正苦于以下问题:Java XTrace类的具体用法?Java XTrace怎么用?Java XTrace使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XTrace类属于org.deckfour.xes.model包,在下文中一共展示了XTrace类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: codeLog
import org.deckfour.xes.model.XTrace; //导入依赖的package包/类
private List<IntArrayList> codeLog(XLog log) {
List<IntArrayList> codedLog = new ArrayList<>(log.size());
for(XTrace trace : log) {
IntArrayList list = new IntArrayList(trace.size());
for(XEvent event : trace) {
String name = xEventClassifier.getClassIdentity(event);
Integer value;
if((value = stringToIntMap.get(name)) > 0) {
list.add(value);
}else {
stringToIntMap.put(name, events);
intToStringMap.put(events, name);
list.add(events);
events++;
}
}
codedLog.add(list);
}
return codedLog;
}
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:21,代码来源:LabelFilter.java
示例2: check
import org.deckfour.xes.model.XTrace; //导入依赖的package包/类
public XLog check(XLog noisyLog, XLog correctLog) {
for(XTrace trace1 : noisyLog) {
String traceID = xce.extractName(trace1);
boolean matches = true;
for (XTrace trace2 : correctLog) {
if (xce.extractName(trace2).equals(traceID)) {
for (int i = 0; i < trace1.size(); i++) {
if (!xce.extractName(trace1.get(i)).equals(xce.extractName(trace2.get(i)))) {
matches = false;
trace1.get(i).getAttributes().put("change", new XAttributeBooleanImpl("change", true));
}
}
if (!matches) {
trace1.getAttributes().put("change", new XAttributeBooleanImpl("change", true));
}
break;
}
}
}
return noisyLog;
}
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:26,代码来源:TimeStampFilterMarker.java
示例3: findEnd
import org.deckfour.xes.model.XTrace; //导入依赖的package包/类
private XEvent findEnd(XTrace trace, XEvent start, Set<XEvent> events) {
boolean foundStart = false;
// for(int i = 0; i < trace.size(); i++) {
// if(!foundStart && start == trace.get(i)) {
// foundStart = true;
// continue;
// }
// if(foundStart && !events.contains(trace.get(i))) return trace.get(i);
// }
for(XEvent event : trace) {
if(!foundStart && start == event) {
foundStart = true;
continue;
}
if(foundStart && !events.contains(event)) return event;
}
return null;
}
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:19,代码来源:EventPermutatorSmart.java
示例4: permuteLog
import org.deckfour.xes.model.XTrace; //导入依赖的package包/类
private XLog permuteLog() {
duplicatedLog = factory.createLog(log.getAttributes());
for(XTrace t : log) {
originalTraces.put(getTraceName(t), t);
if(timeStampChecker.containsSameTimestamps(t)) {
Set<XTrace> traces = eventPermutator.duplicatesTrace(t);
if(traces.size() > 0) {
duplicatedLog.addAll(traces);
possibleTraces.put(getTraceName(t), traces);
}else {
duplicatedLog.add(logCloner.getXTrace(t));
}
}else {
duplicatedLog.add(logCloner.getXTrace(t));
}
}
return duplicatedLog;
}
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:20,代码来源:TimeStampFixerDummy.java
示例5: discoverSequences
import org.deckfour.xes.model.XTrace; //导入依赖的package包/类
private void discoverSequences() {
for(XTrace trace : log) {
if(!timeStampChecker.containsSameTimestamps(trace)) {
for (int i = 0; i < trace.size(); i++) {
List<String> labels = new ArrayList<>(trace.size());
labels.add(getEventName(trace.get(i)));
for (int j = i + 1; j < trace.size(); j++) {
labels.add(getEventName(trace.get(j)));
sequences.add(TraceToString.listToString(labels));
List<String> pattern = new ArrayList<>(labels);
Collections.sort(pattern);
Set<List<String>> patterns;
if((patterns = patternsMap.get(pattern)) == null) {
patterns = new UnifiedSet<>();
patternsMap.put(pattern, patterns);
}
patterns.add(pattern);
}
}
}
}
}
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:24,代码来源:TimeStampFixerDummy.java
示例6: check
import org.deckfour.xes.model.XTrace; //导入依赖的package包/类
public String check(XLog log1, XLog log2) {
int notMaching = 0;
for(XTrace trace1 : log1) {
String traceID = xce.extractName(trace1);
for (XTrace trace2 : log2) {
if (xce.extractName(trace2).equals(traceID)) {
for (int i = 0; i < trace1.size(); i++) {
if (!xce.extractName(trace1.get(i)).equals(xce.extractName(trace2.get(i)))) {
notMaching++;
break;
}
}
break;
}
}
}
String s = "<html><p>Number of Different Traces: " + notMaching + "</p></html>";
return s;
}
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:22,代码来源:LogComparator.java
示例7: doesProcessInstanceAlwaysEnd
import org.deckfour.xes.model.XTrace; //导入依赖的package包/类
private boolean doesProcessInstanceAlwaysEnd(Entity grandParent, Set<String> eventNames, UnifiedMap<Entity, XLog> logs) {
XLog log = logs.get(grandParent);
boolean correct = false;
for (XTrace trace : log) {
boolean occurs = false;
for (XEvent event : trace) {
if (eventNames.contains(xce.extractName(event))) {
occurs = true;
correct = true;
break;
}
}
if (occurs && !eventNames.contains(xce.extractName(trace.get(trace.size() - 1)))) {
correct = false;
break;
}
}
return correct;
}
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:21,代码来源:SubProcessTypeDiscoverer.java
示例8: createGraph
import org.deckfour.xes.model.XTrace; //导入依赖的package包/类
public Graph createGraph(XLog log, String event_label) {
Graph graph = new Graph();
ArrayList<XEvent> pre_window = new ArrayList<>(window_size);
ArrayList<XEvent> post_window = new ArrayList<>(window_size);
XEvent center_element = null;
for(XTrace trace : log) {
pre_window.clear();
post_window.clear();
center_element = null;
for(int i = 0; i < trace.size(); i++) {
center_element = shiftWindows(pre_window, post_window, center_element, trace.get(i));
if(center_element != null) {
System.out.println(toString(pre_window) + " " + toString(center_element) + " " + toString(post_window));
}
}
}
return graph;
}
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:22,代码来源:GraphFactory.java
示例9: fixDate
import org.deckfour.xes.model.XTrace; //导入依赖的package包/类
public Date fixDate(XTrace trace, int eventPos, int prePos, int postPos) {
XEvent event = trace.get(eventPos);
Date date1;
if(prePos >= 0) {
date1 = xte.extractTimestamp(trace.get(prePos));
if (date1 == null) {
date1 = fixDate(trace, prePos, prePos - 1, postPos);
}
}else {
date1 = new Date(0);
}
Date date2;
if(postPos < trace.size()) {
date2 = xte.extractTimestamp(trace.get(postPos));
if (date2 == null) {
date2 = fixDate(trace, postPos, prePos, postPos + 1);
}
}else {
date2 = new Date(Long.MAX_VALUE);
}
Date date3 = new Date((date2.getTime() + date1.getTime())/ 2);
xte.assignTimestamp(event, date3);
return date3;
}
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:26,代码来源:NoiseGenerator.java
示例10: computeLikelihood
import org.deckfour.xes.model.XTrace; //导入依赖的package包/类
public double computeLikelihood(XTrace trace) {
double likelihood = 1;
XEvent last = null;
String lastName;
Double res;
if((res = likelihoodCache.get(trace)) == null) {
for (int i = 0; i < trace.size(); i++) {
XEvent event = trace.get(i);
if (last != null) {
lastName = getEventName(last);
String eventName = getEventName(event);
likelihood *= computeLikelihood(lastName, eventName);
}
last = event;
}
likelihoodCache.put(trace, likelihood);
}
if(res != null) {
likelihood = res;
}
return likelihood;
}
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:24,代码来源:EventDistributionCalculatorImpl.java
示例11: removeOutlierSelect
import org.deckfour.xes.model.XTrace; //导入依赖的package包/类
private void removeOutlierSelect(XTrace t, XTrace newT, int i) {
XEvent before = t.get(i - 1);
XEvent guilty = t.get(i);
XEvent after = t.get(i + 1);
String nameBefore = getEventName(before);
String nameGuilty = getEventName(guilty);
String nameAfter = getEventName(after);
OutlierIdentifier outlierIdentifier = outlierIdentifierGenerator.generate(nameBefore, nameAfter);
Set<Outlier<String>> set = mapOutliers.getOutliers(outlierIdentifier);
Outlier<String> outlier = new Outlier<String>(nameGuilty, outlierIdentifier, false);
if (set == null || !set.contains(outlier)) {
newT.add((XEvent) t.get(i).clone());
}
}
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:18,代码来源:OutlierRemoverBridge.java
示例12: selectOulierToRemove
import org.deckfour.xes.model.XTrace; //导入依赖的package包/类
@Override
public void selectOulierToRemove(XLog log, int lookAHead, boolean selectOnlyOneOutlier, boolean smallestOrLargest) {
if(selectOnlyOneOutlier) {
boolean outlearsFound = false;
if(mapOutliers.size() > 0) {
outlearsFound = true;
}
if (outlearsFound) {
Map<Outlier<String>, Integer> removed = new UnifiedMap<Outlier<String>, Integer>();
for (XTrace t : log) {
if(t.size() > 0) {
for (int i = lookAHead; i < t.size(); i++) {
checkIfOutlier(removed, t, i, lookAHead, true);
}
}
}
select(removed, smallestOrLargest);
}
}
}
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:22,代码来源:OutlierRemoverNextAndPrevious.java
示例13: selectOulierToRemoveReverse
import org.deckfour.xes.model.XTrace; //导入依赖的package包/类
@Override
public void selectOulierToRemoveReverse(XLog log, int lookAHead, boolean selectOnlyOneOutlier, boolean smallestOrLargest) {
if(selectOnlyOneOutlier) {
boolean outlearsFound = false;
if(mapOutliers.size() > 0) {
outlearsFound = true;
}
if (outlearsFound) {
Map<Outlier<String>, Integer> removed = new UnifiedMap<Outlier<String>, Integer>();
for (XTrace t : log) {
if(t.size() > 0) {
for (int i = t.size() - lookAHead - 1; i >= 0; i--) {
checkIfOutlier(removed, t, i, lookAHead, false);
}
}
}
select(removed, smallestOrLargest);
}
}
}
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:22,代码来源:OutlierRemoverNextAndPrevious.java
示例14: checkIfOutlier
import org.deckfour.xes.model.XTrace; //导入依赖的package包/类
private void checkIfOutlier(Map<Outlier<String>, Integer> removed, XTrace t, int i, int lookAHead, boolean directOrReverse) {
XEvent current = directOrReverse?t.get((i - lookAHead)):t.get((i + lookAHead));
XEvent next = t.get(i);
String nameCurrent = getEventName(current);
String nameNext = getEventName(next);
OutlierIdentifier outlierIdentifier = outlierIdentifierGenerator.generate(nameCurrent);
Set<Outlier<String>> set = mapOutliers.getOutliers(outlierIdentifier);
Outlier<String> outlier = new Outlier<String>(nameNext, outlierIdentifier, false);
if (set != null && set.contains(outlier)) {
Integer val;
if ((val = removed.get(outlier)) == null) {
val = 0;
}
val++;
removed.put(outlier, val);
}
}
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:20,代码来源:OutlierRemoverNextAndPrevious.java
示例15: getStringOfXTraces
import org.deckfour.xes.model.XTrace; //导入依赖的package包/类
public static StringBuilder getStringOfXTraces(HashMap<String,XTrace> traces){
Iterator<Entry<String, XTrace>> trit = traces.entrySet().iterator();
StringBuilder info = new StringBuilder("");
while(trit.hasNext()){
Entry<String, XTrace> xte = trit.next();
XTrace xt = xte.getValue();
info.append(LEConstants.LOGGER_LINE+"\n");
info.append("XTrace URI: \t"+xte.getKey()+"\n");
//handling trace's attributes
XAttributeMap xattmap = xt.getAttributes();
info.append(getStringOfXAttributeMap("\t", xattmap));
//END OF handling trace's attributes
//iterate over trace's events
for(int ii = 0; ii < xt.size(); ii++){
XEvent xe = xt.get(ii);
info.append("\t"+LEConstants.LOGGER_LINE+"\n");
info.append("\tXEvent: "+xe.toString()+"\n");
//handling event's attributes
info.append(getStringOfXAttributeMap("\t\t",xe.getAttributes()));
}
//END OF iterate over trace's events
}
return info;
}
开发者ID:onprom,项目名称:onprom,代码行数:32,代码来源:Print.java
示例16: main
import org.deckfour.xes.model.XTrace; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
XLog log = LogImporter.importFromFile(new XFactoryNaiveImpl(), "/Volumes/Data/SharedFolder/Logs/BPI2012.xes.gz");
LogModifier logModifier = new LogModifier(new XFactoryNaiveImpl(), XConceptExtension.instance(), XTimeExtension.instance(), new LogOptimizer());
log = logModifier.insertArtificialStartAndEndEvent(log);
XEventClassifier classifier = new XEventNameClassifier();
AutomatonFactory automatonFactory = new AutomatonFactory(classifier);
boolean removed = true;
while (removed) {
removed = false;
Automaton<String> automaton = automatonFactory.generate(log);
WrapperLabelFilter wrapperLabelFilter = new WrapperLabelFilter(automaton, log);
Set<Node<String>> nodes = wrapperLabelFilter.identifyRemovableNodes(new Gurobi_Solver());
for (XTrace trace : log) {
Iterator<XEvent> iterator = trace.iterator();
while (iterator.hasNext()) {
XEvent event = iterator.next();
String name = classifier.getClassIdentity(event);
for (Node<String> node : nodes) {
if (node.getData().equals(name)) {
iterator.remove();
removed = true;
break;
}
}
}
}
}
log = logModifier.removeArtificialStartAndEndEvent(log);
LogImporter.exportToFile("/Volumes/Data/SharedFolder/Logs/BPI2012 (SimpleFiltered)2.xes.gz", log);
}
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:37,代码来源:WrapperLabelFilter.java
示例17: convertXTraceToString
import org.deckfour.xes.model.XTrace; //导入依赖的package包/类
public static String convertXTraceToString(XTrace trace, Map<String, String> nameMap, NameExtractor nameExtractor) {
List<String> labels = new ArrayList<>(trace.size());
for (int i = 0; i < trace.size(); i++) {
labels.add(nameMap.get(nameExtractor.getEventName(trace.get(i))));
}
return listToString(labels);
}
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:8,代码来源:TraceToString.java
示例18: detectUniqueTraces
import org.deckfour.xes.model.XTrace; //导入依赖的package包/类
private Map<String, List<XTrace>> detectUniqueTraces(XLog log) {
Map<String, List<XTrace>> uniqueTraces = new UnifiedMap<>();
for(XTrace trace : log) {
String s = TraceToString.convertXTraceToString(trace, nameExtractor);
List<XTrace> list;
if ((list = uniqueTraces.get(s)) == null) {
list = new ArrayList<>();
uniqueTraces.put(s, list);
}
list.add(trace);
}
return uniqueTraces;
}
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:14,代码来源:TimeStampNoiseGenerator.java
示例19: containsSameTimestamps
import org.deckfour.xes.model.XTrace; //导入依赖的package包/类
public boolean containsSameTimestamps(XTrace trace) {
Set<String> times = new UnifiedSet<>();
for(XEvent event : trace) {
String time = dateFormatSeconds.format(xte.extractTimestamp(event));
if(times.contains(time)) {
return true;
}else times.add(time);
}
return false;
}
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:14,代码来源:TimeStampChecker.java
示例20: buildOutliers
import org.deckfour.xes.model.XTrace; //导入依赖的package包/类
@Override
public OutlierMap<String> buildOutliers(XLog log, int lookAHead, boolean smart) {
for (XTrace trace : log) {
for (int i = 0; i < trace.size() - 2; i++) {
XEvent event1 = trace.get(i);
XEvent event2 = trace.get(i + 1);
XEvent event3 = trace.get(i + 2);
build(event1, event2, event3, smart);
}
}
return map;
}
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:14,代码来源:OutlierMapBuilderBridge.java
注:本文中的org.deckfour.xes.model.XTrace类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论