Package org.jamesii.core.parameters

Examples of org.jamesii.core.parameters.ParameterBlock


   * @return the parameter block
   */
  protected ParameterBlock selectFromManagers(ParameterBlock parameters,
      List<SelectorManager> applSelManagers) {
    for (SelectorManager selectorManager : applSelManagers) {
      ParameterBlock result = selectFromManager(parameters, selectorManager);
      if (result != null) {
        return result;
      }
    }
    return null;
View Full Code Here


   *          the simulation problem
   *
   * @return the instantiated model
   */
  protected static IModel instantiateModel(IProblemDefinition simProblem) {
    ParameterBlock amrwfp =
        new ParameterBlock(simProblem.getProblemScheme().getUri(),
            IURIHandling.URI);
    ModelReaderFactory mrwf =
        SimSystem.getRegistry().getFactory(AbstractModelReaderFactory.class,
            amrwfp);
    Map<String, Serializable> parameters = new HashMap<>();
    parameters.putAll(simProblem.getSchemeParameters());
    return mrwf.create(null, SimSystem.getRegistry().createContext()).read(
        (URI) amrwfp.getSubBlockValue(IURIHandling.URI), parameters);
  }
View Full Code Here

  protected ParameterBlock nextConfigToExplore() {

    // Exploration will be done by the ASR
    if (!explorationStarted) {
      explorationStarted = true;
      return new ParameterBlock();
    }

    // In case exploration has already been done, just quit
    explorationStarted = false;
    return null;
View Full Code Here

    return null;
  }

  @Override
  public ParameterBlock getExperimentParameters() {
    ParameterBlock paramBlock = super.getExperimentParameters();
    if (getPhase() == ExplorationPhase.EXPLORATION) {
      List<ParameterizedFactory<RepCriterionFactory>> repCriterionFactories =
          new ArrayList<>();
      repCriterionFactories.add(new ParameterizedFactory<RepCriterionFactory>(
          new RepNumberCriterionFactory(), new ParameterBlock().addSubBl(
              RepNumberCriterionFactory.NUM_REPS, getNumOfReplications())));
      paramBlock.addSubBlock(
          ExperimentVariables.REPLICATION_CRITERION_FACTORIES,
          repCriterionFactories);
    }
    return paramBlock;
  }
View Full Code Here

  /** The default sample size. */
  private static final int DEFAULT_SAMPLE_SIZE = 10000;

  @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(
View Full Code Here

   */
  private boolean changeParameter(
      Pair<BaseVariable<?>, ParameterBlock> parameterToChange,
      QuantitativeBaseVariable<?> variable, boolean increase) {

    ParameterBlock blockToChange = parameterToChange.getSecondValue();

    if (variable instanceof DoubleVariable) {
      return handleDoubleVariable(variable, increase, blockToChange);
    } else if (variable instanceof IntVariable) {
      return handleIntVariable(variable, increase, blockToChange);
View Full Code Here

    if (p1.getSubBlocks().size() != p2.getSubBlocks().size()) {
      return false;
    }

    for (Entry<String, ParameterBlock> subBlock : p1.getSubBlocks().entrySet()) {
      ParameterBlock compSB = p2.getSubBlock(subBlock.getKey());
      if (compSB == null
          || !structuralEqualityParamBlocks(compSB, subBlock.getValue())) {
        return false;
      }
    }
View Full Code Here

   *          the sub-blocks to ignore
   * @return true, if successful
   */
  public static boolean matchSubBlock(String subBlockName, ParameterBlock p1,
      ParameterBlock p2, String... subBlocksToIgnore) {
    ParameterBlock firstMatchParamBlock =
        p1.hasSubBlock(subBlockName) ? p1.getSubBlock(subBlockName) : p1;
    ParameterBlock secondMatchParamBlock =
        p2.hasSubBlock(subBlockName) ? p2.getSubBlock(subBlockName) : p2;
    return matchParamBlocks(firstMatchParamBlock, secondMatchParamBlock,
        subBlocksToIgnore);
  }
View Full Code Here

   *          the parameters with which the model shall be initialised
   * @return instantiated model
   */
  public static IModel instantiateModel(ParameterBlock rwSimCfgParams,
      URI modelLocation, Map<String, ?> modelParameters) {
    ParameterBlock rwParams = rwSimCfgParams == null ? new ParameterBlock()
        : rwSimCfgParams.getCopy();
    rwParams.addSubBlock(IURIHandling.URI, new ParameterBlock(modelLocation));
    ModelReaderFactory modelReaderWriterFactory = SimSystem.getRegistry()
        .getFactory(AbstractModelReaderFactory.class, rwParams);
    IModel model = modelReaderWriterFactory.create(rwParams, SimSystem.getRegistry().createContext()).read(
        modelLocation, modelParameters);
    return model;
View Full Code Here

   *           the class not found exception
   */
  public static SelectionTreeSet createSelectionTreeSet(
      ParameterBlock rwSimCfgParams, URI modelLocation,
      Map<String, ?> modelParameters) throws ClassNotFoundException {
    ParameterBlock treeSetParams = new ParameterBlock(
        new AbstractExecutablePartition(instantiateModel(rwSimCfgParams,
            modelLocation, modelParameters), null, null),
        AbstractProcessorFactory.PARTITION);
    return new SelectionTreeSet(AbstractProcessorFactory.class, treeSetParams);
  }
View Full Code Here

TOP

Related Classes of org.jamesii.core.parameters.ParameterBlock

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.