Ejemplo n.º 1
0
    @Override
    protected void makeOptions(Parameterization config) {
      super.makeOptions(config);

      FileParameter fileP = new FileParameter(FILE_ID, FileParameter.FileType.INPUT_FILE);
      if (config.grab(fileP)) {
        file = fileP.getValue();
      }

      PatternParameter idP = new PatternParameter(ID_ID, ID_PATTERN_DEFAULT);
      if (config.grab(idP)) {
        idpattern = idP.getValue();
      }

      PatternParameter scoreP = new PatternParameter(SCORE_ID);
      if (config.grab(scoreP)) {
        scorepattern = scoreP.getValue();
      }

      Flag inverstedF = new Flag(INVERTED_ID);
      if (config.grab(inverstedF)) {
        inverted = inverstedF.getValue();
      }

      ObjectParameter<ScalingFunction> scalingP =
          new ObjectParameter<>(SCALING_ID, ScalingFunction.class, IdentityScaling.class);
      if (config.grab(scalingP)) {
        scaling = scalingP.instantiateClass(config);
      }
    }
    @Override
    protected void makeOptions(Parameterization config) {
      super.makeOptions(config);
      final FileParameter MATRIX_PARAM =
          new FileParameter(MATRIX_ID, FileParameter.FileType.INPUT_FILE);
      if (config.grab(MATRIX_PARAM)) {
        matrixfile = MATRIX_PARAM.getValue();
      }

      final ObjectParameter<DistanceParser> PARSER_PARAM =
          new ObjectParameter<>(PARSER_ID, DistanceParser.class, AsciiDistanceParser.class);
      if (config.grab(PARSER_PARAM)) {
        parser = PARSER_PARAM.instantiateClass(config);
      }
    }
Ejemplo n.º 3
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();
   }
 }