Search in sources :

Example 1 with ToscaComponentPatternMatcher

use of org.eclipse.winery.topologygraph.matching.patterndetection.ToscaComponentPatternMatcher in project winery by eclipse.

the class ComponentPatternDetectionTest method isCompatible.

private boolean isCompatible(OTPatternRefinementModel prm, List<OTRefinementModel> refinementModels) {
    ToscaComponentPatternMatcher matcher = new ToscaComponentPatternMatcher(prm, null, refinementModels, new HashMap<>());
    ToscaIsomorphismMatcher isomorphismMatcher = new ToscaIsomorphismMatcher();
    ToscaGraph detectorGraph = ToscaTransformer.createTOSCAGraph(prm.getDetector());
    ToscaGraph topologyGraph = ToscaTransformer.createTOSCAGraph(topology);
    Iterator<GraphMapping<ToscaNode, ToscaEdge>> matches = isomorphismMatcher.findMatches(detectorGraph, topologyGraph, matcher);
    return matches.hasNext();
}
Also used : ToscaIsomorphismMatcher(org.eclipse.winery.topologygraph.matching.ToscaIsomorphismMatcher) ToscaGraph(org.eclipse.winery.topologygraph.model.ToscaGraph) ToscaComponentPatternMatcher(org.eclipse.winery.topologygraph.matching.patterndetection.ToscaComponentPatternMatcher) GraphMapping(org.jgrapht.GraphMapping)

Aggregations

ToscaIsomorphismMatcher (org.eclipse.winery.topologygraph.matching.ToscaIsomorphismMatcher)1 ToscaComponentPatternMatcher (org.eclipse.winery.topologygraph.matching.patterndetection.ToscaComponentPatternMatcher)1 ToscaGraph (org.eclipse.winery.topologygraph.model.ToscaGraph)1 GraphMapping (org.jgrapht.GraphMapping)1