Skip to content

Commit

Permalink
Merge pull request #37 from openworm/development
Browse files Browse the repository at this point in the history
Release 0.1.7
  • Loading branch information
tarelli committed Sep 23, 2014
2 parents 8e41d78 + fd62e93 commit 064dcc7
Show file tree
Hide file tree
Showing 25 changed files with 538 additions and 148 deletions.
10 changes: 0 additions & 10 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/org.eclipse.m2e.core.maven2Builder (7).launch</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
Expand Down
17 changes: 8 additions & 9 deletions .settings/org.eclipse.wst.common.project.facet.core.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<runtime name="Geppetto"/>
<installed facet="com.springsource.server.bundle" version="1.0"/>
<installed facet="osgi.bundle" version="4.2"/>
<installed facet="org.eclipse.virgo.server.bundle" version="1.0"/>
<installed facet="java" version="1.7"/>
<installed facet="jst.utility" version="1.0"/>
</faceted-project>
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="com.springsource.server.bundle" version="1.0"/>
<installed facet="osgi.bundle" version="4.2"/>
<installed facet="org.eclipse.virgo.server.bundle" version="1.0"/>
<installed facet="java" version="1.7"/>
<installed facet="jst.utility" version="1.0"/>
</faceted-project>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>org.geppetto</groupId>
<artifactId>core</artifactId>
<name>Geppetto Core Bundle</name>
<version>0.1.6</version>
<version>0.1.7</version>
<packaging>bundle</packaging>
<properties>
<github.global.server>github</github.global.server>
Expand Down
7 changes: 1 addition & 6 deletions src/main/java/org/geppetto/core/model/IModelInterpreter.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,15 @@
import java.net.URL;
import java.util.List;

import org.geppetto.core.model.runtime.ACompositeNode;
import org.geppetto.core.model.runtime.AspectNode;
import org.geppetto.core.model.runtime.AspectSubTreeNode;
import org.geppetto.core.model.runtime.EntityNode;
import org.geppetto.core.model.runtime.RuntimeTreeRoot;
import org.geppetto.core.model.simulation.Aspect;

