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


Java XAttributeBooleanImpl類代碼示例

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


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

示例1: check

import org.deckfour.xes.model.impl.XAttributeBooleanImpl; //導入依賴的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

示例2: dataElementToXAttribute

import org.deckfour.xes.model.impl.XAttributeBooleanImpl; //導入依賴的package包/類
/**
 * Returns an XAttribute of the provided type with the given key and value
 * 
 * @param dataType
 *            Type of the attribute to return
 * @param dataName
 *            Key of the attribute to return
 * @param dataValue
 *            Value of the attribute to return
 * @return XAttribute
 */
private XAttribute dataElementToXAttribute(DataElement.Type dataType,
		String dataName, String dataValue) {
	// First, test if we can find the given type
	if (dataType == DataElement.Type.BOOLEAN) {
		return new XAttributeBooleanImpl(dataName, Boolean
				.parseBoolean(dataValue));
	} else if (dataType == DataElement.Type.DOUBLE) {
		return new XAttributeContinuousImpl(dataName, Double
				.parseDouble(dataValue));
	} else if (dataType == DataElement.Type.INTEGER) {
		return new XAttributeDiscreteImpl(dataName, Long
				.parseLong(dataValue));
	}
	// We must have a default, literals/strings are a good candidate
	// But we must prevent empty strings
	if (dataValue.trim().length() == 0)
		dataValue = "UNDEFINED";
	return new XAttributeLiteralImpl(dataName, dataValue);
}
 
開發者ID:processmining,項目名稱:synthetic-log-generator,代碼行數:31,代碼來源:ModelLogWriter.java

示例3: insertNoise

import org.deckfour.xes.model.impl.XAttributeBooleanImpl; //導入依賴的package包/類
private boolean insertNoise(XTrace trace, final Random r, double[] changedEvents, double[] changedTraces) {
    int number = r.nextInt(trace.size() - 1);
    int start = r.nextInt((trace.size() - 1) - number);

    if (number > 0) {
        trace.getAttributes().put("change", new XAttributeBooleanImpl("change", true));
        Date date = null;

        if(number == 1) {
            if(nameExtractor.getEventName(trace.get(start)).equals(nameExtractor.getEventName(trace.get(start + 1)))) {
                return false;
            }
        }

        for (int i = 0; i < trace.size(); i++) {
            XEvent event = trace.get(i);
            if (i == start) {
                if(event.getAttributes().get("originalTimeStamp") == null) {
                    event.getAttributes().put("originalTimeStamp", new XAttributeTimestampImpl("originalTimeStamp", xte.extractTimestamp(event)));
                }

                date = xte.extractTimestamp(event);
                event.getAttributes().put("change", new XAttributeBooleanImpl("change", true));
                changedEvents[0]++;
            } else if (i > start && i <= start + number) {
                if(event.getAttributes().get("originalTimeStamp") == null) {
                    event.getAttributes().put("originalTimeStamp", new XAttributeTimestampImpl("originalTimeStamp", xte.extractTimestamp(event)));
                }

                xte.assignTimestamp(event, date);
                event.getAttributes().put("change", new XAttributeBooleanImpl("change", true));
                changedEvents[0]++;
            }
        }

        String oldTrace = TraceToString.convertXTraceToString(trace, nameExtractor);

        while(oldTrace.equals(TraceToString.convertXTraceToString(trace, nameExtractor))) {
            Collections.sort(trace, new Comparator<XEvent>() {
                Random random = r;

                @Override
                public int compare(XEvent o1, XEvent o2) {
                    Date date1 = xte.extractTimestamp(o1);
                    Date date2 = xte.extractTimestamp(o2);
                    if (!date1.equals(date2)) return date1.compareTo(date2);
                    else return random.nextInt(2) > 0 ? 1 : -1;
                }
            });
        }

        changedTraces[0]++;
        return true;
    }

    return false;
}
 
開發者ID:raffaeleconforti,項目名稱:ResearchCode,代碼行數:58,代碼來源:TimeStampNoiseGenerator.java

示例4: createAttributeBoolean

import org.deckfour.xes.model.impl.XAttributeBooleanImpl; //導入依賴的package包/類
public XAttributeBoolean createAttributeBoolean(String key, boolean value,
		XExtension extension) {
	return new XAttributeBooleanImpl(intern(key), value, extension);
}
 
開發者ID:iig-uni-freiburg,項目名稱:SEWOL,代碼行數:5,代碼來源:XFactoryNaiveImpl.java


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