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


Java IntParameter.addConstraint方法代码示例

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


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

示例1: 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(K_ID);
  pK.addConstraint(CommonConstraints.GREATER_THAN_ONE_INT);
  if(config.grab(pK)) {
    k = pK.getValue();
  }

  ObjectParameter<KernelDensityFunction> kernelP = new ObjectParameter<>(KERNEL_ID, KernelDensityFunction.class, GaussianKernelDensityFunction.class);
  if(config.grab(kernelP)) {
    kernel = kernelP.instantiateClass(config);
  }

  DoubleParameter hP = new DoubleParameter(H_ID);
  if(config.grab(hP)) {
    h = hP.doubleValue();
  }

  DoubleParameter cP = new DoubleParameter(C_ID, 0.1);
  if(config.grab(cP)) {
    c = cP.doubleValue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:26,代码来源:LDF.java

示例2: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.IntParameter; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  final IntParameter mP = new IntParameter(HiCS.Parameterizer.M_ID, 50);
  mP.addConstraint(CommonConstraints.GREATER_THAN_ONE_INT);
  if(config.grab(mP)) {
    m = mP.intValue();
  }

  final DoubleParameter alphaP = new DoubleParameter(HiCS.Parameterizer.ALPHA_ID, 0.1);
  alphaP.addConstraint(CommonConstraints.GREATER_THAN_ZERO_DOUBLE);
  if(config.grab(alphaP)) {
    alpha = alphaP.doubleValue();
  }

  final ObjectParameter<GoodnessOfFitTest> testP = new ObjectParameter<>(HiCS.Parameterizer.TEST_ID, GoodnessOfFitTest.class, KolmogorovSmirnovTest.class);
  if(config.grab(testP)) {
    statTest = testP.instantiateClass(config);
  }

  final RandomParameter rndP = new RandomParameter(HiCS.Parameterizer.SEED_ID);
  if(config.grab(rndP)) {
    rnd = rndP.getValue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:26,代码来源:HiCSDependenceMeasure.java

示例3: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.IntParameter; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  final IntParameter numbinP = new IntParameter(HISTOGRAM_BINS_ID, 20);
  numbinP.addConstraint(CommonConstraints.GREATER_THAN_ONE_INT);
  if(config.grab(numbinP)) {
    numbin = numbinP.getValue();
  }

  final Flag exactF = new Flag(EXACT_ID);
  if(config.grab(exactF)) {
    exact = exactF.getValue();
  }

  if(!exact) {
    final Flag samplingF = new Flag(SAMPLING_ID);
    if(config.grab(samplingF)) {
      sampling = samplingF.getValue();
    }
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:22,代码来源:DistanceStatisticsWithClasses.java

示例4: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.IntParameter; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  IntParameter dimsP = new IntParameter(DIM_ID) //
  .addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
  IntParameter probP = new IntParameter(PROBCOL_ID);

  if(config.grab(dimsP)) {
    dims = dimsP.intValue();
    // Add additional constraints:
    probP.addConstraint(new LessConstraint(dimsP.intValue()));
    probP.addConstraint(new GreaterEqualConstraint(-dimsP.intValue()));
  }
  if(config.grab(probP)) {
    probcol = probP.intValue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:18,代码来源:WeightedUncertainSplitFilter.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);
  positiveClassNameP.setOptional(true);
  if(config.grab(positiveClassNameP)) {
    positiveClassName = positiveClassNameP.getValue();
  }

  IntParameter binsP = new IntParameter(BINS_ID, 50);
  binsP.addConstraint(CommonConstraints.GREATER_THAN_ONE_INT);
  if(config.grab(binsP)) {
    bins = binsP.getValue();
  }

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

  Flag splitfreqF = new Flag(SPLITFREQ_ID);
  if(config.grab(splitfreqF)) {
    splitfreq = splitfreqF.getValue();
  }

}
 
开发者ID:elki-project,项目名称:elki,代码行数:27,代码来源:ComputeOutlierHistogram.java

示例6: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.IntParameter; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  IntParameter kP = new IntParameter(K_ID);
  kP.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
  if(config.grab(kP)) {
    k = kP.intValue();
  }
  ObjectParameter<PCARunner> pcaP = new ObjectParameter<>(PCARUNNER_ID, PCARunner.class, PCARunner.class);
  if(config.grab(pcaP)) {
    pca = pcaP.instantiateClass(config);
  }
  ObjectParameter<EigenPairFilter> filterP = new ObjectParameter<>(EigenPairFilter.PCA_EIGENPAIR_FILTER, EigenPairFilter.class, PercentageEigenPairFilter.class);
  if(config.grab(filterP)) {
    filter = filterP.instantiateClass(config);
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:18,代码来源:SimpleCOP.java

示例7: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.IntParameter; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  IntParameter numclustersP = new IntParameter(CutDendrogramByNumberOfClusters.Parameterizer.MINCLUSTERS_ID);
  numclustersP.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
  if(config.grab(numclustersP)) {
    numclusters = numclustersP.intValue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:10,代码来源:NaiveAgglomerativeHierarchicalClustering2.java

示例8: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.IntParameter; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  IntParameter dimP = new IntParameter(DIM_ID, 0);
  dimP.addConstraint(CommonConstraints.GREATER_EQUAL_ZERO_INT);
  if(config.grab(dimP)) {
    dim = dimP.intValue();
  }

  ObjectParameter<KernelDensityFunction> kernelP = new ObjectParameter<>(KERNEL_ID, KernelDensityFunction.class, EpanechnikovKernelDensityFunction.class);
  if(config.grab(kernelP)) {
    kernel = kernelP.instantiateClass(config);
  }

  EnumParameter<Mode> modeP = new EnumParameter<>(MODE_ID, Mode.class, Mode.BALLOON);
  if(config.grab(modeP)) {
    mode = modeP.getValue();
  }

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

  IntParameter windowP = new IntParameter(WINDOW_ID);
  windowP.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
  if(config.grab(windowP)) {
    minwindow = windowP.intValue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:32,代码来源:KNNKernelDensityMinimaClustering.java

示例9: makeOptions

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

示例10: makeOptions

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

  final ObjectParameter<DistanceFunction<O>> distanceFunctionP = new ObjectParameter<>(DISTANCE_FUNCTION_ID, DistanceFunction.class, EuclideanDistanceFunction.class);
  if(config.grab(distanceFunctionP)) {
    distanceFunction = distanceFunctionP.instantiateClass(config);
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:15,代码来源:SharedNearestNeighborPreprocessor.java

示例11: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.IntParameter; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  IntParameter pagesizeP = new IntParameter(AbstractPageFileFactory.Parameterizer.PAGE_SIZE_ID, 1024);
  pagesizeP.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
  if(config.grab(pagesizeP)) {
    pagesize = pagesizeP.getValue();
  }
  IntParameter partitionsP = new IntParameter(Factory.PARTITIONS_ID);
  partitionsP.addConstraint(CommonConstraints.GREATER_THAN_ONE_INT);
  if(config.grab(partitionsP)) {
    numpart = partitionsP.getValue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:15,代码来源:PartialVAFile.java

示例12: 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(LOF.Parameterizer.K_ID);
  pK.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
  if(config.grab(pK)) {
    k = pK.getValue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:11,代码来源:SimplifiedLOF.java

示例13: makeOptions

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

  Flag binaryF = new Flag(BINARY_ID);
  if(config.grab(binaryF)) {
    binary = binaryF.isTrue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:15,代码来源:TopKOutlierScaling.java

示例14: 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

示例15: makeOptions

import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.IntParameter; //导入方法依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
  super.makeOptions(config);
  final IntParameter degreeP = new IntParameter(DEGREE_ID, DEFAULT_DEGREE);
  degreeP.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
  if(config.grab(degreeP)) {
    degree = degreeP.intValue();
  }
  final DoubleParameter biasP = new DoubleParameter(BIAS_ID);
  biasP.setOptional(true);
  if(config.grab(biasP)) {
    bias = biasP.doubleValue();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:15,代码来源:PolynomialKernelFunction.java


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