Package de.lmu.ifi.dbs.elki.utilities.optionhandling.constraints

Examples of de.lmu.ifi.dbs.elki.utilities.optionhandling.constraints.GreaterEqualConstraint


          absolute = absoluteF.getValue();
        }

        // Parameter delta
        double delta = 0.0;
        DoubleParameter deltaP = new DoubleParameter(LimitEigenPairFilter.EIGENPAIR_FILTER_DELTA, new GreaterEqualConstraint(0), DEFAULT_DELTA);
        if(config.grab(deltaP)) {
          delta = deltaP.getValue();
        }
        // Absolute flag doesn't have a sensible default value for delta.
        if(absolute && deltaP.tookDefaultValue()) {
View Full Code Here


      Flag absoluteF = new Flag(EIGENPAIR_FILTER_ABSOLUTE);
      if(config.grab(absoluteF)) {
        absolute = absoluteF.getValue();
      }

      DoubleParameter deltaP = new DoubleParameter(EIGENPAIR_FILTER_DELTA, new GreaterEqualConstraint(0), DEFAULT_DELTA);
      if(config.grab(deltaP)) {
        delta = deltaP.getValue();
        // TODO: make this a global constraint?
        if(absolute && deltaP.tookDefaultValue()) {
          config.reportError(new WrongParameterValueException("Illegal parameter setting: " + "Flag " + absoluteF.getName() + " is set, " + "but no value for " + deltaP.getName() + " is specified."));
        }
      }

      // Conditional Constraint:
      // delta must be >= 0 and <= 1 if it's a relative value
      // Since relative or absolute is dependent on the absolute flag this is a
      // global constraint!
      List<ParameterConstraint<Number>> cons = new Vector<ParameterConstraint<Number>>();
      // TODO: Keep the constraint here - applies to non-conditional case as
      // well,
      // and is set above.
      ParameterConstraint<Number> aboveNull = new GreaterEqualConstraint(0);
      cons.add(aboveNull);
      ParameterConstraint<Number> underOne = new LessEqualConstraint(1);
      cons.add(underOne);

      GlobalParameterConstraint gpc = new ParameterFlagGlobalConstraint<Number, Double>(deltaP, cons, absoluteF, false);
View Full Code Here

      final IntParameter PAGE_SIZE_PARAM = new IntParameter(PAGE_SIZE_ID, new GreaterConstraint(0), 4000);
      if(config.grab(PAGE_SIZE_PARAM)) {
        pageSize = PAGE_SIZE_PARAM.getValue();
      }

      LongParameter CACHE_SIZE_PARAM = new LongParameter(CACHE_SIZE_ID, new GreaterEqualConstraint(0), Integer.MAX_VALUE);
      if(config.grab(CACHE_SIZE_PARAM)) {
        cacheSize = CACHE_SIZE_PARAM.getValue();
      }
    }
View Full Code Here

      if(config.grab(minfreqP)) {
        minfreq = minfreqP.getValue();
      }

      IntParameter minsuppP = new IntParameter(MINSUPP_ID, true);
      minsuppP.addConstraint(new GreaterEqualConstraint(0));
      if(config.grab(minsuppP)) {
        minsupp = minsuppP.getValue();
      }

      // global parameter constraints
View Full Code Here

      }
    }

    public void configAccuracy(Parameterization config) {
      IntParameter outputAccuracyP = new IntParameter(OUTPUT_ACCURACY_ID, 4);
      outputAccuracyP.addConstraint(new GreaterEqualConstraint(0));
      if(config.grab(outputAccuracyP)) {
        outputAccuracy = outputAccuracyP.getValue();
      }
    }
View Full Code Here

    protected int numbins = 20;

    @Override
    protected void makeOptions(Parameterization config) {
      super.makeOptions(config);
      final IntParameter param = new IntParameter(HISTOGRAM_BINS_ID, new GreaterEqualConstraint(2), 100);
      if(config.grab(param)) {
        numbins = param.getValue();
      }
    }
View Full Code Here

          absolute = absoluteF.getValue();
        }

        // Parameter delta
        double delta = 0.0;
        DoubleParameter deltaP = new DoubleParameter(LimitEigenPairFilter.EIGENPAIR_FILTER_DELTA, new GreaterEqualConstraint(0), DEFAULT_DELTA);
        if(config.grab(deltaP)) {
          delta = deltaP.getValue();
        }
        // Absolute flag doesn't have a sensible default value for delta.
        if(absolute && deltaP.tookDefaultValue()) {
View Full Code Here

    protected Long seed = null;

    @Override
    protected void makeOptions(Parameterization config) {
      super.makeOptions(config);
      final IntParameter mP = new IntParameter(M_ID, new GreaterEqualConstraint(2));
      if(config.grab(mP)) {
        m = mP.getValue();
      }
      final LongParameter seedP = new LongParameter(SEED_ID, true);
      if(config.grab(seedP)) {
View Full Code Here

      super.makeOptions(config);
      final IntParameter pK = new IntParameter(LOF.K_ID, new GreaterConstraint(1));
      if(config.grab(pK)) {
        k = pK.getValue();
      }
      IntParameter NUM_PARAM = new IntParameter(NUM_ID, new GreaterEqualConstraint(1));
      if(config.grab(NUM_PARAM)) {
        num = NUM_PARAM.getValue();
      }
      Flag BREADTH_FLAG = new Flag(BREADTH_ID);
      if(config.grab(BREADTH_FLAG)) {
View Full Code Here

    private boolean exact = false;

    @Override
    protected void makeOptions(Parameterization config) {
      super.makeOptions(config);
      final IntParameter numbinP = new IntParameter(HISTOGRAM_BINS_ID, new GreaterEqualConstraint(2), 20);
      if(config.grab(numbinP)) {
        numbin = numbinP.getValue();
      }

      final Flag EXACT_FLAG = new Flag(EXACT_ID);
View Full Code Here

TOP

Related Classes of de.lmu.ifi.dbs.elki.utilities.optionhandling.constraints.GreaterEqualConstraint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.