Package org.jamesii.core.parameters

Examples of org.jamesii.core.parameters.ParameterBlock


public class IntEstimTest extends TestPolicyPerformance {

  @Override
  protected Pair<MinBanditPolicyFactory, ParameterBlock> getPolicySetup() {
    return new Pair<MinBanditPolicyFactory, ParameterBlock>(
        new IntEstimFactory(), new ParameterBlock());
  }
View Full Code Here


public class SoftMaxDecreasingTest extends TestPolicyPerformance {

  @Override
  protected Pair<MinBanditPolicyFactory, ParameterBlock> getPolicySetup() {
    return new Pair<MinBanditPolicyFactory, ParameterBlock>(
        new SoftMaxDecreasingFactory(), new ParameterBlock());
  }
View Full Code Here

    HashMap<String, Serializable> params = new HashMap<>();
    params.put(PARAMETER_1_NAME, PARAMETER_1);
    params.put(PARAMETER_2_NAME, PARAMETER_2);
    simProb.setSchemeParameters(params);
    simProb.setDefinitionParameters(SimulationProblemDefinition
        .getDefinitionParameters(testStopTimePolicyFactory, new ParameterBlock(
            TEST_STOP_TIME, SimTimeStopFactory.SIMEND)));
    return simProb;
  }
View Full Code Here

      Files.save(options, OPTION_FILE);
    }

    // Set parameters of runner
    policyParams.setValue(factory.getClass().getName());
    ParameterBlock runnerParams = new ParameterBlock();
    runnerParams
        .addSubBl(AdaptiveTaskRunnerFactory.POLICY_OBSERVERS, observers)
        .addSubBl(AdaptiveTaskRunnerFactory.POLICY, policyParams)
        .addSubBl(AdaptiveTaskRunnerFactory.BLACK_LIST, blackList)
        .addSubBl(AdaptiveTaskRunnerFactory.PORTFOLIO, options)
        .addSubBl(ParallelComputationTaskRunnerFactory.NUM_CORES, 4);
View Full Code Here

  protected List<ParameterBlock> createParameterBlocks(String modelLocation,
      List<String> blackList) {
    SelectionTreeSet treeSet = null;
    try {
      treeSet =
          SelTreeSetCreation.createSelectionTreeSet(new ParameterBlock(),
              new URI(modelLocation), new HashMap<String, Object>());
    } catch (Exception ex) {
      ex.printStackTrace();
    }
    treeSet.generateFactoryCombinations(blackList);
View Full Code Here

public class EpsilonFirstTest extends TestPolicyPerformance {

  @Override
  protected Pair<MinBanditPolicyFactory, ParameterBlock> getPolicySetup() {
    return new Pair<MinBanditPolicyFactory, ParameterBlock>(
        new EpsilonFirstFactory(), new ParameterBlock());
  }
View Full Code Here

      aggregatedData.setPortfolioQuality(generator.evaluatePortfolio(portfolios
          .getFirstValue()));

      for (MinBanditPolicyFactory policyFactory : policyFactories) {
        IMinBanditPolicy policy = policyFactory.create(new ParameterBlock(), SimSystem.getRegistry().createContext());
        SimSystem.report(Level.INFO, "\tExecuting policy:" + policy.getClass());
        aggregatedData.registerGAPerformance(
            description,
            Strings.dispClassName(policy.getClass()),
            runPolicyOnPortfolio(configDesc + "_r" + i + "_", policy,
View Full Code Here

  public void setUp() {

    testTree1 = new SelectionTree(null);
    SelectedFactoryNode sfn1 =
        new SelectedFactoryNode(new SelectionInformation<>(
            AbstractProcessorFactory.class, new ParameterBlock(),
            new BogusSimulatorFactoryA()));
    testTree1.addVertex(sfn1);
    testTree1.addEdge(new Edge<>(sfn1, testTree1.getRoot()));

    testTree2 = new SelectionTree(null);
    SelectedFactoryNode sfn2 =
        new SelectedFactoryNode(new SelectionInformation<>(
            AbstractProcessorFactory.class, new ParameterBlock(),
            new BogusSimulatorFactoryA()));
    testTree2.addVertex(sfn2);
    testTree2.addEdge(new Edge<>(sfn2, testTree2.getRoot()));

    testTree3 = new SelectionTree(null);
    SelectedFactoryNode sfn3 =
        new SelectedFactoryNode(new SelectionInformation<>(
            AbstractProcessorFactory.class, (new ParameterBlock()).addSubBl(
                FlexibleBogusSimulatorFactory.SIM_PROPERTIES,
                TEST_PARAMETER_VALUE), new FlexibleBogusSimulatorFactory()));
    testTree3.addVertex(sfn3);
    testTree3.addEdge(new Edge<>(sfn3, testTree3.getRoot()));

    testTree4 = new SelectionTree(null);
    SelectedFactoryNode sfn4 =
        new SelectedFactoryNode(new SelectionInformation<>(
            AbstractProcessorFactory.class, new ParameterBlock().addSubBl(
                "test1", 1.0).addSubBl("test2", 2.0),
            new BogusSimulatorFactoryA()));
    testTree4.addVertex(sfn4);
    testTree4.addEdge(new Edge<>(sfn4, testTree4.getRoot()));
  }
View Full Code Here

    assertFalse(EqualsCheck.equals(testTree1, testTree4));

    SelectedFactoryNode factoryNode =
        testTree1.getChildren(testTree1.getRoot()).get(0);
    SelectionInformation<?> si = factoryNode.getSelectionInformation();
    ParameterBlock pb = si.getParameter();
    pb.addSubBl("test1", 1.0).addSubBl("test2", 2.0);

    SelectionInformation<?> newSelectionInformation =
        new SelectionInformation<>(
            AbstractProcessorFactory.class, pb, new BogusSimulatorFactoryA());
    SelectedFactoryNode newFactoryNode =
View Full Code Here

  /**
   * Tests conversion to {@link ParameterBlock}.
   */
  public void testParamBlockConversion() {

    ParameterBlock pb1 = testTree1.toParamBlock();
    ParameterBlock pb2 = testTree2.toParamBlock();

    assertEquals(0, pb1.compareTo(pb2));
    assertNotNull(pb1.getSubBlock(ProcessorFactory.class.getName()));
    assertEquals(pb1.getSubBlockValue(ProcessorFactory.class.getName()),
        (new BogusSimulatorFactoryA()).getClass().getName());
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.