use of org.iobserve.adaptation.data.graph.HostComponentAllocationGraphFactory in project iobserve-analysis by research-iobserve.
the class AtomicActionComputationTest method initializeModelGraphs.
private void initializeModelGraphs() throws Exception {
final HostComponentAllocationGraphFactory graphFactory = new HostComponentAllocationGraphFactory();
this.runtimeModelGraph = graphFactory.buildGraph(this.runtimeModel.getSystem(), this.runtimeModel.getResEnvironment(), this.runtimeModel.getAllocation(), ModelGraphRevision.RUNTIME);
this.redeploymentModelGraph = graphFactory.buildGraph(this.redeploymentModel.getSystem(), this.redeploymentModel.getResEnvironment(), this.redeploymentModel.getAllocation(), ModelGraphRevision.REDEPLOYMENT);
}
use of org.iobserve.adaptation.data.graph.HostComponentAllocationGraphFactory in project iobserve-analysis by research-iobserve.
the class ModelGraphCreator method execute.
@Override
protected void execute(final AdaptationData adaptationData) throws Exception {
final HostComponentAllocationGraphFactory runtimeFactory = new HostComponentAllocationGraphFactory();
final HostComponentAllocationGraphFactory redeploymentFactory = new HostComponentAllocationGraphFactory();
final File runtimeModelDir = adaptationData.getRuntimeModelDir();
final File redeploymentModelDir = adaptationData.getReDeploymentModelDir();
final HostComponentAllocationGraph runtimeModelGraph = runtimeFactory.buildGraph(new ModelImporter(runtimeModelDir), ModelGraphRevision.RUNTIME);
final HostComponentAllocationGraph redeploymentModelGraph = redeploymentFactory.buildGraph(new ModelImporter(redeploymentModelDir), ModelGraphRevision.REDEPLOYMENT);
adaptationData.setRuntimeGraph(runtimeModelGraph);
adaptationData.setReDeploymentGraph(redeploymentModelGraph);
this.getOutputPort().send(adaptationData);
}
use of org.iobserve.adaptation.data.graph.HostComponentAllocationGraphFactory in project iobserve-analysis by research-iobserve.
the class ModelComparer method execute.
@Override
protected void execute(final URI element) throws Exception {
boolean equalGraphs = false;
if (this.baseAdaptationData != null) {
// TODO finish
final ModelImporter modelProviders = new ModelImporter(new File(element.toFileString()));
final HostComponentAllocationGraphFactory graphFactory = new HostComponentAllocationGraphFactory();
final HostComponentAllocationGraph runtimeGraph = graphFactory.buildGraph(modelProviders, ModelGraphRevision.RUNTIME);
if (runtimeGraph.equals(this.baseAdaptationData.getReDeploymentGraph()) && this.baseAdaptationData.getReDeploymentGraph().equals(runtimeGraph)) {
equalGraphs = true;
SystemEvaluation.disableEvaluation();
}
}
this.outputPort.send(Boolean.valueOf(equalGraphs));
}
use of org.iobserve.adaptation.data.graph.HostComponentAllocationGraphFactory in project iobserve-analysis by research-iobserve.
the class ComposedActionComputationTest method createAdaptationData.
private AdaptationData createAdaptationData() throws Exception {
final AdaptationData adaptationData = new AdaptationData();
final HostComponentAllocationGraphFactory graphFactory = new HostComponentAllocationGraphFactory();
final HostComponentAllocationGraph runtimeModelGraph = graphFactory.buildGraph(this.runtimeModel.getSystem(), this.runtimeModel.getResEnvironment(), this.runtimeModel.getAllocation(), ModelGraphRevision.RUNTIME);
final HostComponentAllocationGraph redeploymentModelGraph = graphFactory.buildGraph(this.redeploymentModel.getSystem(), this.redeploymentModel.getResEnvironment(), this.redeploymentModel.getAllocation(), ModelGraphRevision.REDEPLOYMENT);
adaptationData.setRuntimeGraph(runtimeModelGraph);
adaptationData.setReDeploymentGraph(redeploymentModelGraph);
return adaptationData;
}
Aggregations