public static final class TLcdClusteringTransformer.Builder extends Object
Builder for TLcdClusteringTransformer
.
One can configure default parameters and parameters for specific classifications using the forClass method.
You can assign classifications to the original model elements. Model elements with different classifications
will never be put together in a single cluster. You can use this, for instance, to prevent air-units and
ground-units to be put together in a single cluster.
You can also specify the clustering configuration per classification. If you do not specify a separate
configuration for a classification, the default configuration will be used.
If you specify a separate configuration for a classification but you do not specify a particular parameter
the specified default will be used. In other words, specified defaults override the defaults for all classes.
To create a TLcdClusteringTransformer with default settings:
TLcdClusteringTransformer transformer = TLcdClusteringTransformer.newBuilder().build();
To create a TLcdClusteringTransformer with non-default settings:
TLcdClusteringTransformer transformer = TLcdClusteringTransformer.newBuilder()
.defaultParameters() //Specify defaults
.clusterSize(100)
.minimumPoints(5)
.build()
.build();
To create a transformer with specific parameters for a particular classification and given defaults for all other classifications:
TLcdClusteringTransformer transformer = TLcdClusteringTransformer.newBuilder()
.classifier(new MyAirGroundClassifier())
.forClass("air") //Air units will get these custom settings
.clusterSize(100)
.minimumPoints(5)
.build()
//All other units will have default settings
.build();
To create a transformer with specific parameters for a particular classification and other specific parameters for all other classifications:
TLcdClusteringTransformer transformer = TLcdClusteringTransformer.newBuilder()
.classifier(new MyAirGroundClassifier())
.defaultParameters() //All units will get the default configuration as specified here
.clusterSize(50)
.minimumPoints(2)
.build()
.forClass("air") //Except for air units, which will get a different configuration
.clusterSize(100)
.minimumPoints(5)
.build()
.build();
To create a transformer with a specific parameter for a particular classification but the same defaults as for other classes for the other parameters:
TLcdClusteringTransformer transformer = TLcdClusteringTransformer.newBuilder()
.classifier(new MyAirGroundClassifier())
.defaultParameters() //All units will get the default configuration as specified here
.clusterSize(50)
.minimumPoints(5)
.build()
.forClass("air") //For air units, a cluster size of 100 and a minimum number of points of 5 (the specified default) will be used
.clusterSize(100)
.build()
.build();
TLcdTransformingModelFactory
Modifier and Type | Class and Description |
---|---|
static class |
TLcdClusteringTransformer.Builder.ClassificationSpecificBuilder
Builder to configure parameters for a specific classification.
|
Modifier and Type | Method and Description |
---|---|
TLcdClusteringTransformer |
build()
Build the clustering transformer
|
TLcdClusteringTransformer.Builder |
classifier(ILcdClassifier aClassifier)
Specify the classifier which will be used to map domain objects onto a certain class (=a string).
|
TLcdClusteringTransformer.Builder.ClassificationSpecificBuilder |
defaultParameters()
Returns a
ClassificationSpecificBuilder instance on which the settings for
all classes can be altered. |
TLcdClusteringTransformer.Builder.ClassificationSpecificBuilder |
forClass(ILcdFilter<String> aClassification)
Returns a
ClassificationSpecificBuilder instance on which the settings for the specified
class(es) can be altered. |
TLcdClusteringTransformer.Builder.ClassificationSpecificBuilder |
forClass(String aClassification)
Returns a
ClassificationSpecificBuilder instance on which the settings for the specified
class can be altered. |
public TLcdClusteringTransformer.Builder classifier(ILcdClassifier aClassifier)
Specify the classifier which will be used to map domain objects onto a certain class (=a string).
You can specify different clustering settings for the different classes by using the forClass
methods on
this builder.
Consult the class javadoc for code examples on how to use this builder.
aClassifier
- The classifierpublic TLcdClusteringTransformer.Builder.ClassificationSpecificBuilder defaultParameters()
Returns a ClassificationSpecificBuilder
instance on which the settings for
all classes can be altered.
The settings configured on this ClassificationSpecificBuilder
will be used for
all classes, except the classes for which you specified different settings using any of the
available forClass
methods.
Consult the class javadoc for code examples on how to use this builder.
ClassificationSpecificBuilder
instance on which the settings for
all classes can be configured.classifier(ILcdClassifier)
public TLcdClusteringTransformer.Builder.ClassificationSpecificBuilder forClass(String aClassification)
Returns a ClassificationSpecificBuilder
instance on which the settings for the specified
class can be altered.
Consult the class javadoc for code examples on how to use this builder.
aClassification
- The classification.
This should be one of the classes returned by the classifier
set on this builder.ClassificationSpecificBuilder
instance on which the settings for the specified
class can be altered.classifier(ILcdClassifier)
public TLcdClusteringTransformer.Builder.ClassificationSpecificBuilder forClass(ILcdFilter<String> aClassification)
Returns a ClassificationSpecificBuilder
instance on which the settings for the specified
class(es) can be altered.
Consult the class javadoc for code examples on how to use this builder.
aClassification
- The classification as a filter.
The settings will be applied on all classes which are accepted by the filter.ClassificationSpecificBuilder
instance on which the settings for the specified
class(es) can be altered.classifier(ILcdClassifier)
public TLcdClusteringTransformer build()