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

Examples of de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.Flag


      IntParameter P_PARAM = new IntParameter(P_ID, new GreaterConstraint(0));
      if(config.grab(P_PARAM)) {
        p = P_PARAM.getValue();
      }

      Flag NOLOG_FLAG = new Flag(NOLOG_ID);
      if(config.grab(NOLOG_FLAG)) {
        log = !NOLOG_FLAG.getValue();
      }
    }
View Full Code Here


      DoubleParameter maxP = new DoubleParameter(MAX_ID, true);
      if(config.grab(maxP)) {
        max = maxP.getValue();
      }

      Flag meanF = new Flag(MEAN_ID);
      if(config.grab(meanF)) {
        usemean = meanF.getValue();
      }

      Flag nozerosF = new Flag(NOZEROS_ID);
      if(config.grab(nozerosF)) {
        nozeros = nozerosF.getValue();
      }

      // Use-Mean and Minimum value must not be set at the same time!
      ArrayList<Parameter<?, ?>> minmean = new ArrayList<Parameter<?, ?>>();
      minmean.add(minP);
View Full Code Here

      protected boolean fill = true;

      @Override
      protected void makeOptions(Parameterization config) {
        super.makeOptions(config);
        Flag fillF = new Flag(TreeMBRVisualization.Factory.FILL_ID);
        fillF.setDefaultValue(true);
        if(config.grab(fillF)) {
          fill = fillF.getValue();
        }
      }
View Full Code Here

    protected boolean normalize = false;

    @Override
    protected void makeOptions(Parameterization config) {
      super.makeOptions(config);
      Flag normalizeF = new Flag(NORMALIZE_ID);
      if(config.grab(normalizeF)) {
        normalize = normalizeF.getValue();
      }
    }
View Full Code Here

      IntParameter kP = new IntParameter(K_ID, new GreaterConstraint(1));
      if(config.grab(kP)) {
        k = kP.getValue();
      }

      Flag binaryF = new Flag(BINARY_ID);
      if(config.grab(binaryF)) {
        binary = binaryF.getValue();
      }
    }
View Full Code Here

      DoubleParameter tauP = new DoubleParameter(TAU_ID, new IntervalConstraint(0, IntervalConstraint.IntervalBoundary.OPEN, 1, IntervalConstraint.IntervalBoundary.OPEN));
      if(config.grab(tauP)) {
        tau = tauP.getValue();
      }

      Flag pruneF = new Flag(PRUNE_ID);
      if(config.grab(pruneF)) {
        prune = pruneF.getValue();
      }
    }
View Full Code Here

    protected double scale;

    @Override
    protected void makeOptions(Parameterization config) {
      super.makeOptions(config);
      Flag nocenterF = new Flag(NOCENTER_ID);
      if(config.grab(nocenterF)) {
        nocenter = nocenterF.getValue();
      }

      DoubleParameter scaleP = new DoubleParameter(SCALE_ID, new GreaterEqualConstraint(0.0), 1.0);
      if(config.grab(scaleP)) {
        scale = scaleP.getValue();
View Full Code Here

      DoubleParameter maxP = new DoubleParameter(MAX_ID, true);
      if(config.grab(maxP)) {
        max = maxP.getValue();
      }

      Flag meanF = new Flag(MEAN_ID);
      if(config.grab(meanF)) {
        usemean = meanF.getValue();
      }

      Flag nozerosF = new Flag(NOZEROS_ID);
      if(config.grab(nozerosF)) {
        nozeros = nozerosF.getValue();
      }

      // Use-Mean and Minimum value must not be set at the same time!
      ArrayList<Parameter<?, ?>> minmean = new ArrayList<Parameter<?, ?>>();
      minmean.add(minP);
View Full Code Here

   *
   * @param cls Application class to run.
   * @param args the arguments to run this application with
   */
  public static void runCLIApplication(Class<?> cls, String[] args) {
    final Flag HELP_FLAG = new Flag(OptionID.HELP);
    final Flag HELP_LONG_FLAG = new Flag(OptionID.HELP_LONG);
    final ClassParameter<Object> DESCRIPTION_PARAM = new ClassParameter<Object>(OptionID.DESCRIPTION, Object.class, true);
    final StringParameter DEBUG_PARAM = new StringParameter(OptionID.DEBUG, true);

    SerializedParameterization params = new SerializedParameterization(args);
    try {
      params.grab(HELP_FLAG);
      params.grab(HELP_LONG_FLAG);
      params.grab(DESCRIPTION_PARAM);
      params.grab(DEBUG_PARAM);
      if(DESCRIPTION_PARAM.isDefined()) {
        params.clearErrors();
        printDescription(DESCRIPTION_PARAM.getValue());
        return;
      }
      // Fail silently on errors.
      if(params.getErrors().size() > 0) {
        params.logAndClearReportedErrors();
        return;
      }
      if(DEBUG_PARAM.isDefined()) {
        LoggingUtil.parseDebugParameter(DEBUG_PARAM);
      }
    }
    catch(Exception e) {
      printErrorMessage(e);
      return;
    }
    try {
      TrackParameters config = new TrackParameters(params);
      AbstractApplication task = ClassGenericsUtil.tryInstantiate(AbstractApplication.class, cls, config);

      if((HELP_FLAG.isDefined() && HELP_FLAG.getValue()) || (HELP_LONG_FLAG.isDefined() && HELP_LONG_FLAG.getValue())) {
        LoggingConfiguration.setVerbose(true);
        STATIC_LOGGER.verbose(usage(config.getAllParameters()));
      }
      else {
        params.logUnusedParameters();
View Full Code Here

     * Get the verbose parameter.
     *
     * @param config Parameterization
     */
    protected void configVerbose(Parameterization config) {
      final Flag verboseF = new Flag(OptionID.VERBOSE_FLAG);
      if(config.grab(verboseF)) {
        verbose = verboseF.getValue();
      }
    }
View Full Code Here

TOP

Related Classes of de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.Flag

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.