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