openworm / org.geppetto.core

Geppetto core bundle
http://www.geppetto.org/
Other
23 stars 13 forks source link

Change importValue interface in model interpreter #162

Closed filippomc closed 5 years ago

filippomc commented 5 years ago

The actual interface is: Value importValue(ImportValue importValue) throws ModelInterpreterException;

With this interface we are not able to handle multiple runtime projects simultaneously: we are able to find the path from the ImportValue (String path = ((Variable)importValue.eContainer().eContainer()).getPath();) but that path must refer to a model we have not access to, unless we have a reference to the model in the ModelInterpreter.

Proposal new interface: The importType method has a reference to the geppetto model through a , GeppettoModelAccess parameter. We can add this parameter also to importValue:

Value importValue(ImportValue importValue, , GeppettoModelAccess modelAccess) throws ModelInterpreterException;

filippomc commented 5 years ago

This is not needed because the modelInterpreter is in fact stateful although it may not seem. We have a difference instance of model interpreter for each library instance in the runtime project