Class TLcdClusteringTransformer.Builder

java.lang.Object
com.luciad.model.transformation.clustering.TLcdClusteringTransformer.Builder
Enclosing class:
TLcdClusteringTransformer

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.

Example usages:

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();
 
Since:
2016.0
See Also:
  • Method Details

    • classifier

      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.

      Parameters:
      aClassifier - The classifier
      Returns:
      This builder
    • 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.

      Returns:
      a ClassificationSpecificBuilder instance on which the settings for all classes can be configured.
      See Also:
    • forClass

      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.

      Parameters:
      aClassification - The classification. This should be one of the classes returned by the classifier set on this builder.
      Returns:
      a ClassificationSpecificBuilder instance on which the settings for the specified class can be altered.
      See Also:
    • forClass

      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.

      Parameters:
      aClassification - The classification as a filter. The settings will be applied on all classes which are accepted by the filter.
      Returns:
      a ClassificationSpecificBuilder instance on which the settings for the specified class(es) can be altered.
      See Also:
    • build

      public TLcdClusteringTransformer build()
      Build the clustering transformer
      Returns:
      a new clustering transformer