Package org.geppetto.core.model.runtime

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


        AspectTreeType.WATCH_TREE);
    simulation.setModified(true);

    CompositeNode hhpop = new CompositeNode("hhpop[0]");

    VariableNode v = new VariableNode("v");
    PhysicalQuantity quantity = new PhysicalQuantity();
    quantity.setValue(ValuesFactory.getDoubleValue(20d));

    PhysicalQuantity quantity2 = new PhysicalQuantity();
    quantity2.setValue(ValuesFactory.getDoubleValue(100d));

    v.addPhysicalQuantity(quantity);
    v.addPhysicalQuantity(quantity2);

    ParameterNode a1 = new ParameterNode("a");

    runtimeTree.addChild(entity1);
    runtimeTree.addChild(entity2);
View Full Code Here


        AspectTreeType.WATCH_TREE);
    simulation.setModified(true);

    CompositeNode hhpop = new CompositeNode("hhpop[0]");

    VariableNode v = new VariableNode("v");
    PhysicalQuantity quantity = new PhysicalQuantity();
    quantity.setValue(ValuesFactory.getDoubleValue(20d));

    PhysicalQuantity quantity2 = new PhysicalQuantity();
    quantity2.setValue(ValuesFactory.getDoubleValue(100d));

    v.addPhysicalQuantity(quantity);
    v.addPhysicalQuantity(quantity2);

    ParameterNode a1 = new ParameterNode("a");

    runtimeTree.addChild(entity1);
    runtimeTree.addChild(entity4);
View Full Code Here

        AspectTreeType.WATCH_TREE);
    simulation.setModified(true);

    CompositeNode hhpop = new CompositeNode("hhpop[0]");

    VariableNode v = new VariableNode("v");
    PhysicalQuantity quantity = new PhysicalQuantity();
    quantity.setValue(ValuesFactory.getDoubleValue(20d));

    PhysicalQuantity quantity2 = new PhysicalQuantity();
    quantity2.setValue(ValuesFactory.getDoubleValue(100d));

    v.addPhysicalQuantity(quantity);
    v.addPhysicalQuantity(quantity2);

    ParameterNode a1 = new ParameterNode("a");

    runtimeTree.addChild(entity1);
    runtimeTree.addChild(entity4);
