*******************************************************************************/\r
package fi.semantum.sysdyn.solver;\r
\r
-import java.util.Collection;\r
-import java.util.Iterator;\r
import java.util.Map;\r
\r
public class Addition implements IExpression {\r
import java.util.ArrayList;\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class And implements IExpression {\r
\r
public IExpression[] exps;\r
\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class Application implements IExpression {\r
\r
public String name;\r
\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class Argument implements IExpression {\r
\r
public String name;\r
import java.util.Iterator;\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-import fi.semantum.sysdyn.solver.SolverUtils.Slice;\r
-\r
public class Array implements IExpression {\r
\r
public static final Array FULL = new Array();\r
\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class ArraySliceExpression implements IExpression {\r
\r
public IExpression start;\r
*******************************************************************************/\r
package fi.semantum.sysdyn.solver;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
\r
public class Assignment {\r
\r
\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class Constant implements IExpression {\r
\r
public Object value;\r
*******************************************************************************/\r
package fi.semantum.sysdyn.solver;\r
\r
-import java.nio.channels.UnsupportedAddressTypeException;\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class Declaration implements IExpression {\r
\r
public Variable variable;\r
\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class Derivate implements IExpression {\r
\r
private Variable variable;\r
\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class Division implements IExpression {\r
\r
public IExpression exp1;\r
import java.util.Iterator;\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class ElementwiseProduct implements IExpression {\r
\r
public IExpression exp1;\r
\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class Equals implements IExpression {\r
\r
public IExpression exp1;\r
import java.util.Collection;\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class ForArray implements IExpression {\r
\r
private ArrayList<Object> elements = new ArrayList<Object>();\r
\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class GreaterOrEqualThan implements IExpression {\r
\r
public IExpression exp1;\r
\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class GreaterThan implements IExpression {\r
\r
public IExpression exp1;\r
\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class IfThenElse implements IExpression {\r
\r
public IExpression exp;\r
\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class LessOrEqualThan implements IExpression {\r
\r
public IExpression exp1;\r
\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class LessThan implements IExpression {\r
\r
public IExpression exp1;\r
\r
public void parse() throws Exception {\r
\r
- long start = System.nanoTime();\r
+ //long start = System.nanoTime();\r
\r
for(;pos<chars.length;pos++) {\r
if(chars[pos] == '\r') {\r
}\r
}\r
\r
- long duration = System.nanoTime() - start;\r
+ //long duration = System.nanoTime() - start;\r
//System.err.println("LineReader parse in " + 1e-9*duration + "s."); \r
}\r
\r
\r
@Override\r
public void evaluate(IEnvironment environment) {\r
+ @SuppressWarnings("unchecked")\r
ArrayList<Object> values = (ArrayList<Object>)environment.getSystem().evaluateFunction(environment, fn.base.name, args);\r
for(int i=0;i<targets.size();i++) {\r
targets.get(i).assignPlain(environment, values.get(i));\r
\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class Multiplication implements IExpression {\r
\r
public IExpression exp1;\r
\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class Negation implements IExpression {\r
\r
public IExpression exp;\r
\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class NotEquals implements IExpression {\r
\r
public IExpression exp1;\r
import java.util.ArrayList;\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class Or implements IExpression {\r
\r
public IExpression[] exps;\r
\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class Power implements IExpression {\r
\r
public IExpression exp1;\r
\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class Subtraction implements IExpression {\r
\r
public IExpression exp1;\r
\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
public class TimeVariable implements IExpression {\r
\r
@Override\r
\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
\r
\r
public class Variable implements IExpression {\r
*******************************************************************************/\r
package fi.semantum.sysdyn.solver;\r
\r
-import fi.semantum.sysdyn.solver.SolverUtils.Slice;\r
\r
public class VariableBase {\r
\r
\r
import java.util.Map;\r
\r
-import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
-\r
\r
public class VariableDeclaration implements IExpression {\r
\r
source.. = src/\r
output.. = bin/\r
-bin.includes = plugin.xml,\\r
- META-INF/,\\r
+bin.includes = META-INF/,\\r
.,\\r
graph.tg\r
import org.jfree.chart.plot.Plot;\r
import org.jfree.chart.plot.PlotOrientation;\r
import org.jfree.chart.renderer.category.CategoryItemRenderer;\r
-import org.jfree.data.general.Dataset;\r
import org.jfree.ui.RectangleInsets;\r
import org.simantics.databoard.Bindings;\r
import org.simantics.db.ReadGraph;\r
\r
ArrayList<Variable> variables = new ArrayList<Variable>();\r
\r
- for(Variable child : variable.browseChildren(graph)) {\r
+ for(Variable child : variable.getChildren(graph)) {\r
Resource represents = (Resource)child.getPropertyValue(graph, Variables.REPRESENTS);\r
if(graph.isInstanceOf(represents, sr.IndependentVariable)) {\r
variables.add(child);\r
TreeMap<String, Variable> enumerations = new TreeMap<String, Variable>(AlphanumComparator.CASE_INSENSITIVE_COMPARATOR);\r
\r
\r
- for(Variable child : variable.browseChildren(graph)) {\r
+ for(Variable child : variable.getChildren(graph)) {\r
Resource represents = (Resource)child.getPropertyValue(graph, Variables.REPRESENTS);\r
if(graph.isInstanceOf(represents, sr.IndependentVariable)) {\r
variables.put(child.getName(graph), child);\r
import org.simantics.browsing.ui.graph.contributor.labeler.LabelerContributor;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.sysdyn.ui.browser.nodes.ExperimentsFolder;\r
import org.simantics.sysdyn.ui.browser.nodes.ModulesNode;\r
\r
public class ModulesLabeler extends LabelerContributor<ModulesNode>{\r
import org.simantics.db.common.utils.Logger;\r
import org.simantics.db.exception.CancelTransactionException;\r
import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.exception.ServiceNotFoundException;\r
import org.simantics.db.layer0.util.RemoverUtil;\r
import org.simantics.layer0.Layer0;\r
import org.simantics.ui.SimanticsUI;\r
import org.simantics.db.Resource;\r
import org.simantics.db.Session;\r
import org.simantics.db.WriteGraph;\r
-import org.simantics.db.common.primitiverequest.PossibleObject;\r
import org.simantics.db.common.request.WriteRequest;\r
-import org.simantics.db.common.utils.Logger;\r
import org.simantics.db.exception.CancelTransactionException;\r
import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.exception.ServiceNotFoundException;\r
import org.simantics.db.layer0.util.RemoverUtil;\r
import org.simantics.layer0.Layer0;\r
import org.simantics.ui.SimanticsUI;\r
import org.simantics.db.Resource;\r
import org.simantics.db.Session;\r
import org.simantics.db.WriteGraph;\r
-import org.simantics.db.common.primitiverequest.PossibleObject;\r
import org.simantics.db.common.request.WriteRequest;\r
-import org.simantics.db.common.utils.Logger;\r
import org.simantics.db.exception.CancelTransactionException;\r
import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.exception.ServiceNotFoundException;\r
import org.simantics.db.layer0.util.RemoverUtil;\r
import org.simantics.layer0.Layer0;\r
import org.simantics.ui.SimanticsUI;\r
import org.eclipse.swt.widgets.Shell;\r
import org.eclipse.ui.PlatformUI;\r
import org.simantics.Simantics;\r
-import org.simantics.annotation.ontology.AnnotationResource;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.Session;\r
import org.simantics.db.WriteGraph;\r
-import org.simantics.db.common.request.ReadRequest;\r
import org.simantics.db.common.request.WriteRequest;\r
import org.simantics.db.common.utils.NameUtils;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.request.Read;\r
-import org.simantics.db.service.QueryControl;\r
import org.simantics.diagram.handler.CopyPasteUtil;\r
import org.simantics.diagram.handler.DefaultCopyPasteStrategy;\r
import org.simantics.diagram.handler.ElementObjectAssortment;\r
\r
ISelection sel = HandlerUtil.getCurrentSelection(event);\r
\r
- @SuppressWarnings("unchecked")\r
SharedOntologyNode node = AdaptionUtils.adaptToSingle(sel, SharedOntologyNode.class);\r
if (node == null)\r
return null;\r
\r
ISelection sel = HandlerUtil.getCurrentSelection(event);\r
\r
- @SuppressWarnings("unchecked")\r
Resource res = AdaptionUtils.adaptToSingle(sel, Resource.class);\r
if(res == null) {\r
- AbstractNode<Resource> node = AdaptionUtils.adaptToSingle(sel, AbstractNode.class);\r
+ @SuppressWarnings("unchecked")\r
+ AbstractNode<Resource> node = AdaptionUtils.adaptToSingle(sel, AbstractNode.class);\r
if (node == null)\r
return null;\r
res = node.data;\r
\r
ISelection sel = HandlerUtil.getCurrentSelection(event);\r
\r
- @SuppressWarnings("unchecked")\r
Resource res = AdaptionUtils.adaptToSingle(sel, Resource.class);\r
if(res == null) {\r
- AbstractNode<Resource> node = AdaptionUtils.adaptToSingle(sel, AbstractNode.class);\r
+ @SuppressWarnings("unchecked")\r
+ AbstractNode<Resource> node = AdaptionUtils.adaptToSingle(sel, AbstractNode.class);\r
if (node == null)\r
return null;\r
res = node.data;\r
\r
ISelection sel = HandlerUtil.getCurrentSelection(event);\r
\r
- @SuppressWarnings("unchecked")\r
Resource res = AdaptionUtils.adaptToSingle(sel, Resource.class);\r
if(res == null) {\r
- AbstractNode<Resource> node = AdaptionUtils.adaptToSingle(sel, AbstractNode.class);\r
+ @SuppressWarnings("unchecked")\r
+ AbstractNode<Resource> node = AdaptionUtils.adaptToSingle(sel, AbstractNode.class);\r
if (node == null)\r
return null;\r
res = node.data;\r
import org.simantics.simulation.experiment.ExperimentState;\r
import org.simantics.simulation.experiment.IExperiment;\r
import org.simantics.simulation.project.IExperimentManager;\r
-import org.simantics.sysdyn.manager.SysdynGameExperiment;\r
import org.simantics.sysdyn.manager.SysdynGameExperimentBase;\r
import org.simantics.sysdyn.ui.handlers.RunBasicExperiment;\r
import org.simantics.ui.SimanticsUI;\r
switch(state) {\r
case DISPOSED:\r
revertPlaybackProfiles();\r
+ default:\r
break;\r
}\r
}\r
* @author Teemu Lempinen\r
*\r
*/\r
-public class PieDataset extends AbstractDataset implements org.simantics.jfreechart.chart.PieDataset{\r
+public class PieDataset extends AbstractDataset implements org.simantics.jfreechart.chart.PieDataset<String> {\r
\r
private List<Resource> seriesList;\r
private String realizationURI;\r
\r
import org.eclipse.core.runtime.IProgressMonitor;\r
import org.eclipse.core.runtime.NullProgressMonitor;\r
+import org.simantics.Simantics;\r
import org.simantics.databoard.Bindings;\r
import org.simantics.db.AsyncReadGraph;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.common.utils.Logger;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.layer0.util.Layer0Utils;\r
-import org.simantics.db.layer0.util.Simantics;\r
import org.simantics.db.layer0.variable.Variable;\r
import org.simantics.db.layer0.variable.Variables;\r
import org.simantics.db.procedure.AsyncListener;\r
\r
import org.eclipse.core.runtime.IProgressMonitor;\r
import org.eclipse.core.runtime.NullProgressMonitor;\r
+import org.simantics.Simantics;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.WriteGraph;\r
import org.simantics.db.common.utils.Logger;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.layer0.util.Layer0Utils;\r
-import org.simantics.db.layer0.util.Simantics;\r
import org.simantics.db.layer0.variable.Variable;\r
import org.simantics.db.layer0.variable.Variables;\r
import org.simantics.modelica.IModelicaMonitor;\r
double[] values = EvaluatingListener.<double[]>trySyncRequest(Simantics.getSession(),\r
\r
new UniqueRead<double[]>(){\r
- @SuppressWarnings("unchecked")\r
@Override\r
public double[] perform(ReadGraph graph) throws DatabaseException{\r
\r