Пример #1
0
 @Override
 protected void makeOptions(Parameterization config) {
   super.makeOptions(config);
   generator = config.tryInstantiate(GeneratorXMLDatabaseConnection.class);
   // Output file
   outputFile =
       getParameterOutputFile(
           config,
           "The file to write the generated data set into, if the file already exists, the generated points will be appended to this file.");
 }
Пример #2
0
 @Override
 protected void makeOptions(Parameterization config) {
   super.makeOptions(config);
   input = config.tryInstantiate(InputStep.class);
   // Distance function parameter
   final ObjectParameter<DistanceFunction<O>> dpar =
       new ObjectParameter<>(DISTANCE_ID, DistanceFunction.class);
   if (config.grab(dpar)) {
     distance = dpar.instantiateClass(config);
   }
   final IntParameter kpar = new IntParameter(K_ID);
   kpar.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
   if (config.grab(kpar)) {
     k = kpar.intValue();
   }
   // Output file parameter
   final FileParameter cpar = new FileParameter(CACHE_ID, FileParameter.FileType.OUTPUT_FILE);
   if (config.grab(cpar)) {
     out = cpar.getValue();
   }
 }