View Full Code Here

  protected void advanceTimeStep(double timestep)
  {
    _runtime += timestep;
    ACompositeNode timeStepsNode = new CompositeNode("time tree");
    {
      VariableNode time = new VariableNode("time");
      timeStepsNode.addChild(time);
      PhysicalQuantity t = new PhysicalQuantity();
      t.setUnit(_timeStepUnit);
    }
    ATimeSeriesNode leafNode = (ATimeSeriesNode) timeStepsNode.getChildren().get(0);
View Full Code Here

                    node = newNode;
                  }
                  else
                  {
                    // it's a leaf node
                    VariableNode newNode = new VariableNode(current);
                    int[] start = { _currentRecordingIndex };
                    int[] lenght = { 1 };
                    Array value;
                    try
                    {
                      value = hdfVariable.read(start, lenght);
                      Type type = Type.fromValue(hdfVariable.getDataType().toString());

                      PhysicalQuantity quantity = new PhysicalQuantity();
                      AValue readValue = null;
                      switch(type)
                      {
                        case DOUBLE:
                          readValue = ValuesFactory.getDoubleValue(value.getDouble(0));
                          break;
                        case FLOAT:
                          readValue = ValuesFactory.getFloatValue(value.getFloat(0));
                          break;
                        case INTEGER:
                          readValue = ValuesFactory.getIntValue(value.getInt(0));
                          break;
                        default:
                          break;
                      }
                      quantity.setValue(readValue);
                      newNode.addPhysicalQuantity(quantity);
                      node.addChild(newNode);
                    }
                    catch(IOException | InvalidRangeException e)
                    {
                      throw new GeppettoExecutionException(e);
View Full Code Here

    AspectNode aspect_A = new AspectNode("Aspect_A");

    AspectSubTreeNode simulation = new AspectSubTreeNode(
        AspectTreeType.WATCH_TREE);

    VariableNode dummyNode = new VariableNode("dummyFloat");
    PhysicalQuantity quantity = new PhysicalQuantity();
    quantity.setValue(ValuesFactory.getDoubleValue(50d));
    dummyNode.addPhysicalQuantity(quantity);

    PhysicalQuantity quantity2 = new PhysicalQuantity();
    quantity2.setValue(ValuesFactory.getDoubleValue(100d));
    dummyNode.addPhysicalQuantity(quantity2);

    VariableNode anotherDummyNode = new VariableNode("dummyDouble");

    PhysicalQuantity quantity3 = new PhysicalQuantity();
    quantity3.setValue(ValuesFactory.getDoubleValue(20d));
    anotherDummyNode.addPhysicalQuantity(quantity3);

    PhysicalQuantity quantity4 = new PhysicalQuantity();
    quantity4.setValue(ValuesFactory.getDoubleValue(100d));
    anotherDummyNode.addPhysicalQuantity(quantity4);

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

    PhysicalQuantity quantity2 = new PhysicalQuantity();
    quantity2.setValue(val2);
    quantity2.setScalingFactor("1.E3");
    quantity2.setUnit("V");

    VariableNode dummyNode = new VariableNode("dummyFloat");
    dummyNode.addPhysicalQuantity(quantity);
    dummyNode.addPhysicalQuantity(quantity2);

    VariableNode anotherDummyNode = new VariableNode("dummyDouble");

    AValue val3 = ValuesFactory.getDoubleValue(50d);
    AValue val4 = ValuesFactory.getDoubleValue(100d);

    PhysicalQuantity quantity3 = new PhysicalQuantity();
    quantity3.setValue(val3);
    quantity3.setUnit("mV");
    quantity3.setScalingFactor("1.E3");

    PhysicalQuantity quantity4 = new PhysicalQuantity();
    quantity4.setValue(val4);
    quantity4.setScalingFactor("1.E3");
    quantity4.setUnit("mV");

    anotherDummyNode.addPhysicalQuantity(quantity3);
    anotherDummyNode.addPhysicalQuantity(quantity4);

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

    CompositeNode membrane = new CompositeNode("membraneProperties");
    CompositeNode naChans = new CompositeNode("naChans");
    CompositeNode na = new CompositeNode("na");
    CompositeNode m = new CompositeNode("m");

    VariableNode v = new VariableNode("v");
    PhysicalQuantity quantity = new PhysicalQuantity();
    quantity.setValue(ValuesFactory.getDoubleValue(20d));

    PhysicalQuantity quantity2 = new PhysicalQuantity();
    quantity2.setValue(ValuesFactory.getDoubleValue(100d));

    VariableNode spiking = new VariableNode("spiking");

    VariableNode q = new VariableNode("q");

    v.addPhysicalQuantity(quantity);
    v.addPhysicalQuantity(quantity2);

    spiking.addPhysicalQuantity(quantity);
    q.addPhysicalQuantity(quantity);

    simulation.addChild(hhpop);
    hhpop.addChild(v);
    hhpop.addChild(spiking);
    hhpop.addChild(bio);
View Full Code Here

    // CompositeNode dummyNode0 = new CompositeNode("particle[0]");
    CompositeNode particle = new CompositeNode("particle[1]");
    CompositeNode position = new CompositeNode("position");

    VariableNode anotherDummyNode0 = new VariableNode("v");
    PhysicalQuantity quantity = new PhysicalQuantity();
    quantity.setValue(ValuesFactory.getDoubleValue(20d));

    PhysicalQuantity quantity2 = new PhysicalQuantity();
    quantity2.setValue(ValuesFactory.getDoubleValue(100d));

    anotherDummyNode0.addPhysicalQuantity(quantity);
    anotherDummyNode0.addPhysicalQuantity(quantity2);

    VariableNode anotherDummyNode1 = new VariableNode("v");
    PhysicalQuantity quantity3 = new PhysicalQuantity();
    quantity3.setValue(ValuesFactory.getDoubleValue(55d));

    PhysicalQuantity quantity4 = new PhysicalQuantity();
    quantity4.setValue(ValuesFactory.getDoubleValue(65d));

    anotherDummyNode1.addPhysicalQuantity(quantity3);
    anotherDummyNode1.addPhysicalQuantity(quantity4);

    simulation.addChild(particle);
    particle.addChild(position);
    position.addChild(anotherDummyNode1);
View Full Code Here

TOP

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

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.