Search in sources :

Example 1 with GraphFactory

use of org.iobserve.analysis.data.graph.GraphFactory 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 GraphFactory

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

the class EvaluationGenerationMain method main.

/**
 * main routine.
 *
 * @param args
 *            program arguments
 */
public static void main(final String[] args) {
    final CommandLineParser parser = new DefaultParser();
    try {
        CommandLine commandLine = parser.parse(EvaluationGenerationMain.createHelpOptions(), args);
        if (commandLine.hasOption("h")) {
            final HelpFormatter formatter = new HelpFormatter();
            formatter.printHelp("iobserve-analysis", EvaluationGenerationMain.createOptions());
        } else {
            commandLine = parser.parse(EvaluationGenerationMain.createOptions(), args);
            final File model = new File(commandLine.getOptionValue("o"));
            if (commandLine.hasOption("n")) {
                EvaluationGenerationMain.clearDirectory(commandLine.getOptionValue("o"));
                ModelGenerationFactory.createNewModel(commandLine);
                final PCMModelHandler modelProviders = new PCMModelHandler(model);
                final GraphFactory graphFactory = new GraphFactory();
                graphFactory.buildGraph(modelProviders);
            }
            if (commandLine.hasOption("m")) {
                EvaluationGenerationMain.clearDirectory(commandLine.getOptionValue("o"));
                ModelModificationFactory.createNewModel(commandLine);
                final PCMModelHandler modelProviers = new PCMModelHandler(model);
                final GraphFactory graphFactory = new GraphFactory();
                graphFactory.buildGraph(modelProviers);
            }
        }
    } catch (final Exception e) {
        // NOCS NOPMD
        e.printStackTrace();
    }
}
Also used : HelpFormatter(org.apache.commons.cli.HelpFormatter) CommandLine(org.apache.commons.cli.CommandLine) GraphFactory(org.iobserve.analysis.data.graph.GraphFactory) PCMModelHandler(org.iobserve.model.PCMModelHandler) CommandLineParser(org.apache.commons.cli.CommandLineParser) File(java.io.File) DefaultParser(org.apache.commons.cli.DefaultParser)

Example 3 with GraphFactory

use of org.iobserve.analysis.data.graph.GraphFactory 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)3 GraphFactory (org.iobserve.analysis.data.graph.GraphFactory)3 PCMModelHandler (org.iobserve.model.PCMModelHandler)3 ModelGraph (org.iobserve.analysis.data.graph.ModelGraph)2 CommandLine (org.apache.commons.cli.CommandLine)1 CommandLineParser (org.apache.commons.cli.CommandLineParser)1 DefaultParser (org.apache.commons.cli.DefaultParser)1 HelpFormatter (org.apache.commons.cli.HelpFormatter)1 AdaptationData (org.iobserve.adaptation.data.AdaptationData)1