public interface IModelInterpreter {

IModel readModel(URL url, List<URL> recordings, String instancePath) throws ModelInterpreterException;

boolean populateModelTree(AspectNode aspectNode) throws ModelInterpreterException;

boolean populateRuntimeTree(AspectNode aspectNode);
boolean populateRuntimeTree(AspectNode aspectNode) throws ModelInterpreterException;;

String getName();
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
public class ModelInterpreterException extends Exception
{

public ModelInterpreterException(String message)
{
super(message);
}

public ModelInterpreterException(Throwable e)
{
super(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public AMetadataNode(String name) {
super(name);
}

public AMetadataNode(String name, AValue value) {
super(name);
setValue(value);
}

public AValue getValue() {
return value;
}
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/org/geppetto/core/model/runtime/ANode.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public abstract class ANode implements IVisitable
{
protected ANode _parent;
protected String _name;
//protected String _metatype;
private String _id;

public String getMetaType(){
return this.getClass().getSimpleName();
Expand All @@ -70,6 +70,14 @@ public String getName()
return _name;
}

public void setId(String id){
this._id = id;
}

public String getId() {
return this._id;
}

/**
* @return the next sibling of this node
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
public abstract class AVisualObjectNode extends ANode{

private Point _position;
private String _id;

public AVisualObjectNode(String name) {
super(name);
Expand All @@ -52,14 +51,6 @@ public AVisualObjectNode(String name) {
public AVisualObjectNode(){
}

public void setId(String id) {
this._id = id;
}

public String getId(){
return this._id;
}

public void setPosition(Point position){
this._position = position;
}
Expand Down
21 changes: 6 additions & 15 deletions src/main/java/org/geppetto/core/model/runtime/AspectNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
*/
public class AspectNode extends ACompositeNode{

private String _id;
private VariableNode _time;
private IModelInterpreter _modelInterpreter;
private ISimulator _simulator;
Expand Down Expand Up @@ -81,14 +80,6 @@ public ISimulator getSimulator() {
public void setSimulator(ISimulator simulator) {
this._simulator = simulator;
}

public void setId(String id){
this._id = id;
}

public String getId() {
return this._id;
}

public ANode getParentEntity() {
return this.getParent();
Expand All @@ -114,7 +105,7 @@ public void flushSubTree(AspectTreeType tree)
* @param modelTree
* @return
*/
private ACompositeNode addSubTree(AspectTreeType modelTree)
private AspectSubTreeNode addSubTree(AspectTreeType modelTree)
{
AspectSubTreeNode subTree = new AspectSubTreeNode(modelTree);
addChild(subTree);
Expand All @@ -123,19 +114,19 @@ private ACompositeNode addSubTree(AspectTreeType modelTree)

/**
* It creates the subtree if it doesn't exist
* @param modelTree
* @param treeType
* @return
*/
public ACompositeNode getSubTree(AspectTreeType modelTree)
public AspectSubTreeNode getSubTree(AspectTreeType treeType)
{
for (ANode node:getChildren())
{
if( node.getName().equals(modelTree.toString()))
if( node.getName().equals(treeType.toString()))
{
return (ACompositeNode) node;
return (AspectSubTreeNode) node;
}
}
return addSubTree(modelTree);
return addSubTree(treeType);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ public String toString() {
}
}

private AspectTreeType type;

private AspectTreeType _type;
private boolean _modified = true;

/**
* @param modelTree.toString()
*/
public AspectSubTreeNode(AspectTreeType modelTree)
public AspectSubTreeNode(AspectTreeType treeType)
{
super(modelTree.toString());
this.type = modelTree;
super(treeType.toString());
this._type = treeType;
}

/**
Expand All @@ -95,8 +95,16 @@ public AspectSubTreeNode(String treeType)
this.setName(treeType);
}

public String getType(){
return this.type.toString();
public AspectTreeType getType(){
return this._type;
}

public boolean isModified(){
return this._modified;
}

public void setModified(boolean mode){
this._modified = mode;
}

/**
Expand All @@ -122,6 +130,7 @@ public void flushSubTree(AspectTreeType tree)
private AspectSubTreeNode addSubTree(AspectTreeType treeType)
{
AspectSubTreeNode subTree = new AspectSubTreeNode(treeType.toString());
subTree.setId(treeType.toString());
addChild(subTree);
return subTree;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ public CompositeNode(String name) {
super(name);
}

public CompositeNode(String name, String id) {
super(name);
setId(id);
}

public CompositeNode() {
super();
}
Expand Down
18 changes: 8 additions & 10 deletions src/main/java/org/geppetto/core/model/runtime/EntityNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
public class EntityNode extends ACompositeNode{

protected List<AspectNode> _aspects =new ArrayList<AspectNode>();;
private String _id;
private List<Connection> _connections;
private AMetadataNode _metadata;
private Point _position;
Expand All @@ -74,15 +73,6 @@ public void setConnections(List<Connection> connections) {
public List<AspectNode> getAspects() {
return _aspects;
}

public void setId(String id){
this._id = id;
}

public String getId() {
return this._id;
}


public AMetadataNode getMetadata() {
return this._metadata;
Expand Down Expand Up @@ -113,6 +103,14 @@ public synchronized boolean apply(IStateVisitor visitor)
break;
}
}
for(AspectNode stateNode:this.getAspects())
{
stateNode.apply(visitor);
if(visitor.stopVisiting())
{
break;
}
}
}
return visitor.outEntityNode( this );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public ParameterSpecificationNode(String name){
super(name);
}

public ParameterSpecificationNode(String name, String id){
super(name);
setId(id);
}

public void setValue(PhysicalQuantity value){
this._value = value;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.util.Map;

import org.geppetto.core.model.state.visitors.IStateVisitor;
import org.geppetto.core.model.values.AValue;

/**
* Node use for storing text metadata properties and serialization
Expand All @@ -51,6 +52,15 @@ public TextMetadataNode(String name){
super(name);
}

public TextMetadataNode(String name, AValue value){
super(name, value);
}

public TextMetadataNode(String name, String id, AValue value){
super(name, value);
setId(id);
}

public TextMetadataNode(){
super("TextMetadataNode");
}
Expand Down
Loading

0 comments on commit 064dcc7

Please sign in to comment.