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


Java IntParameter.setOptional方法代码示例

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


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

示例1: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.IntParameter; //导入方法依赖的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

示例2: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.IntParameter; //导入方法依赖的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

示例3: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.IntParameter; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  DoubleParameter windowP = new DoubleParameter(WINDOW_ID, 10.0);
  if(config.grab(windowP)) {
    window = windowP.getValue();
  }
  IntParameter projectionsP = new IntParameter(PROJECTIONS_ID);
  projectionsP.setOptional(true);
  projectionsP.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
  if(config.grab(projectionsP)) {
    projections = projectionsP.getValue();
  }

  ObjectParameter<RandomProjectionFamily> projP = new ObjectParameter<>(PROJECTION_ID, RandomProjectionFamily.class);
  projP.setOptional(true);
  if(config.grab(projP)) {
    proj = projP.instantiateClass(config);
  }
  RandomParameter randomP = new RandomParameter(RANDOM_ID);
  if(config.grab(randomP)) {
    random = randomP.getValue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:25,代码来源:NaiveProjectedKNNPreprocessor.java

示例4: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.IntParameter; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  ObjectListParameter<SpatialSorter> curveP = new ObjectListParameter<>(CURVES_ID, SpatialSorter.class);
  if(config.grab(curveP)) {
    curvegen = curveP.instantiateClasses(config);
  }
  DoubleParameter windowP = new DoubleParameter(WINDOW_ID, 10.0);
  if(config.grab(windowP)) {
    window = windowP.getValue();
  }
  IntParameter variantsP = new IntParameter(VARIANTS_ID, 1);
  variantsP.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
  if(config.grab(variantsP)) {
    variants = variantsP.getValue();
  }
  IntParameter dimP = new IntParameter(DIM_ID);
  dimP.setOptional(true);
  dimP.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
  if(config.grab(dimP)) {
    odim = dimP.intValue();
  }

  ObjectParameter<RandomProjectionFamily> projP = new ObjectParameter<>(PROJECTION_ID, RandomProjectionFamily.class);
  projP.setOptional(true);
  if(config.grab(projP)) {
    proj = projP.instantiateClass(config);
  }
  RandomParameter randomP = new RandomParameter(RANDOM_ID);
  if(config.grab(randomP)) {
    random = randomP.getValue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:34,代码来源:SpacefillingKNNPreprocessor.java

示例5: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.IntParameter; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  PatternParameter positiveClassNameP = new PatternParameter(POSITIVE_CLASS_NAME_ID);
  if(config.grab(positiveClassNameP)) {
    positiveClassName = positiveClassNameP.getValue();
  }
  IntParameter maxkP = new IntParameter(MAX_K_ID);
  maxkP.setOptional(true);
  if(config.grab(maxkP)) {
    maxk = maxkP.getValue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:14,代码来源:OutlierPrecisionAtKCurve.java

示例6: makeOptions

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

  final IntParameter pK = new IntParameter(KREF_ID);
  pK.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
  if(config.grab(pK)) {
    krefer = pK.intValue();
  }

  final IntParameter pK2 = new IntParameter(KREACH_ID);
  pK2.setOptional(true);
  pK2.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
  if(config.grab(pK2)) {
    kreach = pK2.intValue();
  }
  else {
    kreach = krefer;
  }

  final ObjectParameter<DistanceFunction<O>> reachDistP = new ObjectParameter<>(REACHABILITY_DISTANCE_FUNCTION_ID, DistanceFunction.class);
  reachDistP.setOptional(true);
  if(config.grab(reachDistP)) {
    reachabilityDistanceFunction = reachDistP.instantiateClass(config);
  }
  else {
    reachabilityDistanceFunction = distanceFunction;
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:30,代码来源:FlexibleLOF.java

示例7: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.IntParameter; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  final IntParameter kcompP = new IntParameter(KCOMP_ID);
  kcompP.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
  if(config.grab(kcompP)) {
    kcomp = kcompP.intValue();
  }

  final ObjectParameter<DistanceFunction<O>> compDistP = new ObjectParameter<>(COMPARISON_DISTANCE_FUNCTION_ID, DistanceFunction.class, EuclideanDistanceFunction.class);
  if(config.grab(compDistP)) {
    comparisonDistanceFunction = compDistP.instantiateClass(config);
  }

  final IntParameter kreachP = new IntParameter(KREACH_ID);
  kreachP.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
  kreachP.setOptional(true);
  if(config.grab(kreachP)) {
    kreach = kreachP.intValue();
  }
  else {
    kreach = kcomp;
  }

  final ObjectParameter<DistanceFunction<O>> reachDistP = new ObjectParameter<>(REACHABILITY_DISTANCE_FUNCTION_ID, DistanceFunction.class, true);
  if(config.grab(reachDistP)) {
    reachabilityDistanceFunction = reachDistP.instantiateClass(config);
  }

  // TODO: make default 1.0?
  final DoubleParameter lambdaP = new DoubleParameter(LAMBDA_ID, 2.0);
  lambdaP.addConstraint(CommonConstraints.GREATER_THAN_ZERO_DOUBLE);
  if(config.grab(lambdaP)) {
    lambda = lambdaP.doubleValue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:37,代码来源:LoOP.java

示例8: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.IntParameter; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  // Data input
  inputstep = config.tryInstantiate(InputStep.class);
  // Distance function
  ObjectParameter<DistanceFunction<? super O>> distP = AbstractAlgorithm.makeParameterDistanceFunction(EuclideanDistanceFunction.class, DistanceFunction.class);
  if(config.grab(distP)) {
    distf = distP.instantiateClass(config);
  }
  // k parameters
  IntParameter stepkP = new IntParameter(STEPK_ID) //
      .addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
  if(config.grab(stepkP)) {
    stepk = stepkP.getValue();
  }
  IntParameter startkP = new IntParameter(STARTK_ID);
  startkP.setOptional(true);
  if(config.grab(startkP)) {
    startk = startkP.getValue();
  }
  else {
    startk = stepk;
  }
  IntParameter maxkP = new IntParameter(MAXK_ID)//
      .addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
  if(config.grab(maxkP)) {
    maxk = maxkP.getValue();
  }
  bylabel = config.tryInstantiate(ByLabelOutlier.class);
  // Output
  outfile = super.getParameterOutputFile(config, "File to output the resulting score vectors to.");

  ObjectParameter<ScalingFunction> scalingP = new ObjectParameter<>(SCALING_ID, ScalingFunction.class);
  scalingP.setOptional(true);
  if(config.grab(scalingP)) {
    scaling = scalingP.instantiateClass(config);
  }

  PatternParameter disableP = new PatternParameter(DISABLE_ID) //
      .setOptional(true);
  if(config.grab(disableP)) {
    disable = disableP.getValue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:46,代码来源:ComputeKNNOutlierScores.java


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