Package com.opengamma.engine.depgraph

Examples of com.opengamma.engine.depgraph.DependencyGraph.addDependencyNode()


        for (ValueSpecification input : _nodeInputs[i]) {
          node.addInputValue(input);
        }
        node.addOutputValues(_nodeOutputs[i]);
        node.setFunction(new ParameterizedFunction(functions.getDefinition(_nodeFunctions[i]), _nodeParameters[i]));
        graph.addDependencyNode(node);
      }
      for (DependencyNode node : graph.getDependencyNodes()) {
        for (ValueSpecification inputValue : node.getInputValues()) {
          final DependencyNode inputNode = graph.getNodeProducing(inputValue);
          if (inputNode != null) {
View Full Code Here


  }

  private DependencyGraph copy(final DependencyGraph copyFrom) {
    final DependencyGraph copyTo = new DependencyGraph(copyFrom.getCalculationConfigurationName());
    for (DependencyNode node : copyFrom.getDependencyNodes()) {
      copyTo.addDependencyNode(getOrCreateCopy(node));
    }
    copyTo.addTerminalOutputs(copyFrom.getTerminalOutputs());
    return copyTo;
  }
View Full Code Here

      dependentNode.addInputNode(inputNode);
    }
   
    DependencyGraph graph = new DependencyGraph(calcConfigName);
    for (DependencyNode node : nodes) {
      graph.addDependencyNode(node);
    }
    return graph;
  }
 
}
View Full Code Here

    final ComputationTarget t1 = new ComputationTarget(ComputationTargetType.PORTFOLIO_NODE, new SimplePortfolioNode(UniqueId.of("Node", "0"), "node"));
    final DependencyNode n1 = new DependencyNode(t1.toSpecification());
    n1.setFunction(new MockFunction("F1", t1));
    n1.addOutputValue(new ValueSpecification("Foo", t1.toSpecification(), properties));
    n1.addTerminalOutputValue(new ValueSpecification("Foo", t1.toSpecification(), properties));
    graph.addDependencyNode(n1);
    final ComputationTarget t2 = new ComputationTarget(ComputationTargetType.POSITION, new SimplePosition(UniqueId.of("Pos", "0"), BigDecimal.ONE, ExternalId.of("Security", "Foo")));
    final DependencyNode n2 = new DependencyNode(t2.toSpecification());
    n2.setFunction(new MockFunction("F2", t1));
    n2.addOutputValue(new ValueSpecification("Foo", t2.toSpecification(), properties));
    n1.addInputValue(new ValueSpecification("Foo", t2.toSpecification(), properties));
View Full Code Here

    final DependencyNode n2 = new DependencyNode(t2.toSpecification());
    n2.setFunction(new MockFunction("F2", t1));
    n2.addOutputValue(new ValueSpecification("Foo", t2.toSpecification(), properties));
    n1.addInputValue(new ValueSpecification("Foo", t2.toSpecification(), properties));
    n1.addInputNode(n2);
    graph.addDependencyNode(n2);
    final ComputationTarget t3 = new ComputationTarget(ComputationTargetType.SECURITY, createSecurity(UniqueId.of("Pos", "0"), ExternalId.of("Security", "Foo")));
    final DependencyNode n3 = new DependencyNode(t3.toSpecification());
    n3.setFunction(new MockFunction("F3", t1));
    n3.addOutputValue(new ValueSpecification("Foo", t3.toSpecification(), properties));
    n2.addInputValue(new ValueSpecification("Foo", t3.toSpecification(), properties));
View Full Code Here

    final DependencyNode n3 = new DependencyNode(t3.toSpecification());
    n3.setFunction(new MockFunction("F3", t1));
    n3.addOutputValue(new ValueSpecification("Foo", t3.toSpecification(), properties));
    n2.addInputValue(new ValueSpecification("Foo", t3.toSpecification(), properties));
    n2.addInputNode(n3);
    graph.addDependencyNode(n3);
    graph.addTerminalOutput(new ValueRequirement("Foo", t1.toSpecification()), new ValueSpecification("Foo", t1.toSpecification(), properties));
    return graph;
  }

  private FunctionCompilationContext createFunctionCompilationContext() {
View Full Code Here

    yieldCurveNode.addOutputValue(new ValueSpecification(
        "YieldCurve",
        targetSpecification,
        ValueProperties.builder().with("Curve", "Forward3M").with("Function", "someFunction").get()));

    graph.addDependencyNode(yieldCurveNode);
    return graph;
  }

  private Map<String, Map<DistinctMarketDataSelector,FunctionParameters>> createEmptyViewCalcManipulations() {
    return new HashMap<>();
View Full Code Here

    return node;
  }

  private DependencyGraph graphNoStartEndTimes() {
    final DependencyGraph graph = new DependencyGraph("no start/end");
    graph.addDependencyNode(createDependencyNode(null, null));
    graph.addDependencyNode(createDependencyNode(null, null));
    return graph;
  }

  private DependencyGraph graphOneEndTime(final Instant end) {
View Full Code Here

  }

  private DependencyGraph graphNoStartEndTimes() {
    final DependencyGraph graph = new DependencyGraph("no start/end");
    graph.addDependencyNode(createDependencyNode(null, null));
    graph.addDependencyNode(createDependencyNode(null, null));
    return graph;
  }

  private DependencyGraph graphOneEndTime(final Instant end) {
    final DependencyGraph graph = new DependencyGraph("one end");
View Full Code Here

    return graph;
  }

  private DependencyGraph graphOneEndTime(final Instant end) {
    final DependencyGraph graph = new DependencyGraph("one end");
    graph.addDependencyNode(createDependencyNode(null, null));
    graph.addDependencyNode(createDependencyNode(null, end));
    return graph;
  }

  private DependencyGraph graphTwoEndTimes(final Instant end1, final Instant end2) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.