Search in sources :

Example 26 with PCMRandomVariable

use of org.palladiosimulator.pcm.core.PCMRandomVariable in project iobserve-analysis by research-iobserve.

the class UsageModelFactory method createOpenWorkload.

/**
 * Create an {@link OpenWorkload} and add it to the given {@link UsageScenario}.
 *
 * @param avgInterarrivalTime
 *            the interarrival time
 * @param parent
 *            usage scenario the workload should be added to
 * @return brand new instance of {@link OpenWorkload}
 */
public static OpenWorkload createOpenWorkload(final long avgInterarrivalTime, final UsageScenario parent) {
    final OpenWorkload openWorkload = UsagemodelFactory.eINSTANCE.createOpenWorkload();
    parent.setWorkload_UsageScenario(openWorkload);
    // create variables
    final PCMRandomVariable pcmInterarrivalTime = CoreFactory.eINSTANCE.createPCMRandomVariable();
    pcmInterarrivalTime.setSpecification(String.valueOf(avgInterarrivalTime));
    pcmInterarrivalTime.setOpenWorkload_PCMRandomVariable(openWorkload);
    openWorkload.setInterArrivalTime_OpenWorkload(pcmInterarrivalTime);
    return openWorkload;
}
Also used : OpenWorkload(org.palladiosimulator.pcm.usagemodel.OpenWorkload) PCMRandomVariable(org.palladiosimulator.pcm.core.PCMRandomVariable)

Example 27 with PCMRandomVariable

use of org.palladiosimulator.pcm.core.PCMRandomVariable in project iobserve-analysis by research-iobserve.

the class UsageModelFactory method createClosedWorkload.

/**
 * Create an {@link OpenWorkload} and add it to the given {@link UsageScenario}.
 *
 * @param population
 *            population
 * @param thinkTime
 *            thinkTime
 * @param parent
 *            usage scenario the workload should be added to
 * @return created closed workload instance
 */
public static ClosedWorkload createClosedWorkload(final int population, final double thinkTime, final UsageScenario parent) {
    final ClosedWorkload closedWorkload = UsagemodelFactory.eINSTANCE.createClosedWorkload();
    parent.setWorkload_UsageScenario(closedWorkload);
    // create variables
    final PCMRandomVariable pcmThinkTime = CoreFactory.eINSTANCE.createPCMRandomVariable();
    pcmThinkTime.setSpecification(String.valueOf(thinkTime));
    pcmThinkTime.setClosedWorkload_PCMRandomVariable(closedWorkload);
    closedWorkload.setPopulation(population);
    closedWorkload.setThinkTime_ClosedWorkload(pcmThinkTime);
    return closedWorkload;
}
Also used : ClosedWorkload(org.palladiosimulator.pcm.usagemodel.ClosedWorkload) PCMRandomVariable(org.palladiosimulator.pcm.core.PCMRandomVariable)

Example 28 with PCMRandomVariable

use of org.palladiosimulator.pcm.core.PCMRandomVariable in project iobserve-analysis by research-iobserve.

the class ResourceEnvironmentCloudFactory method createLinkingResourceSpecification.

/**
 * Creates a communication link resource specification with the given properties.
 *
 * @param model
 *            resource environment model
 * @param throughput
 *            throughput of the link specification
 * @param failureProbability
 *            failure probability of the link specification
 * @param latency
 *            latency of the link specification
 * @return a communication link resource
 * @throws ModelHandlingErrorException
 *             when something when wrong with the model handling
 */
public static CommunicationLinkResourceSpecification createLinkingResourceSpecification(final ResourceEnvironment model, final double throughput, final double failureProbability, final double latency) throws ModelHandlingErrorException {
    final CommunicationLinkResourceSpecification spec = ResourceenvironmentFactory.eINSTANCE.createCommunicationLinkResourceSpecification();
    spec.setCommunicationLinkResourceType_CommunicationLinkResourceSpecification(IPalladioResourceRepository.INSTANCE.resources().lan());
    spec.setFailureProbability(failureProbability);
    final PCMRandomVariable throughputPCM = CoreFactory.eINSTANCE.createPCMRandomVariable();
    throughputPCM.setSpecification(Double.toString(throughput));
    spec.setThroughput_CommunicationLinkResourceSpecification(throughputPCM);
    final PCMRandomVariable latencyPCM = CoreFactory.eINSTANCE.createPCMRandomVariable();
    latencyPCM.setSpecification(Double.toString(latency));
    spec.setLatency_CommunicationLinkResourceSpecification(latencyPCM);
    return spec;
}
Also used : CommunicationLinkResourceSpecification(org.palladiosimulator.pcm.resourceenvironment.CommunicationLinkResourceSpecification) PCMRandomVariable(org.palladiosimulator.pcm.core.PCMRandomVariable)

Aggregations

PCMRandomVariable (org.palladiosimulator.pcm.core.PCMRandomVariable)28 ScenarioBehaviour (org.palladiosimulator.pcm.usagemodel.ScenarioBehaviour)15 Loop (org.palladiosimulator.pcm.usagemodel.Loop)14 UsageModel (org.palladiosimulator.pcm.usagemodel.UsageModel)11 UsageScenario (org.palladiosimulator.pcm.usagemodel.UsageScenario)11 AbstractUserAction (org.palladiosimulator.pcm.usagemodel.AbstractUserAction)10 EntryLevelSystemCall (org.palladiosimulator.pcm.usagemodel.EntryLevelSystemCall)10 Start (org.palladiosimulator.pcm.usagemodel.Start)10 Stop (org.palladiosimulator.pcm.usagemodel.Stop)10 EntryCallEvent (org.iobserve.stages.general.data.EntryCallEvent)6 StochasticExpressionEditDialog (org.palladiosimulator.editors.commons.dialogs.stoex.StochasticExpressionEditDialog)5 EntryCallSequenceModel (org.iobserve.analysis.data.EntryCallSequenceModel)4 UserSessionCollectionModel (org.iobserve.analysis.data.UserSessionCollectionModel)4 ReferenceElements (org.iobserve.analysis.test.userbehavior.ReferenceElements)4 ReferenceElements (org.iobserve.analysis.userbehavior.ReferenceElements)4 Correspondent (org.iobserve.model.correspondence.Correspondent)4 OperationSignature (org.palladiosimulator.pcm.repository.OperationSignature)4 BranchTransition (org.palladiosimulator.pcm.usagemodel.BranchTransition)4 ClosedWorkload (org.palladiosimulator.pcm.usagemodel.ClosedWorkload)3 ArrayList (java.util.ArrayList)2