Search in sources :

Example 1 with BehaviorModelTable

use of org.iobserve.analysis.behavior.models.data.BehaviorModelTable in project iobserve-analysis by research-iobserve.

the class BehaviorModelPreparation method executeEntryCallSequenceModel.

/**
 * Execute case object instanceof EntryCallSequenceModel.
 *
 * @param userSessionCollectionModel
 *            entryCallSequenceModel
 */
private void executeEntryCallSequenceModel(final UserSessionCollectionModel userSessionCollectionModel) {
    if (this.behaviorModelTable == null) {
        this.sequenceModelCache.add(userSessionCollectionModel);
    } else {
        final List<UserSession> userSessions = userSessionCollectionModel.getUserSessions();
        BehaviorModelPreparation.LOGGER.debug("Executing {}", userSessionCollectionModel.getClass());
        BehaviorModelPreparation.LOGGER.debug("userSessions: {}", userSessions.size());
        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.behavior.models.data.BehaviorModelTable) EntryCallEvent(org.iobserve.stages.general.data.EntryCallEvent) UserSession(org.iobserve.analysis.session.data.UserSession)

Example 2 with BehaviorModelTable

use of org.iobserve.analysis.behavior.models.data.BehaviorModelTable in project iobserve-analysis by research-iobserve.

the class BehaviorModelTableGenerationStage 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.behavior.models.data.BehaviorModelTable) DynamicBehaviorModelTable(org.iobserve.analysis.behavior.models.data.DynamicBehaviorModelTable)

Example 3 with BehaviorModelTable

use of org.iobserve.analysis.behavior.models.data.BehaviorModelTable in project iobserve-analysis by research-iobserve.

the class BehaviorModelPreparation method execute.

@Override
protected void execute(final Object object) {
    if (object instanceof UserSessionCollectionModel) {
        final UserSessionCollectionModel entryCallSequenceModel = (UserSessionCollectionModel) object;
        this.executeEntryCallSequenceModel(entryCallSequenceModel);
    } else if (object instanceof BehaviorModelTable) {
        final BehaviorModelTable modelTable = (BehaviorModelTable) object;
        this.executeBehaviorModelTable(modelTable);
    } else {
        BehaviorModelPreparation.LOGGER.error("input is nether of type EntryCallSequenceModel nor BehaviorModelTable");
    }
}
Also used : UserSessionCollectionModel(org.iobserve.analysis.data.UserSessionCollectionModel) BehaviorModelTable(org.iobserve.analysis.behavior.models.data.BehaviorModelTable)

Aggregations

BehaviorModelTable (org.iobserve.analysis.behavior.models.data.BehaviorModelTable)3 DynamicBehaviorModelTable (org.iobserve.analysis.behavior.models.data.DynamicBehaviorModelTable)1 UserSessionCollectionModel (org.iobserve.analysis.data.UserSessionCollectionModel)1 UserSession (org.iobserve.analysis.session.data.UserSession)1 EntryCallEvent (org.iobserve.stages.general.data.EntryCallEvent)1