本文整理汇总了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);
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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;
}
}
示例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();
}
}
示例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();
}
}