Search in sources :

Example 1 with ModelGraph

use of org.iobserve.analysis.data.graph.ModelGraph 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 PCMModelHandler modelProviders = new PCMModelHandler(new File(element.toFileString()));
        final GraphFactory graphFactory = new GraphFactory();
        final ModelGraph runtimeGraph = graphFactory.buildGraph(modelProviders);
        if (runtimeGraph.equals(this.baseAdaptationData.getReDeploymentGraph()) && this.baseAdaptationData.getReDeploymentGraph().equals(runtimeGraph)) {
            equalGraphs = true;
            SystemEvaluation.disableEvaluation();
        }
    }
    this.outputPort.send(Boolean.valueOf(equalGraphs));
}
Also used : GraphFactory(org.iobserve.analysis.data.graph.GraphFactory) ModelGraph(org.iobserve.analysis.data.graph.ModelGraph) PCMModelHandler(org.iobserve.model.PCMModelHandler) File(java.io.File)

Example 2 with ModelGraph

use of org.iobserve.analysis.data.graph.ModelGraph in project iobserve-analysis by research-iobserve.

the class CandidateProcessing method execute.

@Override
protected void execute(final PlanningData element) throws Exception {
    CandidateGeneration.LOG.info("Candiate Processing");
    final AdaptationData adapdationData = element.getAdaptationData();
    final GraphFactory factory = new GraphFactory();
    final File directory = new File(adapdationData.getReDeploymentURI().toFileString());
    final ModelGraph graph = factory.buildGraph(new PCMModelHandler(directory));
    element.getAdaptationData().setReDeploymentGraph(graph);
    this.outputPort.send(element.getAdaptationData());
}
Also used : GraphFactory(org.iobserve.analysis.data.graph.GraphFactory) ModelGraph(org.iobserve.analysis.data.graph.ModelGraph) PCMModelHandler(org.iobserve.model.PCMModelHandler) AdaptationData(org.iobserve.adaptation.data.AdaptationData) File(java.io.File)

Aggregations

File (java.io.File)2 GraphFactory (org.iobserve.analysis.data.graph.GraphFactory)2 ModelGraph (org.iobserve.analysis.data.graph.ModelGraph)2 PCMModelHandler (org.iobserve.model.PCMModelHandler)2 AdaptationData (org.iobserve.adaptation.data.AdaptationData)1