use of org.iobserve.analysis.clustering.filter.models.BehaviorModelTable in project iobserve-analysis by research-iobserve.
the class TBehaviorModelTableGeneration method onTerminating.
@Override
public void onTerminating() {
final BehaviorModelTable fixedTable = this.modelTable.toClearedFixedSizeBehaviorModelTable(this.keepEmptyTransitions);
this.outputPort.send(fixedTable);
super.onTerminating();
}
use of org.iobserve.analysis.clustering.filter.models.BehaviorModelTable in project iobserve-analysis by research-iobserve.
the class TBehaviorModelPreperation method execute.
@Override
protected void execute(final Object object) {
if (object instanceof EntryCallSequenceModel) {
final EntryCallSequenceModel entryCallSequenceModel = (EntryCallSequenceModel) object;
this.executeEntryCallSequenceModel(entryCallSequenceModel);
} else if (object instanceof BehaviorModelTable) {
final BehaviorModelTable modelTable = (BehaviorModelTable) object;
this.executeBehaviorModelTable(modelTable);
} else {
TBehaviorModelPreperation.LOGGER.error("input is nether of type EntryCallSequenceModel nor BehaviorModelTable");
}
}
use of org.iobserve.analysis.clustering.filter.models.BehaviorModelTable in project iobserve-analysis by research-iobserve.
the class TBehaviorModelPreperation method executeEntryCallSequenceModel.
/**
* Execute case object instanceof EntryCallSequenceModel.
*
* @param entryCallSequenceModel
* entryCallSequenceModel
*/
private void executeEntryCallSequenceModel(final EntryCallSequenceModel entryCallSequenceModel) {
if (this.behaviorModelTable == null) {
this.sequenceModelCache.add(entryCallSequenceModel);
} else {
final List<UserSession> userSessions = entryCallSequenceModel.getUserSessions();
for (final UserSession userSession : userSessions) {
final BehaviorModelTable modelTable = this.behaviorModelTable.getClearedCopy(this.keepEmptyTransitions);
final List<EntryCallEvent> entryCalls = userSession.getEvents();
EntryCallEvent lastCall = null;
for (final EntryCallEvent eventCall : entryCalls) {
final boolean isAllowed = modelTable.isAllowedSignature(eventCall);
if (lastCall != null && isAllowed) {
modelTable.addTransition(lastCall, eventCall);
modelTable.addInformation(eventCall);
} else if (isAllowed) {
// only called at first valid event
// (condition lastCall == null is not needed
modelTable.addInformation(eventCall);
}
lastCall = isAllowed ? eventCall : lastCall;
}
this.outputPort.send(modelTable);
}
}
}
Aggregations