Exemplo n.º 1
0
      @Override
      protected void makeOptions(Parameterization config) {
        super.makeOptions(config);
        ObjectParameter<EarthModel> modelP =
            new ObjectParameter<>(
                EarthModel.MODEL_ID, EarthModel.class, SphericalVincentyEarthModel.class);
        if (config.grab(modelP)) {
          model = modelP.instantiateClass(config);
        }

        ObjectParameter<IndexFactory<O, ?>> innerP =
            new ObjectParameter<>(
                ProjectedIndex.Factory.Parameterizer.INDEX_ID, IndexFactory.class);
        if (config.grab(innerP)) {
          inner = innerP.instantiateClass(config);
        }

        Flag materializeF = new Flag(ProjectedIndex.Factory.Parameterizer.MATERIALIZE_FLAG);
        if (config.grab(materializeF)) {
          materialize = materializeF.isTrue();
        }

        Flag norefineF = new Flag(ProjectedIndex.Factory.Parameterizer.DISABLE_REFINE_FLAG);
        if (config.grab(norefineF)) {
          norefine = norefineF.isTrue();
        }
      }
Exemplo n.º 2
0
    @Override
    protected void makeOptions(Parameterization config) {
      super.makeOptions(config);

      DoubleParameter quantileP =
          new DoubleParameter(QUANTILE_ID, 0.1) //
              .addConstraint(CommonConstraints.GREATER_EQUAL_ZERO_DOUBLE) //
              .addConstraint(CommonConstraints.LESS_EQUAL_ONE_DOUBLE);
      if (config.grab(quantileP)) {
        quantile = quantileP.doubleValue();
      }

      DoubleParameter samplingP =
          new DoubleParameter(SAMPLING_ID) //
              .addConstraint(CommonConstraints.GREATER_THAN_ZERO_DOUBLE);
      if (config.grab(samplingP)) {
        sampling = samplingP.doubleValue();
      }

      Flag nozerosF = new Flag(NOZEROS_ID);
      if (config.grab(nozerosF)) {
        nozeros = nozerosF.isTrue();
      }

      RandomParameter randP = new RandomParameter(SEED_ID);
      if (config.grab(randP)) {
        rand = randP.getValue();
      }
    }