cylinder5.setPosition(p2);
cylinder5.setDistal(p3);
cylinder5.setRadiusBottom(new Double(34.55));
cylinder5.setRadiusTop(new Double(34.55));
CompositeNode vg = new CompositeNode("vg");
vg.addChild(sphere);
vg.addChild(cylinder);
vg.addChild(cylinder2);
vg.addChild(cylinder3);
vg.addChild(cylinder4);
vg.addChild(cylinder5);
CompositeNode vg2 = new CompositeNode("vg2");
vg2.addChild(cylinder);
vg2.addChild(cylinder2);
vg2.addChild(cylinder3);
vg2.addChild(cylinder4);
vg2.addChild(cylinder5);
vg2.addChild(sphere);
AspectSubTreeNode simulation = new AspectSubTreeNode(
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);
entity1.addChild(entity2);
entity2.addChild(entity3);
entity2.getAspects().add(aspectB);
entity1.getAspects().add(aspectA);
entity3.getAspects().add(aspectC);
aspectC.setParent(entity3);
aspectB.setParent(entity2);
aspectA.setParent(entity1);
aspectA.addChild(model);
model.addChild(parameter);
model.addChild(dynamics);
model.addChild(functionNode);
model.setModified(false);
AspectNode parentAspect = ((AspectNode) model.getParent());
parentAspect.setModified(false);
aspectA.addChild(visualization);
visualization.addChild(vg);
visualization.addChild(vg2);
visualization.setModified(false);
parentAspect = ((AspectNode) visualization.getParent());
parentAspect.setModified(false);
aspectA.addChild(simulation);
simulation.addChild(hhpop);
simulation.setModified(false);
parentAspect = ((AspectNode) simulation.getParent());
parentAspect.setModified(false);
hhpop.addChild(v);
hhpop.addChild(a1);
SerializeTreeVisitor visitor = new SerializeTreeVisitor();
runtimeTree.apply(visitor);
String serialized = visitor.getSerializedTree();
System.out.println(serialized);