Package org.jamesii.core.math.random.generators.plugintype

Examples of org.jamesii.core.math.random.generators.plugintype.RandomGeneratorFactory


  @Override
  public IPortfolioSelector create(ParameterBlock params, Context context) {
    ParameterBlock rngParameters =
        ParameterUtils.getFactorySubBlock(params, RandomGeneratorFactory.class);
    RandomGeneratorFactory mbFac =
        SimSystem.getRegistry().getFactory(
            AbstractRandomGeneratorFactory.class, rngParameters);
    return new StochSearchPortfolioSelector(params.getSubBlockValue(
        SAMPLE_SIZE, DEFAULT_SAMPLE_SIZE), mbFac.create(rngParameters, SimSystem.getRegistry().createContext()));
  }
View Full Code Here


* @return An instance of the respective random number generator.
   */
  @Override
  public IRandom create(ParameterBlock block, Context context) {

    RandomGeneratorFactory factory = null;
    try {
      factory =
          (RandomGeneratorFactory) Class.forName(
              (String) ParameterBlocks.getSubBlockValue(block, "PRNG"))
              .newInstance();
    } catch (InstantiationException | IllegalAccessException
        | ClassNotFoundException e) {
      SimSystem.report(e);
      return null;
    }
    return new InitPhaseSkipGenerator(factory.create(block, SimSystem.getRegistry().createContext()));
  }
View Full Code Here

TOP

Related Classes of org.jamesii.core.math.random.generators.plugintype.RandomGeneratorFactory

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.