本文整理汇总了Java中org.deckfour.xes.model.XLog.size方法的典型用法代码示例。如果您正苦于以下问题:Java XLog.size方法的具体用法?Java XLog.size怎么用?Java XLog.size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.deckfour.xes.model.XLog
的用法示例。
在下文中一共展示了XLog.size方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: codeLog
import org.deckfour.xes.model.XLog; //导入方法依赖的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;
}
示例2: fixDate
import org.deckfour.xes.model.XLog; //导入方法依赖的package包/类
public XLog fixDate() {
LogCloner logCloner = new LogCloner();
XLog result = logCloner.cloneLog(log);
for(int tracePos = 0; tracePos < result.size(); tracePos++) {
XTrace trace = result.get(tracePos);
for(int eventPos = 0; eventPos < trace.size(); eventPos++) {
XEvent event = trace.get(eventPos);
if(xte.extractTimestamp(event) == null) {
Date date1;
if(eventPos > 0) {
date1 = xte.extractTimestamp(trace.get(eventPos - 1));
if (date1 == null) {
date1 = fixDate(trace, eventPos - 1, eventPos - 2, eventPos);
}
}else {
date1 = new Date(0);
}
Date date2;
if(eventPos < trace.size() - 1) {
date2 = xte.extractTimestamp(trace.get(eventPos + 1));
if (date2 == null) {
date2 = fixDate(trace, eventPos + 1, eventPos, eventPos + 2);
}
}else {
date2 = new Date(Long.MAX_VALUE);
}
Date date3 = new Date((date2.getTime() + date1.getTime())/ 2);
xte.assignTimestamp(event, date3);
}
}
}
return result;
}
示例3: filterLog
import org.deckfour.xes.model.XLog; //导入方法依赖的package包/类
public XLog filterLog(XLog log, int limitExtensive, int approach) {
XFactory factory = new XFactoryNaiveImpl();//XFactoryMemoryImpl();
LogCloner logCloner = new LogCloner(factory);
XLog res = logCloner.cloneLog(log);
LogOptimizer logOptimizer = new LogOptimizer();
LogModifier logModifier = new LogModifier(factory, XConceptExtension.instance(), XTimeExtension.instance(), logOptimizer);
int[] fix = new int[] {0};
res = logModifier.sortLog(res);
XLog optimizedLog = logOptimizer.optimizeLog(res);
optimizedLog = logModifier.insertArtificialStartAndEndEvent(optimizedLog);
System.out.println("Permutations discovery started");
TimeStampFixer timeStampFixerSmart = new TimeStampFixerSmart(factory, logCloner, optimizedLog, xEventClassifier, dateFormatSeconds, limitExtensive, approach, useGurobi, useArcsFrequency, debug_mode);
XLog permutedLog = timeStampFixerSmart.obtainPermutedLog();
// permutedLog = logModifier.insertArtificialStartAndEndEvent(permutedLog);
System.out.println("Permutations discovery ended");
System.out.println(timeStampFixerSmart.getDuplicatedTraces());
Automaton<String> automaton = automatonFactory.generateForTimeFilter(permutedLog, timeStampFixerSmart.getDuplicatedEvents());
// InfrequentBehaviourFilter infrequentBehaviourFilter = new InfrequentBehaviourFilter(xEventClassifier);
// double[] arcs = infrequentBehaviourFilter.discoverArcs(automaton, 1.0);
// AutomatonInfrequentBehaviourDetector automatonInfrequentBehaviourDetector = new AutomatonInfrequentBehaviourDetector(AutomatonInfrequentBehaviourDetector.MAX);
// Automaton<String> automatonClean = automatonInfrequentBehaviourDetector.removeInfrequentBehaviour(automaton, automaton.getNodes(), infrequentBehaviourFilter.discoverThreshold(arcs, 0.125), useGurobi, useArcsFrequency);
System.out.println();
System.out.println("Selection best permutation started");
AutomatonBestTraceMatchSelector automatonBestTraceMatchSelector = new AutomatonBestTraceMatchSelector(permutedLog, xEventClassifier, automaton, timeStampFixerSmart.getDuplicatedTraces(), timeStampFixerSmart.getPossibleTraces(), timeStampFixerSmart.getFaultyEvents(), log.size());
// AutomatonBestTraceMatchSelector automatonBestTraceMatchSelector = new AutomatonBestTraceMatchSelector(permutedLog, xEventClassifier, automatonClean, timeStampFixerSmart.getDuplicatedTraces(), timeStampFixerSmart.getPossibleTraces(), timeStampFixerSmart.getFaultyEvents(), log.size());
List<String> fixedTraces = new ArrayList<String>();
res = automatonBestTraceMatchSelector.selectBestMatchingTraces(new FakePluginContext(), fix, fixedTraces, approach);
res = logModifier.removeArtificialStartAndEndEvent(res);
System.out.println("Selection best permutation completed");
System.out.println();
System.out.println("Timestamps disambiguation started");
TimestampsAssigner timestampsAssigner = new TimestampsAssigner(res, xEventClassifier, dateFormatSeconds, timeStampFixerSmart.getDuplicatedTraces(), timeStampFixerSmart.getDuplicatedEvents(), useGurobi, useArcsFrequency, debug_mode);
boolean result = timestampsAssigner.assignTimestamps(fixedTraces);
if(!result) {
timestampsAssigner.assignTimestamps();
}
res = logModifier.sortLog(res);
System.out.println("Timestamps disambiguation completed");
return res;
}
示例4: insertNoiseTotalTracesEvents
import org.deckfour.xes.model.XLog; //导入方法依赖的package包/类
public XLog insertNoiseTotalTracesEvents(XLog rawlog, double percentageTraces, double percentageEvents) {
LogCloner logCloner = new LogCloner();
XLog log = logCloner.cloneLog(rawlog);
Random r = new Random(123456789);
double[] changedTraces = new double[] {0.0};
double[] changedEvents = new double[] {0.0};
int events = 0;
for(XTrace t : log) {
events += t.size();
}
while(changedTraces[0] / log.size() < percentageTraces || changedEvents[0] / events < percentageEvents) {
System.out.println("%Traces " + changedTraces[0] / log.size());
System.out.println("%Events " + changedEvents[0] / events);
int pos = r.nextInt(log.size());
XTrace trace = log.get(pos);
if(changedTraces[0] / log.size() < percentageTraces) {
if (trace.getAttributes().get("change") == null) {
insertNoise(trace, r, changedEvents, changedTraces);
}
}else {
if(percentageTraces > 0) {
while (trace.getAttributes().get("change") == null) {
pos = r.nextInt(log.size());
trace = log.get(pos);
}
}else {
while (trace.getAttributes().get("change") != null) {
pos = r.nextInt(log.size());
trace = log.get(pos);
}
}
insertNoise(trace, r, changedEvents, changedTraces);
}
}
return log;
}
示例5: filterLog
import org.deckfour.xes.model.XLog; //导入方法依赖的package包/类
public XLog filterLog(XLog log) {
LogCloner logCloner = new LogCloner();
XLog res = logCloner.cloneLog(log);
LogOptimizer logOptimizer = new LogOptimizer();
LogModifier logModifier = new LogModifier(new XFactoryMemoryImpl(), XConceptExtension.instance(), XTimeExtension.instance(), logOptimizer);
int[] fix = new int[] {1};
boolean doneOnce = false;
int count = 0;
// while(fix[0] > 0 && count < res.size() / 4) {
count++;
fix[0] = 0;
res = logModifier.sortLog(res);
XLog optimizedLog = logOptimizer.optimizeLog(res);
System.out.println("Start permutations");
TimeStampFixer timeStampFixerDummy = new TimeStampFixerDummy(new XFactoryNaiveImpl(), logCloner, optimizedLog, xEventClassifier, dateFormatSeconds, 0, 0, useGurobi, useArcsFrequency);
XLog permutedLog = timeStampFixerDummy.obtainPermutedLog();
permutedLog = logModifier.insertArtificialStartAndEndEvent(permutedLog);
System.out.println("Permutations ended");
// try {
// LogImporter.exportToFile("", "PermutedDummyLog" + count + ".xes.gz", permutedLog);
// } catch (Exception e) {
// e.printStackTrace();
// }
System.out.println(timeStampFixerDummy.getDuplicatedTraces());
Automaton<String> automaton = automatonFactory.generateForTimeFilter(permutedLog, timeStampFixerDummy.getDuplicatedEvents());
System.out.println("Start filtering");
AutomatonBestTraceMatchSelector automatonBestTraceMatchSelector = new AutomatonBestTraceMatchSelector(permutedLog, xEventClassifier, automaton, timeStampFixerDummy.getDuplicatedTraces(), timeStampFixerDummy.getPossibleTraces(), timeStampFixerDummy.getFaultyEvents(), log.size());
List<String> fixedTraces = new ArrayList<String>();
res = automatonBestTraceMatchSelector.selectBestMatchingTraces(new FakePluginContext(), fix, fixedTraces, 0);
res = logModifier.removeArtificialStartAndEndEvent(res);
res = logModifier.sortLog(res);
TimestampsAssigner timestampsAssigner = new TimestampsAssigner(res, xEventClassifier, dateFormatSeconds, timeStampFixerDummy.getDuplicatedTraces(), timeStampFixerDummy.getDuplicatedEvents(), useGurobi, useArcsFrequency, false);
boolean result = timestampsAssigner.assignTimestampsDummy(fixedTraces);
System.out.println();
if(!result) {
fix[0] = 0;
}
if(fix[0] > 0) {
System.out.println(fix[0]);
doneOnce = false;
}
if(fix[0] == 0 && !doneOnce) {
timestampsAssigner.assignTimestampsDummy();
fix[0] = 1;
doneOnce = true;
}
// }
System.out.println("Filtering completed");
return res;
}
示例6: filterLog
import org.deckfour.xes.model.XLog; //导入方法依赖的package包/类
public XLog filterLog(XLog log) {
LogCloner logCloner = new LogCloner();
XLog res = logCloner.cloneLog(log);
LogOptimizer logOptimizer = new LogOptimizer();
LogModifier logModifier = new LogModifier(new XFactoryMemoryImpl(), XConceptExtension.instance(), XTimeExtension.instance(), logOptimizer);
int[] fix = new int[] {1};
boolean doneOnce = false;
int count = 0;
// while(fix[0] > 0 && count < res.size() / 4) {
count++;
fix[0] = 0;
res = logModifier.sortLog(res);
XLog optimizedLog = logOptimizer.optimizeLog(res);
System.out.println("Start permutations");
TimeStampFixer timeStampFixerRandom = new TimeStampFixerRandom(new XFactoryNaiveImpl(), logCloner, optimizedLog, xEventClassifier, dateFormatSeconds, 0, 0, useGurobi, useArcsFrequency);
XLog permutedLog = timeStampFixerRandom.obtainPermutedLog();
permutedLog = logModifier.insertArtificialStartAndEndEvent(permutedLog);
System.out.println("Permutations ended");
// try {
// LogImporter.exportToFile("", "PermutedDummyLog" + count + ".xes.gz", permutedLog);
// } catch (Exception e) {
// e.printStackTrace();
// }
System.out.println(timeStampFixerRandom.getDuplicatedTraces());
Automaton<String> automaton = automatonFactory.generateForTimeFilter(permutedLog, timeStampFixerRandom.getDuplicatedEvents());
System.out.println("Start filtering");
AutomatonBestTraceMatchSelector automatonBestTraceMatchSelector = new AutomatonBestTraceMatchSelector(permutedLog, xEventClassifier, automaton, timeStampFixerRandom.getDuplicatedTraces(), timeStampFixerRandom.getPossibleTraces(), timeStampFixerRandom.getFaultyEvents(), log.size());
List<String> fixedTraces = new ArrayList<String>();
res = automatonBestTraceMatchSelector.selectBestMatchingTraces(new FakePluginContext(), fix, fixedTraces, 0);
res = logModifier.removeArtificialStartAndEndEvent(res);
res = logModifier.sortLog(res);
TimestampsAssigner timestampsAssigner = new TimestampsAssigner(res, xEventClassifier, dateFormatSeconds, timeStampFixerRandom.getDuplicatedTraces(), timeStampFixerRandom.getDuplicatedEvents(), useGurobi, useArcsFrequency, false);
boolean result = timestampsAssigner.assignTimestampsDummy(fixedTraces);
System.out.println();
if(!result) {
fix[0] = 0;
}
if(fix[0] > 0) {
System.out.println(fix[0]);
doneOnce = false;
}
if(fix[0] == 0 && !doneOnce) {
timestampsAssigner.assignTimestampsDummy();
fix[0] = 1;
doneOnce = true;
}
// }
System.out.println("Filtering completed");
return res;
}
示例7: minePetrinet
import org.deckfour.xes.model.XLog; //导入方法依赖的package包/类
@Override
public PetrinetWithMarking minePetrinet(UIPluginContext context, XLog log, boolean structure, MiningSettings params, XEventClassifier xEventClassifier) {
LogPreprocessing logPreprocessing = new LogPreprocessing();
log = logPreprocessing.preprocessLog(context, log);
System.setOut(new PrintStream(new OutputStream() {
@Override
public void write(int b) throws IOException {}
}));
if(minerSettings == null) {
minerSettings = new MinerSettings();
minerSettings.classifier = xEventClassifier;
double nom = (double) log.size() / ((double) log.size() + (double) minerSettings.dependencyDivisor);
if (nom <= 0.0D) {
nom = 0.0D;
}
if (nom >= 0.9D) {
nom = 0.9D;
}
minerSettings.dependencyThreshold = nom;
minerSettings.l1lThreshold = nom;
minerSettings.l2lThreshold = nom;
FullParameterPanel parameters = new FullParameterPanel(minerSettings);
context.showConfiguration("Miner Parameters", parameters);
minerSettings = parameters.getSettings();
}
Object[] bpmnResults = FodinaMinerPlugin.runMiner(context, log, minerSettings);
CausalNet net = (CausalNet) bpmnResults[0];
Object[] result = CausalNetToPetrinet.convert(context, net);
logPreprocessing.removedAddedElements((Petrinet) result[0]);
boolean includeLifeCycle = true;
if(xEventClassifier instanceof XEventNameClassifier) includeLifeCycle = false;
if(!includeLifeCycle) logPreprocessing.removedLifecycleFromName((Petrinet) result[0]);
MarkingDiscoverer.createInitialMarkingConnection(context, (Petrinet) result[0], (Marking) result[1]);
System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out)));
return new PetrinetWithMarking((Petrinet) result[0], (Marking) result[1], MarkingDiscoverer.constructFinalMarking(context, (Petrinet) result[0]));
}
示例8: countTraces
import org.deckfour.xes.model.XLog; //导入方法依赖的package包/类
public static int countTraces(XLog log) {
return log.size();
}