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;
}
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;
}
Aggregations