当前位置: 首页>>代码示例>>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;未经允许,请勿转载。