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

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

Introduction

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

Prototype

int getInt(String key);

Source Link

Document

Get a int associated with the given configuration 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 {//from  w ww.  ja  v a2 s.co m
        setGenerations(2);
        (new ConfWarning("MicroGenerationsConvergence.Generations", 2)).warn();
    }
}

From source file:de.nec.nle.siafu.model.BinaryOverlay.java

/**
 * Create a binary overlay from an image.
 * //from   ww w  .  j a  v a2s  .c  om
 * @param name the overlay name
 * @param is the InputStream with the image that represents the values
 * @param simulationConfig the configuration with the threshold details
 */
public BinaryOverlay(final String name, final InputStream is, final Configuration simulationConfig) {
    super(name, is);

    threshold = simulationConfig.getInt("overlays." + name + "[@thresholdvalue]");
}

From source file:es.udc.gii.common.eaf.algorithm.operator.reproduction.mutation.MOPMutation.java

@Override
public void configure(Configuration conf) {
    super.configure(conf);
    this.mutationIndex = conf.getInt("MutationIndex");
}

From source file:es.udc.gii.common.eaf.benchmark.real_param.ShekelFamilyObjectiveFunction.java

@Override
public void configure(Configuration conf) {
    super.configure(conf);
    this.m = conf.getInt("M");
}

From source file:com.nesscomputing.config.SystemPropertiesTest.java

@Test
public void testDB2Configuration() {
    Assert.assertThat(cfg.getConfiguration().getBoolean("production", false), is(true));

    Configuration config = cfg.getConfiguration();

    Assert.assertThat(config.getString("t_s_d"), is("t_s"));
    Assert.assertThat(config.getInt("c.m_s"), is(2));

    Assert.assertThat(config.getBoolean("b.a"), is(true));
    Assert.assertThat(config.getBoolean("y.a"), is(false));

    Assert.assertThat(config.getString("s.f-l.u"), is("zzz"));
    Assert.assertThat(config.getBoolean("c.c.a"), is(true));
}

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 {/*from w  w  w.ja  v a 2s .c  o  m*/
        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:au.id.hazelwood.xmltvguidebuilder.config.ConfigFactory.java

private Map<Integer, ChannelConfig> loadChannelConfigs(HierarchicalConfiguration config) {
    Map<Integer, ChannelConfig> channelConfigById = new LinkedHashMap<>();
    for (Configuration channelConfig : getConfigurationList(config.configurationsAt("channels.channel"))) {
        int id = channelConfig.getInt("[@id]");
        String name = channelConfig.getString("");
        channelConfigById.put(id, new ChannelConfig(id, name));
    }//from  w w  w .j  av  a  2 s  .co  m
    return channelConfigById;
}

From source file:es.udc.gii.common.eaf.benchmark.multiobjective.dtlz2.R_Dtlz2_Objective.java

@Override
public void configure(Configuration conf) {
    super.configure(conf);

    this.objNumber = conf.getInt("ObjectiveNumber");
    this.numberOfObjectives = conf.getInt("NumberOfObjectives");
}

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

@Override
public void configure(Configuration conf) {
    super.configure(conf);

    /* Dimension of the parameter space. */
    this.dimension = conf.getInt("Dimension");

    initData(this.dimension);
}

From source file:es.udc.gii.common.eaf.log.parallel.BestIndividualLogTool.java

@Override
public void configure(Configuration conf) {
    try {/*from  w ww . ja  v  a 2s .c  om*/
        super.configure(conf);
        setNumber(conf.getInt("Number"));
    } catch (Exception ex) {
        ex.printStackTrace();
        System.exit(1);
    }
}