Package com.opengamma.engine.marketdata.manipulator

Examples of com.opengamma.engine.marketdata.manipulator.ScenarioDefinition


   */
  /* package */ List<ViewCycleExecutionOptions> cycleExecutionOptions(ViewCycleExecutionOptions baseOptions,
                                                                      Set<DistinctMarketDataSelector> allSelectors) {
    List<ViewCycleExecutionOptions> options = Lists.newArrayListWithCapacity(_scenarios.size());
    for (Scenario scenario : _scenarios.values()) {
      ScenarioDefinition definition = scenario.createDefinition();
      Map<DistinctMarketDataSelector, FunctionParameters> scenarioParams = definition.getDefinitionMap();
      Map<DistinctMarketDataSelector, FunctionParameters> params = Maps.newHashMap();
      params.putAll(scenarioParams);
      // if a selector isn't used by a particular scenario then it needs to have a no-op manipulator. if it didn't
      // then the manipulator from the previous scenario would be used
      Set<DistinctMarketDataSelector> unusedSelectors = Sets.difference(allSelectors, params.keySet());
View Full Code Here


      CompositeStructureManipulator compositeManipulator = new CompositeStructureManipulator(manipulators);
      SimpleFunctionParameters functionParameters = new SimpleFunctionParameters();
      functionParameters.setValue(StructureManipulationFunction.EXPECTED_PARAMETER_NAME, compositeManipulator);
      params.put(selector, functionParameters);
    }
    return new ScenarioDefinition(_name, params);
  }
View Full Code Here

  @Test
  public void parameters() {
    Map<String, Object> params = ImmutableMap.<String, Object>of("foo", "FOO", "bar", 123d);
    Scenario scenario = SimulationUtils.createScenarioFromDsl("src/test/groovy/ParametersTest.groovy", params);
    assertNotNull(scenario);
    ScenarioDefinition scenarioDefinition = scenario.createDefinition();
    Map<DistinctMarketDataSelector, FunctionParameters> definitionMap = scenarioDefinition.getDefinitionMap();
    PointSelector selector = new PointSelector(null, Sets.newHashSet(ExternalId.of("SCHEME", "FOO")), null, null, null, null, null);
    assertTrue(definitionMap.containsKey(selector));
    SimpleFunctionParameters functionParameters = (SimpleFunctionParameters) definitionMap.get(selector);
    CompositeStructureManipulator<?> composite = functionParameters.getValue(StructureManipulationFunction.EXPECTED_PARAMETER_NAME);
    StructureManipulator<?> manipulator = composite.getManipulators().get(0);
View Full Code Here

          ScenarioParameters scenarioParameters = configSource.getConfig(ScenarioParameters.class, scenarioParametersId);
          parameters = scenarioParameters.getParameters();
        } else {
          parameters = null;
        }
        ScenarioDefinition scenarioDefinition = scenarioDefinitionFactory.create(parameters);
        specificSelectors.put(calcConfig.getName(), new HashMap<>(scenarioDefinition.getDefinitionMap()));
      } else {
        // Ensure we have an entry for each graph, even if selectors are empty
        specificSelectors.put(calcConfig.getName(), ImmutableMap.<DistinctMarketDataSelector, FunctionParameters>of());
      }
    }
View Full Code Here

TOP

Related Classes of com.opengamma.engine.marketdata.manipulator.ScenarioDefinition

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.