当前位置: 首页>>代码示例>>Java>>正文


Java XLog.size方法代码示例

本文整理汇总了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;
}
 
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:21,代码来源:LabelFilter.java

示例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;
}
 
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:37,代码来源:NoiseGenerator.java

示例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;
    }
 
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:60,代码来源:TimeStampFixerSmartExecutor.java

示例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;
}
 
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:42,代码来源:TimeStampNoiseGenerator.java

示例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;
    }
 
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:70,代码来源:TimeStampFixerDummyExecutor.java

示例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;
    }
 
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:70,代码来源:TimeStampFixerRandomExecutor.java

示例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]));

}
 
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:47,代码来源:FodinaAlgorithmWrapper.java

示例8: countTraces

import org.deckfour.xes.model.XLog; //导入方法依赖的package包/类
public static int countTraces(XLog log) {
   return log.size();
}
 
开发者ID:raffaeleconforti,项目名称:ResearchCode,代码行数:4,代码来源:LogAnalyser.java


注:本文中的org.deckfour.xes.model.XLog.size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。