当前位置: 首页>>代码示例>>Java>>正文


Java Parameterization.grab方法代码示例

本文整理汇总了Java中de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.Parameterization.grab方法的典型用法代码示例。如果您正苦于以下问题:Java Parameterization.grab方法的具体用法?Java Parameterization.grab怎么用?Java Parameterization.grab使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.Parameterization的用法示例。


在下文中一共展示了Parameterization.grab方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.Parameterization; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);

  IntParameter kP = new IntParameter(KMeans.K_ID);
  kP.addConstraint(CommonConstraints.GREATER_THAN_ONE_INT);
  if (config.grab(kP)) {
    k = kP.intValue();
  }

  ObjectParameter<KMeans<V, M>> kMeansVariantP = new ObjectParameter<>(KMEANS_ID, KMeans.class, BestOfMultipleKMeans.class);
  if (config.grab(kMeansVariantP)) {
    ListParameterization kMeansVariantParameters = new ListParameterization();

    // We will always invoke this with k=2!
    kMeansVariantParameters.addParameter(KMeans.K_ID, 2);

    ChainedParameterization combinedConfig = new ChainedParameterization(kMeansVariantParameters, config);
    combinedConfig.errorsTo(config);
    kMeansVariant = kMeansVariantP.instantiateClass(combinedConfig);
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:23,代码来源:KMeansBisecting.java

示例2: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.Parameterization; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  out = super.getParameterOutputFile(config, "Output image file name.");
  IntParameter stepsP = new IntParameter(STEPS_ID);
  stepsP.setOptional(true);
  if(config.grab(stepsP)) {
    steps = stepsP.intValue();
  }
  IntParameter resolutionP = new IntParameter(RESOLUTION_ID, 2000);
  if(config.grab(resolutionP)) {
    resolution = resolutionP.intValue();
  }
  EnumParameter<Mode> modeP = new EnumParameter<>(MODE_ID, Mode.class, Mode.XTD);
  if(config.grab(modeP)) {
    mode = modeP.getValue();
  }
  ObjectParameter<EarthModel> modelP = new ObjectParameter<>(EarthModel.MODEL_ID, EarthModel.class, SphericalVincentyEarthModel.class);
  if(config.grab(modelP)) {
    model = modelP.instantiateClass(config);
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:23,代码来源:VisualizeGeodesicDistances.java

示例3: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.Parameterization; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  // The super class has the distance function parameter!
  super.makeOptions(config);
  IntParameter kP = new IntParameter(K_ID) //
  .addConstraint(CommonConstraints.GREATER_THAN_ONE_INT);
  if(config.grab(kP)) {
    k = kP.getValue();
  }
  DoubleParameter deltaP = new DoubleParameter(DELTA_ID) //
  .setDefaultValue(1.1) //
  .addConstraint(CommonConstraints.GREATER_THAN_ONE_DOUBLE);
  if(config.grab(deltaP)) {
    delta = deltaP.getValue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:17,代码来源:DWOF.java

示例4: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.Parameterization; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  final DoubleParameter alphaP = new DoubleParameter(ALPHA_ID, DEFAULT_ALPHA);
  alphaP.addConstraint(CommonConstraints.GREATER_THAN_ZERO_DOUBLE);
  alphaP.addConstraint(CommonConstraints.LESS_THAN_ONE_DOUBLE);
  if(config.grab(alphaP)) {
    alpha = alphaP.doubleValue();
  }

  final IntParameter kP = new IntParameter(K_ID);
  kP.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
  kP.setOptional(true);
  if(config.grab(kP)) {
    k = kP.intValue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:18,代码来源:HiSCPreferenceVectorIndex.java

示例5: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.Parameterization; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  ObjectParameter<Uncertainifier<?>> innerP = new ObjectParameter<>(INNER_ID, Uncertainifier.class);
  if(config.grab(innerP)) {
    inner = innerP.instantiateClass(config);
    if(inner instanceof AbstractDiscreteUncertainifier) {
      LoggingUtil.warning("Using a discrete uncertainifier inside a discrete uncertainifier is likely a configuration error, and is likely to produce too many duplicate points. Did you mean to use a uniform or gaussian distribution instead?");
    }
  }
  IntParameter pmultMax = new IntParameter(MULT_MAX_ID, DEFAULT_SAMPLE_SIZE);
  if(config.grab(pmultMax)) {
    maxQuant = pmultMax.intValue();
  }
  IntParameter pmultMin = new IntParameter(MULT_MIN_ID) //
  .setOptional(true);
  minQuant = config.grab(pmultMin) ? pmultMin.intValue() : maxQuant;
}
 
开发者ID:elki-project,项目名称:elki,代码行数:19,代码来源:AbstractDiscreteUncertainifier.java

示例6: getFactory

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.Parameterization; //导入方法依赖的package包/类
@Override
protected void getFactory(Parameterization config) {
  ObjectParameter<SparseNumberVector.Factory<V>> factoryP = new ObjectParameter<>(VECTOR_TYPE_ID, SparseNumberVector.Factory.class, SparseFloatVector.Factory.class);
  if(config.grab(factoryP)) {
    factory = factoryP.instantiateClass(config);
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:8,代码来源:TermFrequencyParser.java

示例7: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.Parameterization; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);

  IntParameter kP = new IntParameter(LOF.Parameterizer.K_ID);
  if(config.grab(kP)) {
    k = kP.intValue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:10,代码来源:ParallelLOF.java

示例8: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.Parameterization; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  ObjectParameter<NeighborSetPredicate.Factory<O>> innerP = new ObjectParameter<>(INNER_ID, NeighborSetPredicate.Factory.class);
  if(config.grab(innerP)) {
    inner = innerP.instantiateClass(config);
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:9,代码来源:UnweightedNeighborhoodAdapter.java

示例9: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.Parameterization; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  IntParameter iterP = new IntParameter(ITER_ID, 1000) //
      .addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
  if(config.grab(iterP)) {
    iterations = iterP.intValue();
  }
  RandomParameter rndP = new RandomParameter(SEED_ID);
  if(config.grab(rndP)) {
    rnd = rndP.getValue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:14,代码来源:RANSACCovarianceMatrixBuilder.java

示例10: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.Parameterization; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  ObjectParameter<DistributionEstimator<D>> innerP = new ObjectParameter<>(INNER_ID, DistributionEstimator.class);
  if(config.grab(innerP)) {
    inner = innerP.instantiateClass(config);
  }

  DoubleParameter trimP = new DoubleParameter(WINSORIZE_ID)//
      .addConstraint(CommonConstraints.GREATER_THAN_ZERO_DOUBLE) //
      .addConstraint(CommonConstraints.LESS_THAN_HALF_DOUBLE);
  if(config.grab(trimP)) {
    winsorize = trimP.doubleValue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:16,代码来源:WinsorizingEstimator.java

示例11: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.Parameterization; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  final IntParameter param = new IntParameter(HISTOGRAM_BINS_ID, 100);
  param.addConstraint(CommonConstraints.GREATER_THAN_ONE_INT);
  if(config.grab(param)) {
    numbins = param.getValue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:10,代码来源:RankingQualityHistogram.java

示例12: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.Parameterization; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  Flag multipleF = new Flag(MULTIPLE_ID);
  if(config.grab(multipleF)) {
    multiple = multipleF.getValue();
  }

  PatternParameter noisepatP = new PatternParameter(NOISE_ID);
  noisepatP.setOptional(true);
  if(config.grab(noisepatP)) {
    noisepat = noisepatP.getValue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:15,代码来源:ByLabelClustering.java

示例13: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.Parameterization; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  IntParameter param = new IntParameter(BPP_ID);
  if(config.grab(param)) {
    bpp = param.getValue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:9,代码来源:RGBHistogramQuadraticDistanceFunction.java

示例14: getParameterInnerNeighborhood

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.Parameterization; //导入方法依赖的package包/类
/**
 * Inner neighborhood parameter.
 * 
 * @param config Parameterization
 * @return Inner neighborhood.
 */
protected static <O> NeighborSetPredicate.Factory<O> getParameterInnerNeighborhood(Parameterization config) {
  final ObjectParameter<NeighborSetPredicate.Factory<O>> param = new ObjectParameter<>(NEIGHBORHOOD_ID, NeighborSetPredicate.Factory.class);
  if(config.grab(param)) {
    return param.instantiateClass(config);
  }
  return null;
}
 
开发者ID:elki-project,项目名称:elki,代码行数:14,代码来源:ExtendedNeighborhood.java

示例15: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.Parameterization; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  final Flag verboseF = new Flag(AbstractApplication.Parameterizer.VERBOSE_ID);
  if (config.grab(verboseF) && verboseF.isTrue()) {
    verbose++;
    final Flag verbose2F = new Flag(AbstractApplication.Parameterizer.VERBOSE_ID);
    if (config.grab(verbose2F) && verbose2F.isTrue()) {
      verbose++;
    }
  }
  final StringParameter debugP = new StringParameter(AbstractApplication.Parameterizer.DEBUG_ID);
  debugP.setOptional(true);
  if (config.grab(debugP)) {
    String[] opts = debugP.getValue().split(",");
    levels = new String[opts.length][];
    int i = 0;
    for (String opt : opts) {
      String[] chunks = opt.split("=");
      if (chunks.length != 1 && chunks.length != 2) {
        config.reportError(new WrongParameterValueException(debugP, debugP.getValue(), "Invalid debug option."));
        break;
      }
      levels[i] = chunks;
      i++;
    }
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:29,代码来源:LoggingStep.java


注:本文中的de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.Parameterization.grab方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。