當前位置: 首頁>>代碼示例>>Java>>正文


Java XesXmlParser類代碼示例

本文整理匯總了Java中org.deckfour.xes.in.XesXmlParser的典型用法代碼示例。如果您正苦於以下問題:Java XesXmlParser類的具體用法?Java XesXmlParser怎麽用?Java XesXmlParser使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


XesXmlParser類屬於org.deckfour.xes.in包,在下文中一共展示了XesXmlParser類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: main

import org.deckfour.xes.in.XesXmlParser; //導入依賴的package包/類
public static void main(String[] args) throws Exception {
	if (args.length < 3) {
		System.err.println("Usage: java " + RandomLogPicker.class.getName() + " <xes-file-in> <number-of-traces> <xes-file-out>");
	}

	File xesFileIn = new File(args[0]);
	int numberOfTraces = Integer.valueOf(args[1]);
	File xesFileOut = new File(args[2]);
	
	XesXmlParser parser = new XesXmlParser();
       if (!parser.canParse(xesFileIn)) {
       	parser = new XesXmlGZIPParser();
       	if (!parser.canParse(xesFileIn)) {
       		throw new IllegalArgumentException("Unparsable log file: " + xesFileIn.getAbsolutePath());
       	}
       }
       List<XLog> xLogs = parser.parse(xesFileIn);
       XLog xLog = xLogs.remove(0);
       while (xLogs.size() > 0) {
       	xLog.addAll(xLogs.remove(0));
       }
       
       int remainingTraces = xLog.size();
       while (remainingTraces > numberOfTraces && remainingTraces > 0) {
       	Math.floor(Math.random() * remainingTraces);
       	xLog.remove((int) Math.floor(Math.random() * remainingTraces));
       	remainingTraces--;
       }
       
       OutputStream outStream = new FileOutputStream(xesFileOut);
	new XesXmlGZIPSerializer().serialize(xLog, outStream);
}
 
開發者ID:cdc08x,項目名稱:MINERful,代碼行數:33,代碼來源:RandomLogPicker.java

示例2: XesLogParser

import org.deckfour.xes.in.XesXmlParser; //導入依賴的package包/類
protected XesLogParser(TaskCharEncoderDecoder taChaEncoDeco,
		TaskCharArchive taskCharArchive, List<LogTraceParser> traceParsers,
		XesXmlParser parser, XesEventClassifier xesEventClassifier, List<XLog> xLogs) {
	super(taChaEncoDeco, taskCharArchive, traceParsers);
	this.parser = parser;
	this.xesEventClassifier = xesEventClassifier;
	this.xLogs = xLogs;
}
 
開發者ID:cdc08x,項目名稱:MINERful,代碼行數:9,代碼來源:XesLogParser.java

示例3: XesDecoder

import org.deckfour.xes.in.XesXmlParser; //導入依賴的package包/類
public XesDecoder(File xesFile) throws Exception {
       if (logger == null) {
           logger = Logger.getLogger(this.getClass().getCanonicalName());
       }

       parser = new XesXmlParser();
       if (!parser.canParse(xesFile)) {
       	parser = new XesXmlGZIPParser();
       	if (!parser.canParse(xesFile)) {
       		throw new IllegalArgumentException("Unparsable log file: " + xesFile.getAbsolutePath());
       	}
       }
	this.xesFile = xesFile;
}
 
開發者ID:cdc08x,項目名稱:MINERful,代碼行數:15,代碼來源:XesDecoder.java

示例4: main

import org.deckfour.xes.in.XesXmlParser; //導入依賴的package包/類
public static void main(String[] args) throws Exception {

		// Define timer task
		TimerTask addMemoryUsageTask = new TimerTask() {
			Runtime runtime = Runtime.getRuntime();

			@Override
			public void run() {
				memoryUsages.add((int) ((runtime.totalMemory() - runtime.freeMemory()) / MB));
			}
		};

		// Define timer thread
		Thread t = new Thread(new Runnable() {
			@Override
			public void run() {
				while (true) {
					try {
						if (stop) {
							timer.cancel();
							break;
						}
						Thread.sleep(TIMER_INTERVAL);
					} catch (InterruptedException ex) {
						throw new RuntimeException(ex);
					}
				}
			}
		});

		// Create and configure timer
		timer = new Timer("GetUsedMemoryTimer");
		timer.scheduleAtFixedRate(addMemoryUsageTask, 0, TIMER_INTERVAL);

		t.start();
		long startTime = System.currentTimeMillis();

		// Parse XES document
		TraceWiseXesIterator traceParser = new TraceWiseXesIterator(PATH_5, TRACES_PER_ITERATION);

//		List<List<XLog>> parsedDocument = new Vector<List<XLog>>();
		XExtensionManager.instance().register(DataUsageExtension.instance());
		XesXmlParser parser = new XesXmlParser();
		
		while (traceParser.hasNext()) {
//			parsedDocument.add(parser.parse(traceParser.next()));
			parser.parse(traceParser.next());
		}

		stop = true;
		long duration = System.currentTimeMillis() - startTime;
		System.out.println("Duration: " + duration);

//		printLogStatistics(parsedDocument);

		System.out.println(memoryUsages);
	}
 
開發者ID:iig-uni-freiburg,項目名稱:SEWOL,代碼行數:58,代碼來源:TraceWiseXesIteratorMemoryMonitoring.java

示例5: init

import org.deckfour.xes.in.XesXmlParser; //導入依賴的package包/類
private void init(LogEventClassifier.ClassificationType evtClassType) {
    this.traceParsers = new ArrayList<LogTraceParser>();
    this.taChaEncoDeco = new TaskCharEncoderDecoder();
    this.parser = new XesXmlParser();
    this.xesEventClassifier = new XesEventClassifier(evtClassType);
}
 
開發者ID:cdc08x,項目名稱:MINERful,代碼行數:7,代碼來源:XesLogParser.java


注:本文中的org.deckfour.xes.in.XesXmlParser類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。