Search in sources :

Example 11 with BranchTransition

use of org.palladiosimulator.pcm.usagemodel.BranchTransition in project iobserve-analysis by research-iobserve.

the class PcmUsageModelBuilder method createBranch.

/**
 * Creates for a branch a corresponding PCM branch including a corresponding usage scenario.
 *
 * @param scenarioBehaviour
 *            to that the PCM branch is added
 * @param branchElement
 *            that is transformed to a PCM branch element
 * @return a PCM branch element
 */
private org.palladiosimulator.pcm.usagemodel.Branch createBranch(final ScenarioBehaviour scenarioBehaviour, final BranchElement branchElement) {
    final org.palladiosimulator.pcm.usagemodel.Branch branchUM = UsageModelFactory.createBranch("", scenarioBehaviour);
    for (final BranchTransitionElement transition : branchElement.getBranchTransitions()) {
        final BranchTransition branchTransition = UsageModelFactory.createBranchTransition(branchUM);
        final ScenarioBehaviour branchScenarioBehaviour = this.transformSequenceToScenarioBehavior(0, transition.getBranchSequence(), null);
        branchTransition.setBranchedBehaviour_BranchTransition(branchScenarioBehaviour);
        branchTransition.setBranch_BranchTransition(branchUM);
        branchTransition.setBranchProbability(transition.getTransitionLikelihood());
    }
    return branchUM;
}
Also used : BranchTransitionElement(org.iobserve.analysis.userbehavior.data.BranchTransitionElement) ScenarioBehaviour(org.palladiosimulator.pcm.usagemodel.ScenarioBehaviour) BranchTransition(org.palladiosimulator.pcm.usagemodel.BranchTransition)

Example 12 with BranchTransition

use of org.palladiosimulator.pcm.usagemodel.BranchTransition in project iobserve-analysis by research-iobserve.

the class PcmUsageModelBuilder method createChildBranch.

/**
 * Creates a PCM branch corresponding to the child branches of the passed branch.
 *
 * @param scenarioBehaviour
 *            to that the PCM branch is added
 * @param indexOfScenario
 *            states the index of the scenario within the usage scenario
 * @param branch
 *            whose child branches are transformed to a PCM branch
 * @return a PCM branch
 */
private org.palladiosimulator.pcm.usagemodel.Branch createChildBranch(final ScenarioBehaviour scenarioBehaviour, final int indexOfScenario, final Branch branch) {
    if (branch.getChildBranches().size() > 0) {
        final org.palladiosimulator.pcm.usagemodel.Branch branchUM = UsageModelFactory.createBranch("", scenarioBehaviour);
        for (final Branch childBranch : branch.getChildBranches()) {
            final BranchTransition branchTransition = UsageModelFactory.createBranchTransition(branchUM);
            branchTransition.setBranchedBehaviour_BranchTransition(this.branchScenarioBehavioursOfUserGroups.get(indexOfScenario).get(childBranch.getBranchId()));
            branchTransition.setBranch_BranchTransition(branchUM);
            branchTransition.setBranchProbability(childBranch.getBranchLikelihood());
        }
        return branchUM;
    }
    return null;
}
Also used : Branch(org.iobserve.analysis.userbehavior.data.Branch) BranchTransition(org.palladiosimulator.pcm.usagemodel.BranchTransition)

Aggregations

BranchTransition (org.palladiosimulator.pcm.usagemodel.BranchTransition)12 ScenarioBehaviour (org.palladiosimulator.pcm.usagemodel.ScenarioBehaviour)9 EntryLevelSystemCall (org.palladiosimulator.pcm.usagemodel.EntryLevelSystemCall)8 AbstractUserAction (org.palladiosimulator.pcm.usagemodel.AbstractUserAction)6 Start (org.palladiosimulator.pcm.usagemodel.Start)6 Stop (org.palladiosimulator.pcm.usagemodel.Stop)6 Correspondent (org.iobserve.model.correspondence.Correspondent)5 Branch (org.palladiosimulator.pcm.usagemodel.Branch)4 Loop (org.palladiosimulator.pcm.usagemodel.Loop)4 UsageModel (org.palladiosimulator.pcm.usagemodel.UsageModel)4 UsageScenario (org.palladiosimulator.pcm.usagemodel.UsageScenario)4 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 List (java.util.List)2 EntryCallSequenceModel (org.iobserve.analysis.data.EntryCallSequenceModel)2 Branch (org.iobserve.analysis.userbehavior.data.Branch)2 PCMRandomVariable (org.palladiosimulator.pcm.core.PCMRandomVariable)2 Map (java.util.Map)1 Optional (java.util.Optional)1 SingleOrNoneCollector (org.iobserve.analysis.clustering.SingleOrNoneCollector)1