本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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);
}