Search in sources :

Example 1 with ResourceContainerReplicationDegree

use of de.uka.ipd.sdq.pcm.designdecision.specific.ResourceContainerReplicationDegree in project iobserve-analysis by research-iobserve.

the class DesignDecisionModelFactory method createReplicationDegree.

/**
 * Creates a new resource container replication degree.
 *
 * The degree's name is set to the given name and the number of replicas is bounded by the to
 * and from number of replicas parameters. Both bounds are included and all steps in between as
 * well.
 *
 * @param decisionSpace
 *            the decision space in which to create the replication degree
 * @param name
 *            the name of this replication degree
 * @param replicatedContainer
 *            the container that is to be replicated
 * @param fromNrOfReplicas
 *            the lower bound on the number of replicas
 * @param toNrOfReplicas
 *            the upper bound on the number of replicas
 * @return the new replication degree
 */
public static ResourceContainerReplicationDegree createReplicationDegree(final DecisionSpace decisionSpace, final String name, final ResourceContainer replicatedContainer, final int fromNrOfReplicas, final int toNrOfReplicas) {
    final ResourceContainerReplicationDegree degree = specificFactory.eINSTANCE.createResourceContainerReplicationDegree();
    degree.setEntityName(name);
    degree.setFrom(fromNrOfReplicas);
    degree.setTo(toNrOfReplicas);
    degree.setLowerBoundIncluded(true);
    degree.setUpperBoundIncluded(true);
    degree.setNumberOfSteps(0);
    degree.setPrimaryChanged(replicatedContainer);
    decisionSpace.getDegreesOfFreedom().add(degree);
    return degree;
}
Also used : ResourceContainerReplicationDegree(de.uka.ipd.sdq.pcm.designdecision.specific.ResourceContainerReplicationDegree)

Aggregations

ResourceContainerReplicationDegree (de.uka.ipd.sdq.pcm.designdecision.specific.ResourceContainerReplicationDegree)1