Examples of AspectSubTreeNode


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

    EntityNode entity_A = new EntityNode("Entity_A");

    AspectNode aspect_A = new AspectNode("Aspect_A");

    AspectSubTreeNode model = new AspectSubTreeNode(
        AspectTreeType.MODEL_TREE);

    AspectSubTreeNode visualization = new AspectSubTreeNode(
        AspectTreeType.VISUALIZATION_TREE);

    AspectSubTreeNode simulation = new AspectSubTreeNode(
        AspectTreeType.WATCH_TREE);

    runtime.addChild(entity_A);
    entity_A.getAspects().add(aspect_A);
    entity_A.setModified(true);
View Full Code Here

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

    EntityNode entity_A = new EntityNode("Entity_A");

    AspectNode aspect_A = new AspectNode("Aspect_A");

    AspectSubTreeNode model = new AspectSubTreeNode(
        AspectTreeType.MODEL_TREE);

    AspectSubTreeNode visualization = new AspectSubTreeNode(
        AspectTreeType.VISUALIZATION_TREE);

    visualization.setModified(false);

    AspectSubTreeNode simulation = new AspectSubTreeNode(
        AspectTreeType.WATCH_TREE);

    simulation.setModified(false);

    runtime.addChild(entity_A);
    entity_A.getAspects().add(aspect_A);
    entity_A.setModified(true);
    aspect_A.setParent(entity_A);
View Full Code Here

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

    EntityNode entity_A = new EntityNode("Entity_A");

    AspectNode aspect_A = new AspectNode("Aspect_A");

    AspectSubTreeNode model = new AspectSubTreeNode(
        AspectTreeType.MODEL_TREE);
    model.setModified(false);
    AspectSubTreeNode visualization = new AspectSubTreeNode(
        AspectTreeType.VISUALIZATION_TREE);
    visualization.setModified(false);
    AspectSubTreeNode simulation = new AspectSubTreeNode(
        AspectTreeType.WATCH_TREE);

    runtime.addChild(entity_A);
    entity_A.getAspects().add(aspect_A);
    entity_A.setModified(true);
View Full Code Here

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

    EntityNode entity_A = new EntityNode("Entity_A");

    AspectNode aspect_A = new AspectNode("Aspect_A");

    AspectSubTreeNode model = new AspectSubTreeNode(
        AspectTreeType.MODEL_TREE);
    model.setModified(false);
    AspectSubTreeNode visualization = new AspectSubTreeNode(
        AspectTreeType.VISUALIZATION_TREE);

    AspectSubTreeNode simulation = new AspectSubTreeNode(
        AspectTreeType.WATCH_TREE);
    simulation.setModified(false);

    runtime.addChild(entity_A);
    entity_A.getAspects().add(aspect_A);
    entity_A.setModified(true);
    aspect_A.setParent(entity_A);
View Full Code Here

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

  /**
   * Test Model Tree. Emulates retrieving model tree for aspect
   */
  @Test
  public void emulateGetModelTree() {
    AspectSubTreeNode model = new AspectSubTreeNode(
        AspectTreeType.MODEL_TREE);

    model.setModified(true);

    DynamicsSpecificationNode dynamics = new DynamicsSpecificationNode(
        "Dynamics");

    PhysicalQuantity value = new PhysicalQuantity();
    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);

    SerializeTreeVisitor visitor = new SerializeTreeVisitor();
    model.apply(visitor);
    String serialized = "{" + visitor.getSerializedTree() + "}";
    System.out.println(serialized);

    Gson gson = new GsonBuilder().setPrettyPrinting().create();
    JsonParser jp = new JsonParser();
View Full Code Here

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

  /**
   * Test Model Tree. Emulates retrieving model tree for aspect
   */
  @Test
  public void childWithSameIds() {
    AspectSubTreeNode model = new AspectSubTreeNode(
        AspectTreeType.MODEL_TREE);

    model.setModified(true);
   
    CompositeNode first = new CompositeNode("One");
    first.setId("One_1");
   
    CompositeNode second = new CompositeNode("One");
    second.setId("One_2");

    DynamicsSpecificationNode dynamics = new DynamicsSpecificationNode(
        "Dynamics");

    PhysicalQuantity value = new PhysicalQuantity();
    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);
   
    second.addChild(parameter2);

    model.addChild(first);
    model.addChild(second);
   
    SerializeTreeVisitor visitor = new SerializeTreeVisitor();
    model.apply(visitor);
    String serialized = "{" + visitor.getSerializedTree() + "}";
    System.out.println(serialized);

    Gson gson = new GsonBuilder().setPrettyPrinting().create();
    JsonParser jp = new JsonParser();
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.