Package org.geppetto.core.model.runtime

Examples of org.geppetto.core.model.runtime.FunctionNode


   
    URLMetadataNode url = new URLMetadataNode("URL");
    url.setValue(new DoubleValue(2));
    url.setURL("hhtp://url.com");
   
    FunctionNode function = new FunctionNode("Function");
    function.setExpression("x=y^2");
    function.setName("hello");
   
    con1.getCustomNodes().add(text);
    con1.getCustomNodes().add(url);
    con1.getCustomNodes().add(function);
    con1.getVisualReferences().add(visObj);
View Full Code Here


    value.setScalingFactor("10");
    value.setUnit("ms");
    value.setValue(new DoubleValue(10));
    dynamics.setInitialConditions(value);

    FunctionNode function = new FunctionNode("Function");
    function.setExpression("y=x+2");
    List<String> argumentsF = new ArrayList<String>();
    argumentsF.add("1");
    argumentsF.add("2");
    function.setArgument(argumentsF);

    dynamics.setDynamics(function);

    ParameterSpecificationNode parameter = new ParameterSpecificationNode(
        "Parameter");

    PhysicalQuantity value1 = new PhysicalQuantity();
    value1.setScalingFactor("10");
    value1.setUnit("ms");
    value1.setValue(new DoubleValue(10));

    parameter.setValue(value1);

    FunctionNode functionNode = new FunctionNode("FunctionNode");
    functionNode.setExpression("y=x^2");
    List<String> arguments = new ArrayList<String>();
    arguments.add("1");
    functionNode.setArgument(arguments);

    AspectSubTreeNode visualization = new AspectSubTreeNode(
        AspectTreeType.VISUALIZATION_TREE);
    visualization.setModified(true);
View Full Code Here

    value.setScalingFactor("10");
    value.setUnit("ms");
    value.setValue(new DoubleValue(10));
    dynamics.setInitialConditions(value);

    FunctionNode function = new FunctionNode("Function");
    function.setExpression("y=x+2");
    List<String> argumentsF = new ArrayList<String>();
    argumentsF.add("1");
    argumentsF.add("2");
    function.setArgument(argumentsF);

    dynamics.setDynamics(function);

    ParameterSpecificationNode parameter = new ParameterSpecificationNode(
        "Parameter");

    PhysicalQuantity value1 = new PhysicalQuantity();
    value1.setScalingFactor("10");
    value1.setUnit("ms");
    value1.setValue(new DoubleValue(10));

    parameter.setValue(value1);

    FunctionNode functionNode = new FunctionNode("FunctionNode");
    functionNode.setExpression("y=x^2");
    List<String> arguments = new ArrayList<String>();
    arguments.add("1");
    functionNode.setArgument(arguments);

    AspectSubTreeNode visualization = new AspectSubTreeNode(
        AspectTreeType.VISUALIZATION_TREE);
    visualization.setModified(true);
View Full Code Here

    value.setScalingFactor("10");
    value.setUnit("ms");
    value.setValue(new DoubleValue(10));
    dynamics.setInitialConditions(value);

    FunctionNode function = new FunctionNode("Function");
    function.setExpression("y=x+2");
    List<String> argumentsF = new ArrayList<String>();
    argumentsF.add("1");
    argumentsF.add("2");
    function.setArgument(argumentsF);

    dynamics.setDynamics(function);

    ParameterSpecificationNode parameter = new ParameterSpecificationNode(
        "Parameter");

    PhysicalQuantity value1 = new PhysicalQuantity();
    value1.setScalingFactor("10");
    value1.setUnit("ms");
    value1.setValue(new DoubleValue(10));

    parameter.setValue(value1);

    FunctionNode functionNode = new FunctionNode("FunctionNode");
    functionNode.setExpression("y=x^2");
    List<String> arguments = new ArrayList<String>();
    arguments.add("1");
    functionNode.setArgument(arguments);

    AspectSubTreeNode visualization = new AspectSubTreeNode(
        AspectTreeType.VISUALIZATION_TREE);
    visualization.setModified(true);
