Class ContainmentSubtreeSplit
- java.lang.Object
-
- de.uni_marburg.mdo_over.split.emf.ContainmentSubtreeSplit
-
- All Implemented Interfaces:
ISplitStrategy
public class ContainmentSubtreeSplit extends Object implements ISplitStrategy
A split strategy expecting the input graph to be a one-to-one representation of an EMF model, i.e., each node references anEObject
and each edge anEReference
between such objects. Furthermore, the root of the graph represents anEObject
transitively containing all other nodes via edges representingcontainments
.The problem part of the graph is copied to both of the generated split parts. The problem part is specified by a set of edges. Whether or not a node is part of the problem is already specified by whether or not its incoming containment edge is part of the problem. In order to not construct empty split parts, the root is considered to be part of the problem and is always contained in both split parts.
Subtrees, w.r.t. the containment hierarchy, connected to the problem part are distributed randomly among the split parts. If only one subtree exists which is directly connected to the problem part, the root of that subtree is copied to both split parts (i.e., it is considered to be part of the split point). The subtrees directly connected to the subtree root are then considered next for random distribution. This extension of the split point continues until there is either more than one subtree available to distribute or the whole containment hierarchy is part of the split point.
All non-containment edges not belonging to the specified problem part are copied to the split part which contains the majority of the nodes connected by the edge. In case both split parts contain the same number of the edge's nodes, the edge is copied to one split part randomly. If the chosen split part lacks one of the edge's nodes, that node is also copied to that split part together with all of its containment ancestors.
- Author:
- S. John
-
-
Constructor Summary
Constructors Constructor Description ContainmentSubtreeSplit(double distributionRatio, Set<org.eclipse.emf.ecore.EReference> problemEdgeTypes)
ContainmentSubtreeSplit(Random rng, double distributionRatio, Set<org.eclipse.emf.ecore.EReference> problemEdgeTypes)
A user may provide a random number generator used for randomly distributing elements between split parts.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CoSpan
split(ModelGraph graph)
Splits the given graph returning aCoSpan
containing the split parts with mappings to the goven graph.
-
-
-
Constructor Detail
-
ContainmentSubtreeSplit
public ContainmentSubtreeSplit(double distributionRatio, Set<org.eclipse.emf.ecore.EReference> problemEdgeTypes)
-
ContainmentSubtreeSplit
public ContainmentSubtreeSplit(Random rng, double distributionRatio, Set<org.eclipse.emf.ecore.EReference> problemEdgeTypes)
A user may provide a random number generator used for randomly distributing elements between split parts. The distribution ratio determines whether or not there is a skew in the distribution. A ratio of0
will cause all distributable elements to be assigned to the first split part; likewise a ratio of1
will put all elements in the second split part.- Parameters:
rng
- a random number generatordistributionRatio
- a ratio determining the distribution of elementsproblemEdgeTypes
- a set of edges defining the problem part of the graphs
-
-
Method Detail
-
split
public CoSpan split(ModelGraph graph)
Description copied from interface:ISplitStrategy
Splits the given graph returning aCoSpan
containing the split parts with mappings to the goven graph.- Specified by:
split
in interfaceISplitStrategy
- Parameters:
graph
- graph to split- Returns:
- cospan containing split parts and mappings
-
-