Search in sources :

Example 1 with BehaviorModelTable

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();
}
Also used : BehaviorModelTable(org.iobserve.analysis.clustering.filter.models.BehaviorModelTable) DynamicBehaviorModelTable(org.iobserve.analysis.clustering.filter.models.DynamicBehaviorModelTable)

Example 2 with BehaviorModelTable

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");
    }
}
Also used : BehaviorModelTable(org.iobserve.analysis.clustering.filter.models.BehaviorModelTable) EntryCallSequenceModel(org.iobserve.analysis.data.EntryCallSequenceModel)

Example 3 with 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);
        }
    }
}
Also used : BehaviorModelTable(org.iobserve.analysis.clustering.filter.models.BehaviorModelTable) EntryCallEvent(org.iobserve.stages.general.data.EntryCallEvent) UserSession(org.iobserve.analysis.session.data.UserSession)

Aggregations

BehaviorModelTable (org.iobserve.analysis.clustering.filter.models.BehaviorModelTable)3 DynamicBehaviorModelTable (org.iobserve.analysis.clustering.filter.models.DynamicBehaviorModelTable)1 EntryCallSequenceModel (org.iobserve.analysis.data.EntryCallSequenceModel)1 UserSession (org.iobserve.analysis.session.data.UserSession)1 EntryCallEvent (org.iobserve.stages.general.data.EntryCallEvent)1