View Full Code Here

  public boolean visitDynamicsSpecificationNode(DynamicsSpecificationNode node) {
    String commonProperties = this.commonProperties(node);

    PhysicalQuantity quantity = node.getInitialConditions();
    FunctionNode functionNode = node.getDynamics();

    String specs = "", function = "";

    if (quantity != null) {
      AValue value = quantity.getValue();
      String unit = null, scale = null;

      if (quantity.getUnit() != null) {
        unit = quantity.getUnit();
      }
      if (quantity.getScalingFactor() != null) {
        scale = "\"" + quantity.getScalingFactor() + "\"";
      }
      specs = "\"value\":" + "\"" + value + "\",\"unit\":" + "\"" + unit
          + "\",\"scale\":" + scale + ",";
    }

    if (functionNode != null) {

      String properties = "";

      if (functionNode.getArgument() != null) {
        List<String> arguments = functionNode.getArgument();

        properties = "," + "\"arguments\":{";

        for (int index = 0; index < arguments.size(); index++) {
          properties = properties.concat("\"" + index + "\":\""
              + arguments.get(index) + "\"");
          if (index < (arguments.size() - 1)) {
            properties = properties.concat(",");
          }
        }

        properties = properties.concat("}");
      }

      function = "\"_function\":{" + "\"expression\":" + "\""
          + functionNode.getExpression() + "\"" + properties + "},";
    }

    _serialized.append("\"" + node.getId() + "\":{" + specs + function
        + commonProperties + "},");
View Full Code Here

    value.setScalingFactor("10");
    value.setUnit("ms");
    value.setValue(new DoubleValue(10));
    dynamics.setInitialConditions(value);

    FunctionNode function = new FunctionNode("Function");
    function.setExpression("y=x+2");
    List<String> argumentsF = new ArrayList<String>();
    argumentsF.add("1");
    argumentsF.add("2");
    function.setArgument(argumentsF);

    dynamics.setDynamics(function);

    ParameterSpecificationNode parameter = new ParameterSpecificationNode(
        "Parameter");

    PhysicalQuantity value1 = new PhysicalQuantity();
    value1.setScalingFactor("10");
    value1.setUnit("ms");
    value1.setValue(new DoubleValue(10));

    parameter.setValue(value1);

    FunctionNode functionNode = new FunctionNode("FunctionNode");
    functionNode.setExpression("y=x^2");
    List<String> arguments = new ArrayList<String>();
    arguments.add("1");
    functionNode.setArgument(arguments);

    model.addChild(parameter);
    model.addChild(dynamics);
    model.addChild(functionNode);
View Full Code Here

    value.setScalingFactor("10");
    value.setUnit("ms");
    value.setValue(new DoubleValue(10));
    dynamics.setInitialConditions(value);

    FunctionNode function = new FunctionNode("Function");
    function.setExpression("y=x+2");
    List<String> argumentsF = new ArrayList<String>();
    argumentsF.add("1");
    argumentsF.add("2");
    function.setArgument(argumentsF);

    dynamics.setDynamics(function);

    ParameterSpecificationNode parameter = new ParameterSpecificationNode(
        "Parameter");
   
    ParameterSpecificationNode parameter2 = new ParameterSpecificationNode(
        "Parameter");

    PhysicalQuantity value1 = new PhysicalQuantity();
    value1.setScalingFactor("10");
    value1.setUnit("ms");
    value1.setValue(new DoubleValue(10));

    parameter.setValue(value1);
    parameter2.setValue(value1);

    FunctionNode functionNode = new FunctionNode("FunctionNode");
    functionNode.setExpression("y=x^2");
    List<String> arguments = new ArrayList<String>();
    arguments.add("1");
    functionNode.setArgument(arguments);

    first.addChild(parameter);
    first.addChild(dynamics);
    first.addChild(functionNode);
   
View Full Code Here

TOP

Related Classes of org.geppetto.core.model.runtime.FunctionNode

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.