Search in sources :

Example 1 with HostComponentAllocationGraphFactory

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);
}
Also used : HostComponentAllocationGraphFactory(org.iobserve.adaptation.data.graph.HostComponentAllocationGraphFactory)

Example 2 with HostComponentAllocationGraphFactory

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);
}
Also used : ModelImporter(org.iobserve.model.ModelImporter) HostComponentAllocationGraph(org.iobserve.adaptation.data.graph.HostComponentAllocationGraph) HostComponentAllocationGraphFactory(org.iobserve.adaptation.data.graph.HostComponentAllocationGraphFactory) File(java.io.File)

Example 3 with HostComponentAllocationGraphFactory

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));
}
Also used : ModelImporter(org.iobserve.model.ModelImporter) HostComponentAllocationGraph(org.iobserve.adaptation.data.graph.HostComponentAllocationGraph) HostComponentAllocationGraphFactory(org.iobserve.adaptation.data.graph.HostComponentAllocationGraphFactory) File(java.io.File)

Example 4 with HostComponentAllocationGraphFactory

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;
}
Also used : HostComponentAllocationGraph(org.iobserve.adaptation.data.graph.HostComponentAllocationGraph) HostComponentAllocationGraphFactory(org.iobserve.adaptation.data.graph.HostComponentAllocationGraphFactory) AdaptationData(org.iobserve.adaptation.data.AdaptationData)

Aggregations

HostComponentAllocationGraphFactory (org.iobserve.adaptation.data.graph.HostComponentAllocationGraphFactory)4 HostComponentAllocationGraph (org.iobserve.adaptation.data.graph.HostComponentAllocationGraph)3 File (java.io.File)2 ModelImporter (org.iobserve.model.ModelImporter)2 AdaptationData (org.iobserve.adaptation.data.AdaptationData)1