Example usage for org.apache.commons.configuration Configuration containsKey

List of usage examples for org.apache.commons.configuration Configuration containsKey

Introduction

In this page you can find the example usage for org.apache.commons.configuration Configuration containsKey.

Prototype

boolean containsKey(String key);

Source Link

Document

Check if the configuration contains the specified key.

Usage

From source file:es.udc.gii.common.eaf.stoptest.mga.MicroGenerationsConvergence.java

@Override
public void configure(Configuration conf) {
    if (conf.containsKey("Generations")) {
        setGenerations(conf.getInt("Generations"));
    } else {/*  www.j  a v  a 2  s.co m*/
        setGenerations(2);
        (new ConfWarning("MicroGenerationsConvergence.Generations", 2)).warn();
    }
}

From source file:es.udc.gii.common.eaf.stoptest.cma.CMATolXStopTest.java

@Override
public void configure(Configuration conf) {

    if (conf.containsKey("TolX")) {
        this.tol_x = conf.getDouble("TolX");
    } else {/*from   ww w.  ja  v  a 2s. c  o m*/
        ConfWarning w = new ConfWarning("TolX", this.tol_x);
        w.warn();
    }

    if (conf.containsKey("TolXFactor")) {
        this.tol_x_factor = conf.getDouble("TolXFactor");
    } else {
        ConfWarning w = new ConfWarning("TolXFactor", this.tol_x_factor);
        w.warn();
    }

}

From source file:es.udc.gii.common.eaf.plugin.parameter.LinearAnnealing.java

@Override
public void configure(Configuration conf) {
    if (conf.containsKey("A")) {
        this.a = conf.getDouble("A");
    }/*from w ww  . j  a va2 s.  c om*/
    if (conf.containsKey("B")) {
        this.b = conf.getDouble("B");
    }
    if (conf.containsKey("C")) {
        this.c = conf.getDouble("C");
    }
    try {
        if (conf.containsKey("Counter.Class")) {
            this.counter = (StopTestPlugin) Class.forName(conf.getString("Counter.Class")).newInstance();
            this.counter.configure(conf.subset("Counter"));
        }
    } catch (Exception ex) {
        ex.printStackTrace();
    }
}

From source file:es.udc.gii.common.eaf.stoptest.GeneDifferenceConvergence.java

@Override
public void configure(Configuration conf) {
    if (conf.containsKey("MaxDifference")) {
        this.maxDifference = conf.getDouble("MaxDifference");
    } else {//from  w  ww.  ja v a  2  s.com
        (new ConfWarning("MaxDifference", 10e-6)).warn();
    }
}

From source file:com.linkedin.pinot.transport.conf.TransportClientConf.java

public void init(Configuration cfg) throws ConfigurationException {
    if (cfg.containsKey(ROUTING_MODE_KEY)) {
        _routingMode = RoutingMode.valueOf(cfg.getString(ROUTING_MODE_KEY));
    }/*from  ww  w  . j  a va  2  s .  co  m*/
    if ((_routingMode == RoutingMode.CONFIG)) {
        _cfgBasedRouting.init(cfg.subset(CFG_BASED_ROUTING));
    }

    Configuration connPoolCfg = cfg.subset(CONNECTION_POOL_CONFIG);
    if (connPoolCfg != null) {
        _connPool.init(connPoolCfg);
    }
}

From source file:es.udc.gii.common.eaf.algorithm.restart.IPOPRestartStrategy.java

@Override
public void configure(Configuration conf) {

    if (conf.containsKey("MaxNumRestarts")) {
        this.max_num_restarts = conf.getInt("MaxNumRestarts");
    } else {/*  w ww  . ja va 2s. c  om*/
        ConfWarning w = new ConfWarning(this.getClass().getSimpleName() + ".MaxNumRestarts",
                this.max_num_restarts);
        w.warn();
    }

    if (conf.containsKey("IncrPopFactor")) {
        this.incr_factor = conf.getDouble("IncrPopFactor");
    } else {
        ConfWarning w = new ConfWarning(this.getClass().getSimpleName() + ".IncrPopFactor", this.incr_factor);
        w.warn();
    }
}

From source file:es.udc.gii.common.eaf.benchmark.multiobjective.sch1.Sch1_Objective_1.java

@Override
public void configure(Configuration conf) {
    super.configure(conf);
    if (conf.containsKey("MAX")) {
        this.MAX = conf.getDouble("MAX");
    } else {/*from  w  w  w  . ja v  a  2  s .c  o  m*/
        (new ConfWarning("Sch1_Objective_1.MAX", MAX)).warn();
    }
}

From source file:es.udc.gii.common.eaf.benchmark.multiobjective.sch1.Sch1_Objective_2.java

@Override
public void configure(Configuration conf) {
    super.configure(conf);
    if (conf.containsKey("MAX")) {
        this.MAX = conf.getDouble("MAX");
    } else {//from w w  w .j a  v a  2s.c o m
        (new ConfWarning("Sch1_Objective_2.MAX", MAX)).warn();
    }
}

From source file:es.udc.gii.common.eaf.problem.constraint.EqualityConstraint.java

@Override
public void configure(Configuration conf) {
    super.configure(conf);
    if (conf.containsKey("Threshold")) {
        this.threshold = conf.getDouble("Threshold");
    } else {/*from w w w  . j a v  a  2s . c o m*/
        ConfWarning w = new ConfWarning("Threshold", this.threshold);
        w.warn();
    }
}

From source file:es.udc.gii.common.eaf.stoptest.GeneRateConvergence.java

@Override
public void configure(Configuration conf) {
    if (conf.containsKey("MaxDifference")) {
        this.maxDifference = conf.getDouble("MaxDifference");
    } else {/*from   w  w w.  j  a va2s  .c  o m*/
        (new ConfWarning("MaxDifference", 10e-6)).warn();
    }

    if (conf.containsKey("ConvergenceRate")) {
        this.convergenceRate = conf.getDouble("ConvergenceRate");
    } else {
        (new ConfWarning("ConvergenceRate", 0.9)).warn();
    }
}