use of org.iobserve.analysis.data.UserSessionCollectionModel in project iobserve-analysis by research-iobserve.
the class UserSessionModelAggregator method execute.
@Override
protected void execute() throws Exception {
final UserSession newUserSession = this.userSessionInputPort.receive();
if (newUserSession != null) {
this.userSessions.add(newUserSession);
}
final Long timeTrigger = this.timeTriggerInputPort.receive();
if (timeTrigger != null) {
// or stream of sessions.
for (int i = 0; i < this.userSessions.size(); i++) {
final UserSession userSession = this.userSessions.get(i);
if (userSession != null) {
final Long entryTime = userSession.getEntryTime();
final Long lowerBoundary = timeTrigger - UserSessionModelAggregator.SLIDING_WINDOW;
if (entryTime < lowerBoundary) {
this.userSessions.remove(i);
}
}
}
final UserSessionCollectionModel model = new UserSessionCollectionModel(this.userSessions);
this.outputPort.send(model);
}
}
use of org.iobserve.analysis.data.UserSessionCollectionModel 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");
}
}
use of org.iobserve.analysis.data.UserSessionCollectionModel in project iobserve-analysis by research-iobserve.
the class CollectUserSessionsFilter method execute.
@Override
protected void execute() throws Exception {
final UserSession userSession = this.userSessionInputPort.receive();
if (userSession != null) {
CollectUserSessionsFilter.LOGGER.debug("Received model...");
this.userSessions.add(userSession);
}
final Long triggerTime = this.timeTriggerInputPort.receive();
if (triggerTime != null) {
/**
* collect all sessions.
*/
final UserSessionCollectionModel model = new UserSessionCollectionModel(this.userSessions);
/**
* remove expired sessions.
*/
if (this.userSessions.size() > this.minCollectionSize) {
for (int i = 0; this.userSessions.size() > i; i++) {
if (this.userSessions.get(i).getExitTime() + this.keepTime < triggerTime) {
this.userSessions.remove(i);
}
}
}
CollectUserSessionsFilter.LOGGER.debug("Sending model...");
this.outputPort.send(model);
}
}
use of org.iobserve.analysis.data.UserSessionCollectionModel in project iobserve-analysis by research-iobserve.
the class SessionOperationCleanupFilter method execute.
@Override
protected void execute(final UserSessionCollectionModel entryCallSequenceModel) throws Exception {
final List<UserSession> sessions = entryCallSequenceModel.getUserSessions().stream().map(this::filterSession).collect(Collectors.toList());
final UserSessionCollectionModel filteredEntryCallSequenceModel = new UserSessionCollectionModel(sessions);
this.outputPort.send(filteredEntryCallSequenceModel);
}
use of org.iobserve.analysis.data.UserSessionCollectionModel in project iobserve-analysis by research-iobserve.
the class BranchExtraction method createCallBranchModels.
/**
* Create a call branch model.
*/
public void createCallBranchModels() {
final BranchModelCreator modelCreator = new BranchModelCreator();
this.branchModels = new ArrayList<>();
for (final UserSessionCollectionModel entryCallSequenceModel : this.entryCallSequenceModels) {
/**
* 1. Aggregates the single EntryCall sequences to a BranchModel
*/
final BranchModel branchModel = modelCreator.createCallBranchModel(entryCallSequenceModel);
/**
* 2. Calculates the likelihoods of the branches of the obtained BranchModel
*/
modelCreator.calculateLikelihoodsOfBranches(branchModel);
/**
* 3. Tries to fuse branches to obtain a more compact model
*/
modelCreator.compactBranchModel(branchModel);
this.branchModels.add(branchModel);
}
}
Aggregations