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