JFREE.BarRenderer <T JFREE.Renderer
JFREE.StackedBarRenderer <T JFREE.Renderer
+
+JFREE.DeviationRenderer <T JFREE.Renderer
//#####################################################################
// Position
public final Resource Dataset_renderer_Inverse;\r
public final Resource Dataset_seriesList;\r
public final Resource Dataset_seriesList_Inverse;\r
+ public final Resource DeviationRenderer;\r
public final Resource ImageTitle;\r
public final Resource Left;\r
public final Resource LegendTitle;\r
public static final String Dataset_renderer_Inverse = "http://www.simantics.org/JFreeChart-1.0/Dataset/renderer/Inverse";\r
public static final String Dataset_seriesList = "http://www.simantics.org/JFreeChart-1.0/Dataset/seriesList";\r
public static final String Dataset_seriesList_Inverse = "http://www.simantics.org/JFreeChart-1.0/Dataset/seriesList/Inverse";\r
+ public static final String DeviationRenderer = "http://www.simantics.org/JFreeChart-1.0/DeviationRenderer";\r
public static final String ImageTitle = "http://www.simantics.org/JFreeChart-1.0/ImageTitle";\r
public static final String Left = "http://www.simantics.org/JFreeChart-1.0/Left";\r
public static final String LegendTitle = "http://www.simantics.org/JFreeChart-1.0/LegendTitle";\r
Dataset_renderer_Inverse = getResourceOrNull(graph, URIs.Dataset_renderer_Inverse);\r
Dataset_seriesList = getResourceOrNull(graph, URIs.Dataset_seriesList);\r
Dataset_seriesList_Inverse = getResourceOrNull(graph, URIs.Dataset_seriesList_Inverse);\r
+ DeviationRenderer = getResourceOrNull(graph, URIs.DeviationRenderer);\r
ImageTitle = getResourceOrNull(graph, URIs.ImageTitle);\r
Left = getResourceOrNull(graph, URIs.Left);\r
LegendTitle = getResourceOrNull(graph, URIs.LegendTitle);\r
class="org.simantics.jfreechart.chart.StackedBarRenderer">\r
<graph />\r
<this />\r
- </type> \r
+ </type> \r
+ <type uri="http://www.simantics.org/JFreeChart-0.0/DeviationRenderer"\r
+ class="org.simantics.jfreechart.chart.DeviationRenderer">\r
+ <graph />\r
+ <this />\r
+ </type> \r
</target> \r
</adapters>
\ No newline at end of file
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.jfreechart.chart;\r
+\r
+import org.jfree.chart.labels.StandardXYToolTipGenerator;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+\r
+public class DeviationRenderer extends AbstractRenderer {\r
+\r
+ public DeviationRenderer(ReadGraph graph, Resource resource) {\r
+ super(graph, resource);\r
+ }\r
+\r
+ private org.jfree.chart.renderer.xy.DeviationRenderer renderer;\r
+ \r
+ @Override\r
+ public org.jfree.chart.renderer.AbstractRenderer getRenderer() {\r
+ if(renderer == null) {\r
+ renderer = new org.jfree.chart.renderer.xy.DeviationRenderer();\r
+ renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());\r
+ }\r
+ return renderer;\r
+ }\r
+\r
+}\r
\r
import org.eclipse.jface.layout.GridDataFactory;\r
import org.eclipse.jface.layout.GridLayoutFactory;\r
+import org.eclipse.jface.resource.ImageDescriptor;\r
import org.eclipse.swt.SWT;\r
import org.eclipse.swt.events.SelectionEvent;\r
-import org.eclipse.swt.graphics.Color;\r
import org.eclipse.swt.graphics.Device;\r
-import org.eclipse.swt.graphics.GC;\r
-import org.eclipse.swt.graphics.Image;\r
import org.eclipse.swt.graphics.Point;\r
import org.eclipse.swt.graphics.RGB;\r
import org.eclipse.swt.widgets.ColorDialog;\r
import org.simantics.ui.utils.AdaptionUtils;\r
import org.simantics.utils.RunnableWithObject;\r
import org.simantics.utils.datastructures.Triple;\r
+import org.simantics.utils.ui.gfx.ColorImageDescriptor;\r
\r
/**\r
* Composite for selecting a color for a chart component\r
* @param blue Blue 0-255\r
* @return\r
*/\r
- private Image getColorPickerImage(Device device, int red, int green, int blue) {\r
- Image image = new Image(device, 20, 20);\r
- GC gc = new GC (image);\r
- gc.setBackground (new Color(device, red, green, blue));\r
- gc.fillRectangle (image.getBounds ());\r
- gc.dispose ();\r
+ private ImageDescriptor getColorPickerImage(Device device, int red, int green, int blue) {\r
+ ImageDescriptor image = new ColorImageDescriptor(red, green, blue, 20, 20, true);\r
+ //GC gc = new GC (image);\r
+ //gc.setBackground (new Color(device, red, green, blue));\r
+ //gc.fillRectangle (image.getBounds ());\r
+ //gc.dispose ();\r
return image;\r
}\r
\r
* @author Teemu Lempinen\r
*\r
*/\r
- private class ColorImageFactoryFactory extends ReadFactoryImpl<Resource, Image> {\r
+ private class ColorImageFactoryFactory extends ReadFactoryImpl<Resource, ImageDescriptor> {\r
\r
Button button;\r
\r
this.button = button;\r
}\r
\r
+ @Override\r
public Object getIdentity(Object inputContents) {\r
return new Triple<Object, Class<?>, Button>(inputContents, getClass(), button);\r
}\r
\r
@Override\r
- public Image perform(ReadGraph graph, Resource input) throws DatabaseException {\r
+ public ImageDescriptor perform(ReadGraph graph, Resource input) throws DatabaseException {\r
if(button.getWidget().isDisposed())\r
return null;\r
Display device = button.getWidget().getDisplay();\r
final RGB oldRGB = getColor(graph, resource);\r
\r
display.asyncExec(new RunnableWithObject(oldRGB) {\r
+ @Override\r
public void run() {\r
// Use color dialog to select a color\r
Shell shell = new Shell(display);\r
@Override\r
public void perform(WriteGraph graph) throws DatabaseException {\r
G2DResource g2d = G2DResource.getInstance(graph);\r
- float[] components = new float[] {(float)rgb.red / 255.0f, (float)rgb.green / 255.0f, (float)rgb.blue / 255.0f, 1.0f};\r
+ float[] components = new float[] {rgb.red / 255.0f, rgb.green / 255.0f, rgb.blue / 255.0f, 1.0f};\r
graph.claimLiteral(resource, getColorRelation(graph), g2d.Color, components); \r
}\r
});\r
*/\r
private class DefaultColorSelectionFactory extends ReadFactoryImpl<Resource, Boolean> {\r
\r
- private Boolean isCustom;\r
+ private final Boolean isCustom;\r
\r
/**\r
* \r
public enum OSType {\r
APPLE, LINUX, SUN, WINDOWS, UNKNOWN\r
}\r
-\r
+ \r
+ public static String OMC_VERSION = "OMC_VERSION"; \r
+ public static String RESULT_FILE_NAME = "RESULT_FILE_NAME"; \r
+ \r
/**\r
* Get operating system type\r
* @return OSType\r
\r
ArrayList<String> commands = new ArrayList<String>();\r
commands.add(simulationLocation.executableFile.getAbsolutePath());\r
+ \r
+ if(experimentParameters.get(RESULT_FILE_NAME) != null) {\r
+ commands.add("-r="+experimentParameters.get(RESULT_FILE_NAME));\r
+ }\r
+ \r
// Write new initial values (parameters). No need to update xml if structure has changed. In that case also xml is up-to-date\r
if(parameterChanges != null) {\r
- String version = getOMCVersion(simulationLocation.omcHome);\r
+ String version = experimentParameters.get(OMC_VERSION);\r
+ if(version == null)\r
+ version = getOMCVersion(simulationLocation.omcHome);\r
if(version.startsWith("1.9")) {\r
// Handled in experiment\r
- updateInitFile(simulationLocation, experimentParameters, parameterChanges);\r
+ if(parameterChanges.size() == 1) {\r
+ commands.add("-override");\r
+ commands.add(parameterChanges.keySet().iterator().next() + "=" + parameterChanges.values().iterator().next());\r
+ } else\r
+ updateInitFile(simulationLocation, experimentParameters, parameterChanges);\r
} else {\r
writeInits(simulationLocation, experimentParameters, monitor);\r
}\r
/**\r
* \r
* @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
*\r
*/\r
public class SimulationLocation {\r
if(listensDomain) {\r
RangeUpdateRequest request = new RangeUpdateRequest(link, map, this);\r
try {\r
- g.syncRequest(request, request);\r
+ boolean modified = g.syncRequest(request, request);\r
+ if(modified) {\r
+ updated.add(link.rangeElement);\r
+ }\r
} catch (DatabaseException e) {\r
throw new MappingException(e);\r
}\r
- // TODO check if really modified\r
- updated.add(link.rangeElement);\r
+\r
}\r
else\r
if(link.type.updateRange(g, map, link.domainElement, link.rangeElement))\r
@Override\r
public Boolean perform(ReadGraph g) throws DatabaseException {\r
if(map != null) {\r
- link.type.updateRange(g, map, link.domainElement, link.rangeElement);\r
+ boolean updated = link.type.updateRange(g, map, link.domainElement, link.rangeElement);\r
map = null;\r
- return Boolean.TRUE;\r
+ return updated;\r
}\r
else if(mapping != null) {\r
mapping.domainModified(link);\r
L0.NamespaceMigrationStep.Prefix.from %from\r
L0.NamespaceMigrationStep.Prefix.to %to\r
\r
-MIGRATION = SYSDYN."from1.6to1.7" : L0.MigrationSequence\r
+MIGRATION = SYSDYN.Migration : L0.Library\r
+ \r
+MIGRATION.fromModel1 : L0.Migration\r
+ L0.Migration.format "sysdynModel"\r
+ L0.Migration.from 1\r
+ L0.Migration.step FROM16TO17\r
+ L0.Migration.priority 1.0\r
+ \r
+MIGRATION.fromModule1 : L0.Migration\r
+ L0.Migration.format "sysdynModule"\r
+ L0.Migration.from 1\r
+ L0.Migration.step FROM16TO17\r
+ L0.Migration.priority 1.0\r
+\r
+MIGRATION.fromFunctionLibrary1 : L0.Migration\r
+ L0.Migration.format "sysdynFunctionLibrary"\r
+ L0.Migration.from 1\r
+ L0.Migration.step FROM16TO17\r
+ L0.Migration.priority 1.0 \r
+ \r
+FROM16TO17 = MIGRATION."from1.6to1.7" : L0.MigrationSequence\r
@L0.list\r
- MIGRATION.Ontologies\r
- MIGRATION.Spreadsheets\r
- MIGRATION.SysdynChanges\r
- MIGRATION.OrderedSetsToLists\r
+ FROM16TO17.Ontologies\r
+ FROM16TO17.Spreadsheets\r
+ FROM16TO17.SysdynChanges\r
+ FROM16TO17.OrderedSetsToLists\r
\r
-MIGRATION.Ontologies : L0.NamespaceMigrationStep\r
+FROM16TO17.Ontologies : L0.NamespaceMigrationStep\r
@L0.list\r
_\r
@move "http://www.simantics.org/Layer0-" "1.0" "1.1"\r
_\r
@move"http://www.simantics.org/SelectionView-" "1.1" "1.2"\r
\r
-MIGRATION.Spreadsheets : L0.NamespaceMigrationStep\r
+FROM16TO17.Spreadsheets : L0.NamespaceMigrationStep\r
@L0.list\r
_\r
@move "http://www.simantics.org/Spreadsheet-1.2/" "HasContent" "Cell/content"\r
_\r
@move "http://www.simantics.org/Spreadsheet-1.2/" "ColumnWidthsOf" "Headers/columnWidths/Inverse" \r
\r
-MIGRATION.SysdynChanges : L0.NamespaceMigrationStep\r
+FROM16TO17.SysdynChanges : L0.NamespaceMigrationStep\r
@L0.list\r
_\r
@move "http://www.simantics.org/Sysdyn-1.1/" "HasTail" "Variable/HasTail"\r
@move "http://www.simantics.org/Sysdyn-1.1/" "SharedModuleOntolofgy" "SharedModuleOntology"\r
\r
\r
-MIGRATION.OrderedSetsToLists : L0.OrderedSetToListMigrationStep\r
+FROM16TO17.OrderedSetsToLists : L0.OrderedSetToListMigrationStep\r
@L0.list\r
_ : L0.OrderedSetToListMigrationStep.Change\r
L0.OrderedSetToListMigrationStep.entityType "http://www.simantics.org/Sysdyn-1.1/Variable"\r
>-- SYSDYN.SysdynModel.tolerance --> L0.Double <R L0.HasProperty : L0.FunctionalRelation
>-- SYSDYN.SysdynModel.solver --> L0.String <R L0.HasProperty : L0.FunctionalRelation
>-- SYSDYN.SysdynModel.variableFilter --> L0.String <R L0.HasProperty : L0.FunctionalRelation
+ >-- SYSDYN.SysdynModel.fmuFile --> L0.ByteArray <R L0.HasProperty
+// >-- SYSDYN.SysdynModel.exeFile --> L0.ByteArray <R L0.HasProperty
@L0.assert SYSDYN.SysdynModel.startTime 0.0
@L0.assert SYSDYN.SysdynModel.stopTime 10.0
@L0.assert SYSDYN.SysdynModel.solver "euler"
>-- SYSDYN.SensitivityAnalysisExperiment.minValue --> L0.Double <R L0.HasProperty : L0.FunctionalRelation
>-- SYSDYN.SensitivityAnalysisExperiment.maxValue --> L0.Double <R L0.HasProperty : L0.FunctionalRelation
>-- SYSDYN.SensitivityAnalysisExperiment.numValues --> L0.Integer <R L0.HasProperty : L0.FunctionalRelation
+ >-- SYSDYN.SensitivityAnalysisExperiment.mean --> L0.Double <R L0.HasProperty : L0.FunctionalRelation
+ >-- SYSDYN.SensitivityAnalysisExperiment.stdDeviation --> L0.Double <R L0.HasProperty : L0.FunctionalRelation
+
+SYSDYN.SensitivityAnalysisExperiment.SensitivityDataset <T JFREE.Dataset
//#####################################################################
// Results and history datasets
public final Resource LookupExpression;\r
public final Resource LookupExpression_lookup;\r
public final Resource LookupExpression_lookup_Inverse;\r
+ public final Resource Migration;\r
+ public final Resource Migration_from1$6to1$7;\r
+ public final Resource Migration_from1$6to1$7_Ontologies;\r
+ public final Resource Migration_from1$6to1$7_OrderedSetsToLists;\r
+ public final Resource Migration_from1$6to1$7_Spreadsheets;\r
+ public final Resource Migration_from1$6to1$7_SysdynChanges;\r
+ public final Resource Migration_fromFunctionLibrary1;\r
+ public final Resource Migration_fromModel1;\r
+ public final Resource Migration_fromModule1;\r
public final Resource ModelBrowser;\r
public final Resource ModelingActionContext;\r
public final Resource ModelingActionContext_Actions;\r
public final Resource Right;\r
public final Resource SelectedSharedFunctionLibraries;\r
public final Resource SensitivityAnalysisExperiment;\r
+ public final Resource SensitivityAnalysisExperiment_SensitivityDataset;\r
public final Resource SensitivityAnalysisExperiment_maxValue;\r
public final Resource SensitivityAnalysisExperiment_maxValue_Inverse;\r
+ public final Resource SensitivityAnalysisExperiment_mean;\r
+ public final Resource SensitivityAnalysisExperiment_mean_Inverse;\r
public final Resource SensitivityAnalysisExperiment_minValue;\r
public final Resource SensitivityAnalysisExperiment_minValue_Inverse;\r
public final Resource SensitivityAnalysisExperiment_numValues;\r
public final Resource SensitivityAnalysisExperiment_numValues_Inverse;\r
public final Resource SensitivityAnalysisExperiment_propabilityDistribution;\r
public final Resource SensitivityAnalysisExperiment_propabilityDistribution_Inverse;\r
+ public final Resource SensitivityAnalysisExperiment_stdDeviation;\r
+ public final Resource SensitivityAnalysisExperiment_stdDeviation_Inverse;\r
public final Resource SensitivityAnalysisExperiment_variedParameter;\r
public final Resource SensitivityAnalysisExperiment_variedParameter_Inverse;\r
public final Resource SharedFunctionOntology;\r
public final Resource SysdynConnectionType;\r
public final Resource SysdynDiagramModelingRules;\r
public final Resource SysdynModel;\r
+ public final Resource SysdynModel_fmuFile;\r
+ public final Resource SysdynModel_fmuFile_Inverse;\r
public final Resource SysdynModel_outputInterval;\r
public final Resource SysdynModel_outputInterval_Inverse;\r
public final Resource SysdynModel_simulationStepLength;\r
public final Resource WithLookupExpression_maxY;\r
public final Resource WithLookupExpression_minX;\r
public final Resource WithLookupExpression_minY;\r
- public final Resource from1$6to1$7;\r
- public final Resource from1$6to1$7_Ontologies;\r
- public final Resource from1$6to1$7_OrderedSetsToLists;\r
- public final Resource from1$6to1$7_Spreadsheets;\r
- public final Resource from1$6to1$7_SysdynChanges;\r
\r
public static class URIs {\r
public static final String AdditionalSymbols = "http://www.simantics.org/Sysdyn-1.1/AdditionalSymbols";\r
public static final String LookupExpression = "http://www.simantics.org/Sysdyn-1.1/LookupExpression";\r
public static final String LookupExpression_lookup = "http://www.simantics.org/Sysdyn-1.1/LookupExpression/lookup";\r
public static final String LookupExpression_lookup_Inverse = "http://www.simantics.org/Sysdyn-1.1/LookupExpression/lookup/Inverse";\r
+ public static final String Migration = "http://www.simantics.org/Sysdyn-1.1/Migration";\r
+ public static final String Migration_from1$6to1$7 = "http://www.simantics.org/Sysdyn-1.1/Migration/from1.6to1.7";\r
+ public static final String Migration_from1$6to1$7_Ontologies = "http://www.simantics.org/Sysdyn-1.1/Migration/from1.6to1.7/Ontologies";\r
+ public static final String Migration_from1$6to1$7_OrderedSetsToLists = "http://www.simantics.org/Sysdyn-1.1/Migration/from1.6to1.7/OrderedSetsToLists";\r
+ public static final String Migration_from1$6to1$7_Spreadsheets = "http://www.simantics.org/Sysdyn-1.1/Migration/from1.6to1.7/Spreadsheets";\r
+ public static final String Migration_from1$6to1$7_SysdynChanges = "http://www.simantics.org/Sysdyn-1.1/Migration/from1.6to1.7/SysdynChanges";\r
+ public static final String Migration_fromFunctionLibrary1 = "http://www.simantics.org/Sysdyn-1.1/Migration/fromFunctionLibrary1";\r
+ public static final String Migration_fromModel1 = "http://www.simantics.org/Sysdyn-1.1/Migration/fromModel1";\r
+ public static final String Migration_fromModule1 = "http://www.simantics.org/Sysdyn-1.1/Migration/fromModule1";\r
public static final String ModelBrowser = "http://www.simantics.org/Sysdyn-1.1/ModelBrowser";\r
public static final String ModelingActionContext = "http://www.simantics.org/Sysdyn-1.1/ModelingActionContext";\r
public static final String ModelingActionContext_Actions = "http://www.simantics.org/Sysdyn-1.1/ModelingActionContext/Actions";\r
public static final String Right = "http://www.simantics.org/Sysdyn-1.1/Right";\r
public static final String SelectedSharedFunctionLibraries = "http://www.simantics.org/Sysdyn-1.1/SelectedSharedFunctionLibraries";\r
public static final String SensitivityAnalysisExperiment = "http://www.simantics.org/Sysdyn-1.1/SensitivityAnalysisExperiment";\r
+ public static final String SensitivityAnalysisExperiment_SensitivityDataset = "http://www.simantics.org/Sysdyn-1.1/SensitivityAnalysisExperiment/SensitivityDataset";\r
public static final String SensitivityAnalysisExperiment_maxValue = "http://www.simantics.org/Sysdyn-1.1/SensitivityAnalysisExperiment/maxValue";\r
public static final String SensitivityAnalysisExperiment_maxValue_Inverse = "http://www.simantics.org/Sysdyn-1.1/SensitivityAnalysisExperiment/maxValue/Inverse";\r
+ public static final String SensitivityAnalysisExperiment_mean = "http://www.simantics.org/Sysdyn-1.1/SensitivityAnalysisExperiment/mean";\r
+ public static final String SensitivityAnalysisExperiment_mean_Inverse = "http://www.simantics.org/Sysdyn-1.1/SensitivityAnalysisExperiment/mean/Inverse";\r
public static final String SensitivityAnalysisExperiment_minValue = "http://www.simantics.org/Sysdyn-1.1/SensitivityAnalysisExperiment/minValue";\r
public static final String SensitivityAnalysisExperiment_minValue_Inverse = "http://www.simantics.org/Sysdyn-1.1/SensitivityAnalysisExperiment/minValue/Inverse";\r
public static final String SensitivityAnalysisExperiment_numValues = "http://www.simantics.org/Sysdyn-1.1/SensitivityAnalysisExperiment/numValues";\r
public static final String SensitivityAnalysisExperiment_numValues_Inverse = "http://www.simantics.org/Sysdyn-1.1/SensitivityAnalysisExperiment/numValues/Inverse";\r
public static final String SensitivityAnalysisExperiment_propabilityDistribution = "http://www.simantics.org/Sysdyn-1.1/SensitivityAnalysisExperiment/propabilityDistribution";\r
public static final String SensitivityAnalysisExperiment_propabilityDistribution_Inverse = "http://www.simantics.org/Sysdyn-1.1/SensitivityAnalysisExperiment/propabilityDistribution/Inverse";\r
+ public static final String SensitivityAnalysisExperiment_stdDeviation = "http://www.simantics.org/Sysdyn-1.1/SensitivityAnalysisExperiment/stdDeviation";\r
+ public static final String SensitivityAnalysisExperiment_stdDeviation_Inverse = "http://www.simantics.org/Sysdyn-1.1/SensitivityAnalysisExperiment/stdDeviation/Inverse";\r
public static final String SensitivityAnalysisExperiment_variedParameter = "http://www.simantics.org/Sysdyn-1.1/SensitivityAnalysisExperiment/variedParameter";\r
public static final String SensitivityAnalysisExperiment_variedParameter_Inverse = "http://www.simantics.org/Sysdyn-1.1/SensitivityAnalysisExperiment/variedParameter/Inverse";\r
public static final String SharedFunctionOntology = "http://www.simantics.org/Sysdyn-1.1/SharedFunctionOntology";\r
public static final String SysdynConnectionType = "http://www.simantics.org/Sysdyn-1.1/SysdynConnectionType";\r
public static final String SysdynDiagramModelingRules = "http://www.simantics.org/Sysdyn-1.1/SysdynDiagramModelingRules";\r
public static final String SysdynModel = "http://www.simantics.org/Sysdyn-1.1/SysdynModel";\r
+ public static final String SysdynModel_fmuFile = "http://www.simantics.org/Sysdyn-1.1/SysdynModel/fmuFile";\r
+ public static final String SysdynModel_fmuFile_Inverse = "http://www.simantics.org/Sysdyn-1.1/SysdynModel/fmuFile/Inverse";\r
public static final String SysdynModel_outputInterval = "http://www.simantics.org/Sysdyn-1.1/SysdynModel/outputInterval";\r
public static final String SysdynModel_outputInterval_Inverse = "http://www.simantics.org/Sysdyn-1.1/SysdynModel/outputInterval/Inverse";\r
public static final String SysdynModel_simulationStepLength = "http://www.simantics.org/Sysdyn-1.1/SysdynModel/simulationStepLength";\r
public static final String WithLookupExpression_maxY = "http://www.simantics.org/Sysdyn-1.1/WithLookupExpression/maxY";\r
public static final String WithLookupExpression_minX = "http://www.simantics.org/Sysdyn-1.1/WithLookupExpression/minX";\r
public static final String WithLookupExpression_minY = "http://www.simantics.org/Sysdyn-1.1/WithLookupExpression/minY";\r
- public static final String from1$6to1$7 = "http://www.simantics.org/Sysdyn-1.1/from1.6to1.7";\r
- public static final String from1$6to1$7_Ontologies = "http://www.simantics.org/Sysdyn-1.1/from1.6to1.7/Ontologies";\r
- public static final String from1$6to1$7_OrderedSetsToLists = "http://www.simantics.org/Sysdyn-1.1/from1.6to1.7/OrderedSetsToLists";\r
- public static final String from1$6to1$7_Spreadsheets = "http://www.simantics.org/Sysdyn-1.1/from1.6to1.7/Spreadsheets";\r
- public static final String from1$6to1$7_SysdynChanges = "http://www.simantics.org/Sysdyn-1.1/from1.6to1.7/SysdynChanges";\r
}\r
\r
public static Resource getResourceOrNull(ReadGraph graph, String uri) {\r
LookupExpression = getResourceOrNull(graph, URIs.LookupExpression);\r
LookupExpression_lookup = getResourceOrNull(graph, URIs.LookupExpression_lookup);\r
LookupExpression_lookup_Inverse = getResourceOrNull(graph, URIs.LookupExpression_lookup_Inverse);\r
+ Migration = getResourceOrNull(graph, URIs.Migration);\r
+ Migration_from1$6to1$7 = getResourceOrNull(graph, URIs.Migration_from1$6to1$7);\r
+ Migration_from1$6to1$7_Ontologies = getResourceOrNull(graph, URIs.Migration_from1$6to1$7_Ontologies);\r
+ Migration_from1$6to1$7_OrderedSetsToLists = getResourceOrNull(graph, URIs.Migration_from1$6to1$7_OrderedSetsToLists);\r
+ Migration_from1$6to1$7_Spreadsheets = getResourceOrNull(graph, URIs.Migration_from1$6to1$7_Spreadsheets);\r
+ Migration_from1$6to1$7_SysdynChanges = getResourceOrNull(graph, URIs.Migration_from1$6to1$7_SysdynChanges);\r
+ Migration_fromFunctionLibrary1 = getResourceOrNull(graph, URIs.Migration_fromFunctionLibrary1);\r
+ Migration_fromModel1 = getResourceOrNull(graph, URIs.Migration_fromModel1);\r
+ Migration_fromModule1 = getResourceOrNull(graph, URIs.Migration_fromModule1);\r
ModelBrowser = getResourceOrNull(graph, URIs.ModelBrowser);\r
ModelingActionContext = getResourceOrNull(graph, URIs.ModelingActionContext);\r
ModelingActionContext_Actions = getResourceOrNull(graph, URIs.ModelingActionContext_Actions);\r
Right = getResourceOrNull(graph, URIs.Right);\r
SelectedSharedFunctionLibraries = getResourceOrNull(graph, URIs.SelectedSharedFunctionLibraries);\r
SensitivityAnalysisExperiment = getResourceOrNull(graph, URIs.SensitivityAnalysisExperiment);\r
+ SensitivityAnalysisExperiment_SensitivityDataset = getResourceOrNull(graph, URIs.SensitivityAnalysisExperiment_SensitivityDataset);\r
SensitivityAnalysisExperiment_maxValue = getResourceOrNull(graph, URIs.SensitivityAnalysisExperiment_maxValue);\r
SensitivityAnalysisExperiment_maxValue_Inverse = getResourceOrNull(graph, URIs.SensitivityAnalysisExperiment_maxValue_Inverse);\r
+ SensitivityAnalysisExperiment_mean = getResourceOrNull(graph, URIs.SensitivityAnalysisExperiment_mean);\r
+ SensitivityAnalysisExperiment_mean_Inverse = getResourceOrNull(graph, URIs.SensitivityAnalysisExperiment_mean_Inverse);\r
SensitivityAnalysisExperiment_minValue = getResourceOrNull(graph, URIs.SensitivityAnalysisExperiment_minValue);\r
SensitivityAnalysisExperiment_minValue_Inverse = getResourceOrNull(graph, URIs.SensitivityAnalysisExperiment_minValue_Inverse);\r
SensitivityAnalysisExperiment_numValues = getResourceOrNull(graph, URIs.SensitivityAnalysisExperiment_numValues);\r
SensitivityAnalysisExperiment_numValues_Inverse = getResourceOrNull(graph, URIs.SensitivityAnalysisExperiment_numValues_Inverse);\r
SensitivityAnalysisExperiment_propabilityDistribution = getResourceOrNull(graph, URIs.SensitivityAnalysisExperiment_propabilityDistribution);\r
SensitivityAnalysisExperiment_propabilityDistribution_Inverse = getResourceOrNull(graph, URIs.SensitivityAnalysisExperiment_propabilityDistribution_Inverse);\r
+ SensitivityAnalysisExperiment_stdDeviation = getResourceOrNull(graph, URIs.SensitivityAnalysisExperiment_stdDeviation);\r
+ SensitivityAnalysisExperiment_stdDeviation_Inverse = getResourceOrNull(graph, URIs.SensitivityAnalysisExperiment_stdDeviation_Inverse);\r
SensitivityAnalysisExperiment_variedParameter = getResourceOrNull(graph, URIs.SensitivityAnalysisExperiment_variedParameter);\r
SensitivityAnalysisExperiment_variedParameter_Inverse = getResourceOrNull(graph, URIs.SensitivityAnalysisExperiment_variedParameter_Inverse);\r
SharedFunctionOntology = getResourceOrNull(graph, URIs.SharedFunctionOntology);\r
SysdynConnectionType = getResourceOrNull(graph, URIs.SysdynConnectionType);\r
SysdynDiagramModelingRules = getResourceOrNull(graph, URIs.SysdynDiagramModelingRules);\r
SysdynModel = getResourceOrNull(graph, URIs.SysdynModel);\r
+ SysdynModel_fmuFile = getResourceOrNull(graph, URIs.SysdynModel_fmuFile);\r
+ SysdynModel_fmuFile_Inverse = getResourceOrNull(graph, URIs.SysdynModel_fmuFile_Inverse);\r
SysdynModel_outputInterval = getResourceOrNull(graph, URIs.SysdynModel_outputInterval);\r
SysdynModel_outputInterval_Inverse = getResourceOrNull(graph, URIs.SysdynModel_outputInterval_Inverse);\r
SysdynModel_simulationStepLength = getResourceOrNull(graph, URIs.SysdynModel_simulationStepLength);\r
WithLookupExpression_maxY = getResourceOrNull(graph, URIs.WithLookupExpression_maxY);\r
WithLookupExpression_minX = getResourceOrNull(graph, URIs.WithLookupExpression_minX);\r
WithLookupExpression_minY = getResourceOrNull(graph, URIs.WithLookupExpression_minY);\r
- from1$6to1$7 = getResourceOrNull(graph, URIs.from1$6to1$7);\r
- from1$6to1$7_Ontologies = getResourceOrNull(graph, URIs.from1$6to1$7_Ontologies);\r
- from1$6to1$7_OrderedSetsToLists = getResourceOrNull(graph, URIs.from1$6to1$7_OrderedSetsToLists);\r
- from1$6to1$7_Spreadsheets = getResourceOrNull(graph, URIs.from1$6to1$7_Spreadsheets);\r
- from1$6to1$7_SysdynChanges = getResourceOrNull(graph, URIs.from1$6to1$7_SysdynChanges);\r
}\r
\r
public static SysdynResource getInstance(ReadGraph graph) {\r
VTT Technical Research Centre of Finland - initial API and implementation\r
-->\r
-<adapters>\r\r <target interface="org.simantics.db.layer0.adapter.Realization">\r <type uri="http://www.simantics.org/Sysdyn-0.0/Module"\r class="org.simantics.structural2.realization.StructuralRealization">\r <this />\r </type>\r </target>\r\r <target interface="org.simantics.layer0.utils.triggers.ITrigger">\r <type uri = "http://www.simantics.org/Sysdyn-0.0/DiagramToCompositeMapping"\r class = "org.simantics.sysdyn.ui.editor.DiagramToCompositeMapping3">\r <graph/>\r <this />\r </type>\r </target>\r \r <target interface="org.simantics.structural.ui.modelBrowser.nodes.AbstractNode">\r <type uri="http://www.simantics.org/Sysdyn-0.0/SysdynModel"\r class="org.simantics.structural.ui.modelBrowser.nodes.ModelNode">\r <this />\r </type>\r </target> \r \r\r <target\r interface="org.simantics.browsing.ui.common.node.AbstractNode">\r <type\r uri="http://www.simantics.org/Sysdyn-0.0/SysdynModel"\r class="org.simantics.sysdyn.ui.browser.nodes.ModelNode">\r <this />\r </type>\r\r <resource\r uri="http://www.simantics.org/Sysdyn-0.0/ModuleSymbol"\r class="org.simantics.sysdyn.ui.browser.nodes.SymbolNode">\r <this />\r </resource>\r\r <type\r uri="http://www.simantics.org/Simulation-0.0/Experiment"\r class="org.simantics.sysdyn.ui.browser.nodes.ExperimentNode">\r <this />\r </type>\r \r <type\r uri="http://www.simantics.org/Sysdyn-0.0/Result"\r class="org.simantics.sysdyn.ui.browser.nodes.SimulationResultNode">\r <this />\r </type>\r \r </target>\r\r <!-- Inject default connection routing algorithm for sysdyn diagrams -->\r <target interface="org.simantics.g2d.diagram.DiagramClass">\r <adapter uri="http://www.simantics.org/Sysdyn-0.0/ConfigurationDiagram"\r adapterClass="org.simantics.sysdyn.ui.elements.ConfigurationDiagramClassAdapter" />\r </target>\r\r <!-- Sysdyn symbols -->\r <target interface="org.simantics.diagram.adapter.ElementFactory">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/StockSymbol"\r class="org.simantics.sysdyn.ui.elements.StockFactory" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModuleSymbol"\r class="org.simantics.sysdyn.ui.elements.ModuleFactory" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ValveSymbol"\r class="org.simantics.sysdyn.ui.elements.ValveFactory" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/AuxiliarySymbol"\r class="org.simantics.sysdyn.ui.elements.AuxiliaryFactory" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/CloudSymbol"\r class="org.simantics.sysdyn.ui.elements.CloudFactory" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/InputSymbol"\r class="org.simantics.sysdyn.ui.elements.InputFactory" />\r\r <type uri="http://www.simantics.org/Sysdyn-0.0/StockSymbol"\r class="org.simantics.sysdyn.ui.elements.StockFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/ModuleSymbol"\r class="org.simantics.sysdyn.ui.elements.ModuleFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/ValveSymbol"\r class="org.simantics.sysdyn.ui.elements.ValveFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/AuxiliarySymbol"\r class="org.simantics.sysdyn.ui.elements.AuxiliaryFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/CloudSymbol"\r class="org.simantics.sysdyn.ui.elements.CloudFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/InputSymbol"\r class="org.simantics.sysdyn.ui.elements.InputFactory" /> \r </target>\r \r <!-- Additional symbols -->\r <target interface="org.simantics.diagram.adapter.ElementFactory">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/AdditionalSymbols/MultilineText"\r class="org.simantics.sysdyn.ui.elements.MultilineTextElementFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/AdditionalSymbols/MultilineText"\r class="org.simantics.sysdyn.ui.elements.MultilineTextElementFactory" /> \r </target> \r \r <!-- Sysdyn connections -->\r <target interface="org.simantics.diagram.adapter.ElementFactory">\r <!-- Edges --> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/FlowConnection"\r class="org.simantics.sysdyn.ui.elements.connections.RouteFlowEdgeFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/FlowConnection"\r class="org.simantics.sysdyn.ui.elements.connections.RouteFlowEdgeFactory" /> \r <type uri="http://www.simantics.org/Sysdyn-0.0/FlowConnection"\r class="org.simantics.sysdyn.ui.elements.connections.RouteFlowConnectionFactory">\r <graph/>\r </type> \r \r <resource uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"\r class="org.simantics.sysdyn.ui.elements.connections.DependencyEdgeFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"\r class="org.simantics.sysdyn.ui.elements.connections.DependencyEdgeFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"\r class="org.simantics.sysdyn.ui.elements.connections.DependencyConnectionFactory" />\r </target>\r \r <target interface="org.simantics.g2d.connection.EdgeVisualsConfigurer">\r <baseType uri="http://www.simantics.org/Diagram-0.0/HasConnector" />\r <resource uri="http://www.simantics.org/Diagram-0.0/HasPlainConnector"\r class="org.simantics.diagram.content.ArrowConfigurer">\r <string>none 0</string>\r </resource>\r <resource uri="http://www.simantics.org/Diagram-0.0/HasArrowConnector"\r class="org.simantics.diagram.content.ArrowConfigurer">\r <string>fill 1</string>\r </resource>\r </target>\r \r <!-- ModelBrowser2 -->\r \r <target interface="org.simantics.browsing.ui.model.children.ChildRule">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ModuleTypeChildRule"\r class="org.simantics.sysdyn.ui.browser.childrules.ModuleTypeChildRule"/>\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ModuleContentChildRule"\r class="org.simantics.sysdyn.ui.browser.childrules.ModuleContentChildRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/VariableChildRule"\r class="org.simantics.sysdyn.ui.browser.childrules.VariableChildRule"/> \r \r <resource uri="http://www.simantics.org/Sysdyn-0.0/HistoryDataset/HistoryDatasetVariablesBrowseContext/VariableChildRule"\r class="org.simantics.sysdyn.ui.properties.widgets.historyDataset.VariableChildRule"/> \r <resource uri=" http://www.simantics.org/Sysdyn-0.0/Module/ParameterOverrideBrowseContext/ParameterChildRule"\r class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterChildRule"/> \r </target>\r \r <target interface="org.simantics.browsing.ui.model.visuals.VisualsRule">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ModuleTypeLabelRule"\r class="org.simantics.sysdyn.ui.browser.labelrules.ModuleTypeLabelRule"/>\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/VariableNameLabelRule"\r class="org.simantics.sysdyn.ui.browser.labelrules.VariableNameLabelRule"/>\r\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/VariableImageRule"\r class="org.simantics.sysdyn.ui.browser.imagerules.VariableImageRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ChartImageRule"\r class="org.simantics.sysdyn.ui.browser.imagerules.ChartImageRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ResultImageRule"\r class="org.simantics.sysdyn.ui.browser.imagerules.ResultImageRule"/> \r \r \r <resource uri="http://www.simantics.org/Sysdyn-0.0/HistoryDataset/HistoryDatasetVariablesBrowseContext/VariableLabelRule"\r class="org.simantics.sysdyn.ui.properties.widgets.historyDataset.VariableLabelRule"/> \r\r \r <resource uri=" http://www.simantics.org/Sysdyn-0.0/Module/ParameterOverrideBrowseContext/ParameterLabelRule"\r class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterLabelRule"/> \r <resource uri=" http://www.simantics.org/Sysdyn-0.0/Module/ParameterOverrideBrowseContext/ParameterLabelDecorationRule"\r class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterLabelDecorationRule"/> \r <resource uri=" http://www.simantics.org/Sysdyn-0.0/Module/ParameterOverrideBrowseContext/ParameterModifierRule"\r class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterModifierRule"/> \r <resource uri=" http://www.simantics.org/Sysdyn-0.0/Module/ParameterOverrideBrowseContext/ParameterSorterRule"\r class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterSorterRule"/> \r </target> \r \r <target interface="org.simantics.db.layer0.adapter.ActionFactory">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewModuleType"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewModuleTypeAction" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewEnumeration"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewEnumerationAction" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewFunction"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewFunctionAction" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewFunctionLibrary"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewFunctionLibraryAction" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewSharedFunctionLibrary"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewSharedFunctionLibraryAction" /> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewExperiment"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewExperimentAction" /> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewSimulationPlaybackExperiment"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewSimulationPlaybackExperimentAction" /> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewLineChart"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewLineChartAction" /> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewBarChart"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewBarChartAction" /> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewPieChart"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewPieChartAction" /> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewSheet"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewSheetAction" /> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewHistoryData"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewHistoryDataAction" /> \r </target> \r \r <target interface="org.simantics.db.layer0.adapter.DropActionFactory">\r <resource\r uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/FunctionDropAction"\r class="org.simantics.sysdyn.ui.browser.actions.drop.FunctionDropAction" />\r <resource\r uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/ChartDropAction"\r class="org.simantics.sysdyn.ui.browser.actions.drop.ChartDropAction" /> \r \r \r </target> \r \r <target interface="org.simantics.db.layer0.adapter.Remover">\r <type uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ModuleSymbol"\r class="org.simantics.sysdyn.ui.browser.actions.remove.ModuleTypeRemover">\r <graph />\r <this />\r </type>\r <type uri="http://www.simantics.org/Sysdyn-0.0/Variable"\r class="org.simantics.sysdyn.ui.actions.SysdynVariableRemover">\r <this />\r </type>\r </target>\r \r \r <target interface="org.simantics.browsing.ui.model.nodetypes.NodeType">\r <baseType uri="http://www.simantics.org/Layer0-0.0/Entity" />\r <type\r uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ModuleSymbolNodeType"\r class="org.simantics.sysdyn.ui.browser.nodeTypes.ModuleSymbolNodeType"\r constructor="create">\r <this/>\r </type> \r </target>\r \r <!-- PROFILES -->\r <target interface="org.simantics.scenegraph.profile.Style">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/SimulationPlaybackStyle"\r class="org.simantics.sysdyn.ui.elements.profiles.SimulationPlaybackStyle">\r </resource>\r <resource uri="http://www.simantics.org/Sysdyn-0.0/IssueStyle"\r class="org.simantics.sysdyn.ui.elements.profiles.IssueDecorationStyle">\r </resource>\r </target>\r \r \r <!-- TODO: currently maps jfree concepts directly to Sysdyn implementations. Sysdyn needs tool specific types for the datasets. -->\r <!-- TODO: AllVariablesOfModel query is run on random Resources; listing all possible types explicitly is cumbersome, we need a better implementation. -->\r <target interface="org.simantics.jfreechart.chart.properties.IAllVariablesOfModel"> \r <type uri="http://www.simantics.org/Sysdyn-1.1/SysdynModel"\r class="org.simantics.sysdyn.ui.trend.AllVariablesOfModel">\r <this />\r </type> \r <type uri="http://www.simantics.org/JFreeChart-1.0/NumberAxis"\r class="org.simantics.sysdyn.ui.trend.AllVariablesOfModel">\r <this />\r </type> \r <type uri="http://www.simantics.org/JFreeChart-1.0/Series"\r class="org.simantics.sysdyn.ui.trend.AllVariablesOfModel">\r <this />\r </type> \r </target> \r \r <target interface="org.simantics.jfreechart.chart.properties.RangeHandlerFactory"> \r <type uri="http://www.simantics.org/Sysdyn-1.1/SysdynModel"\r class="org.simantics.sysdyn.ui.trend.SysdynRangeHandlerFactory">\r </type> \r </target> \r \r <!-- TODO: currently maps jfree concepts directly to Sysdyn implementations. Sysdyn needs tool specific types for the datasets. -->\r <target interface="org.simantics.jfreechart.chart.IDataset">\r <type uri="http://www.simantics.org/JFreeChart-0.0/XYDataset"\r class="org.simantics.sysdyn.ui.trend.XYDataset">\r <graph />\r <this />\r </type>\r <type uri="http://www.simantics.org/JFreeChart-0.0/CategoryDataset"\r class="org.simantics.sysdyn.ui.trend.CategoryDataset">\r <graph />\r <this />\r </type> \r <type uri="http://www.simantics.org/JFreeChart-0.0/PieDataset"\r class="org.simantics.sysdyn.ui.trend.PieDataset">\r <graph />\r <this />\r </type> \r </target>\r
+<adapters>\r\r <target interface="org.simantics.db.layer0.adapter.Realization">\r <type uri="http://www.simantics.org/Sysdyn-0.0/Module"\r class="org.simantics.structural2.realization.StructuralRealization">\r <this />\r </type>\r </target>\r\r <target interface="org.simantics.layer0.utils.triggers.ITrigger">\r <type uri = "http://www.simantics.org/Sysdyn-0.0/DiagramToCompositeMapping"\r class = "org.simantics.sysdyn.ui.editor.DiagramToCompositeMapping3">\r <graph/>\r <this />\r </type>\r </target>\r \r <target interface="org.simantics.structural.ui.modelBrowser.nodes.AbstractNode">\r <type uri="http://www.simantics.org/Sysdyn-0.0/SysdynModel"\r class="org.simantics.structural.ui.modelBrowser.nodes.ModelNode">\r <this />\r </type>\r </target> \r \r\r <target\r interface="org.simantics.browsing.ui.common.node.AbstractNode">\r <type\r uri="http://www.simantics.org/Sysdyn-0.0/SysdynModel"\r class="org.simantics.sysdyn.ui.browser.nodes.ModelNode">\r <this />\r </type>\r\r <resource\r uri="http://www.simantics.org/Sysdyn-0.0/ModuleSymbol"\r class="org.simantics.sysdyn.ui.browser.nodes.SymbolNode">\r <this />\r </resource>\r\r <type\r uri="http://www.simantics.org/Simulation-0.0/Experiment"\r class="org.simantics.sysdyn.ui.browser.nodes.ExperimentNode">\r <this />\r </type>\r \r <type\r uri="http://www.simantics.org/Sysdyn-0.0/Result"\r class="org.simantics.sysdyn.ui.browser.nodes.SimulationResultNode">\r <this />\r </type>\r \r </target>\r\r <!-- Inject default connection routing algorithm for sysdyn diagrams -->\r <target interface="org.simantics.g2d.diagram.DiagramClass">\r <adapter uri="http://www.simantics.org/Sysdyn-0.0/ConfigurationDiagram"\r adapterClass="org.simantics.sysdyn.ui.elements.ConfigurationDiagramClassAdapter" />\r </target>\r\r <!-- Sysdyn symbols -->\r <target interface="org.simantics.diagram.adapter.ElementFactory">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/StockSymbol"\r class="org.simantics.sysdyn.ui.elements.StockFactory" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModuleSymbol"\r class="org.simantics.sysdyn.ui.elements.ModuleFactory" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ValveSymbol"\r class="org.simantics.sysdyn.ui.elements.ValveFactory" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/AuxiliarySymbol"\r class="org.simantics.sysdyn.ui.elements.AuxiliaryFactory" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/CloudSymbol"\r class="org.simantics.sysdyn.ui.elements.CloudFactory" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/InputSymbol"\r class="org.simantics.sysdyn.ui.elements.InputFactory" />\r\r <type uri="http://www.simantics.org/Sysdyn-0.0/StockSymbol"\r class="org.simantics.sysdyn.ui.elements.StockFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/ModuleSymbol"\r class="org.simantics.sysdyn.ui.elements.ModuleFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/ValveSymbol"\r class="org.simantics.sysdyn.ui.elements.ValveFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/AuxiliarySymbol"\r class="org.simantics.sysdyn.ui.elements.AuxiliaryFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/CloudSymbol"\r class="org.simantics.sysdyn.ui.elements.CloudFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/InputSymbol"\r class="org.simantics.sysdyn.ui.elements.InputFactory" /> \r </target>\r \r <!-- Additional symbols -->\r <target interface="org.simantics.diagram.adapter.ElementFactory">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/AdditionalSymbols/MultilineText"\r class="org.simantics.sysdyn.ui.elements.MultilineTextElementFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/AdditionalSymbols/MultilineText"\r class="org.simantics.sysdyn.ui.elements.MultilineTextElementFactory" /> \r </target> \r \r <!-- Sysdyn connections -->\r <target interface="org.simantics.diagram.adapter.ElementFactory">\r <!-- Edges --> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/FlowConnection"\r class="org.simantics.sysdyn.ui.elements.connections.RouteFlowEdgeFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/FlowConnection"\r class="org.simantics.sysdyn.ui.elements.connections.RouteFlowEdgeFactory" /> \r <type uri="http://www.simantics.org/Sysdyn-0.0/FlowConnection"\r class="org.simantics.sysdyn.ui.elements.connections.RouteFlowConnectionFactory">\r <graph/>\r </type> \r \r <resource uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"\r class="org.simantics.sysdyn.ui.elements.connections.DependencyEdgeFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"\r class="org.simantics.sysdyn.ui.elements.connections.DependencyEdgeFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"\r class="org.simantics.sysdyn.ui.elements.connections.DependencyConnectionFactory" />\r </target>\r \r <target interface="org.simantics.g2d.connection.EdgeVisualsConfigurer">\r <baseType uri="http://www.simantics.org/Diagram-0.0/HasConnector" />\r <resource uri="http://www.simantics.org/Diagram-0.0/HasPlainConnector"\r class="org.simantics.diagram.content.ArrowConfigurer">\r <string>none 0</string>\r </resource>\r <resource uri="http://www.simantics.org/Diagram-0.0/HasArrowConnector"\r class="org.simantics.diagram.content.ArrowConfigurer">\r <string>fill 1</string>\r </resource>\r </target>\r \r <!-- ModelBrowser2 -->\r \r <target interface="org.simantics.browsing.ui.model.children.ChildRule">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ModuleTypeChildRule"\r class="org.simantics.sysdyn.ui.browser.childrules.ModuleTypeChildRule"/>\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ModuleContentChildRule"\r class="org.simantics.sysdyn.ui.browser.childrules.ModuleContentChildRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/VariableChildRule"\r class="org.simantics.sysdyn.ui.browser.childrules.VariableChildRule"/> \r \r <resource uri="http://www.simantics.org/Sysdyn-0.0/HistoryDataset/HistoryDatasetVariablesBrowseContext/VariableChildRule"\r class="org.simantics.sysdyn.ui.properties.widgets.historyDataset.VariableChildRule"/> \r <resource uri=" http://www.simantics.org/Sysdyn-0.0/Module/ParameterOverrideBrowseContext/ParameterChildRule"\r class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterChildRule"/> \r </target>\r \r <target interface="org.simantics.browsing.ui.model.visuals.VisualsRule">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ModuleTypeLabelRule"\r class="org.simantics.sysdyn.ui.browser.labelrules.ModuleTypeLabelRule"/>\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/VariableNameLabelRule"\r class="org.simantics.sysdyn.ui.browser.labelrules.VariableNameLabelRule"/>\r\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/VariableImageRule"\r class="org.simantics.sysdyn.ui.browser.imagerules.VariableImageRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ChartImageRule"\r class="org.simantics.sysdyn.ui.browser.imagerules.ChartImageRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ResultImageRule"\r class="org.simantics.sysdyn.ui.browser.imagerules.ResultImageRule"/> \r \r \r <resource uri="http://www.simantics.org/Sysdyn-0.0/HistoryDataset/HistoryDatasetVariablesBrowseContext/VariableLabelRule"\r class="org.simantics.sysdyn.ui.properties.widgets.historyDataset.VariableLabelRule"/> \r\r \r <resource uri=" http://www.simantics.org/Sysdyn-0.0/Module/ParameterOverrideBrowseContext/ParameterLabelRule"\r class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterLabelRule"/> \r <resource uri=" http://www.simantics.org/Sysdyn-0.0/Module/ParameterOverrideBrowseContext/ParameterLabelDecorationRule"\r class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterLabelDecorationRule"/> \r <resource uri=" http://www.simantics.org/Sysdyn-0.0/Module/ParameterOverrideBrowseContext/ParameterModifierRule"\r class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterModifierRule"/> \r <resource uri=" http://www.simantics.org/Sysdyn-0.0/Module/ParameterOverrideBrowseContext/ParameterSorterRule"\r class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterSorterRule"/> \r </target> \r \r <target interface="org.simantics.db.layer0.adapter.ActionFactory">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewModuleType"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewModuleTypeAction" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewEnumeration"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewEnumerationAction" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewFunction"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewFunctionAction" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewFunctionLibrary"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewFunctionLibraryAction" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewSharedFunctionLibrary"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewSharedFunctionLibraryAction" /> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewExperiment"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewExperimentAction" /> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewSimulationPlaybackExperiment"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewSimulationPlaybackExperimentAction" /> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewLineChart"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewLineChartAction" /> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewBarChart"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewBarChartAction" /> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewPieChart"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewPieChartAction" /> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewSheet"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewSheetAction" /> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/NewHistoryData"\r class="org.simantics.sysdyn.ui.browser.actions.newActions.NewHistoryDataAction" /> \r </target> \r \r <target interface="org.simantics.db.layer0.adapter.DropActionFactory">\r <resource\r uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/FunctionDropAction"\r class="org.simantics.sysdyn.ui.browser.actions.drop.FunctionDropAction" />\r <resource\r uri="http://www.simantics.org/Sysdyn-0.0/ModelingActionContext/Actions/ChartDropAction"\r class="org.simantics.sysdyn.ui.browser.actions.drop.ChartDropAction" /> \r \r \r </target> \r \r <target interface="org.simantics.db.layer0.adapter.Remover">\r <type uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ModuleSymbol"\r class="org.simantics.sysdyn.ui.browser.actions.remove.ModuleTypeRemover">\r <graph />\r <this />\r </type>\r <type uri="http://www.simantics.org/Sysdyn-0.0/Variable"\r class="org.simantics.sysdyn.ui.actions.SysdynVariableRemover">\r <this />\r </type>\r </target>\r \r \r <target interface="org.simantics.browsing.ui.model.nodetypes.NodeType">\r <baseType uri="http://www.simantics.org/Layer0-0.0/Entity" />\r <type\r uri="http://www.simantics.org/Sysdyn-0.0/ModelingBrowseContext/ModuleSymbolNodeType"\r class="org.simantics.sysdyn.ui.browser.nodeTypes.ModuleSymbolNodeType"\r constructor="create">\r <this/>\r </type> \r </target>\r \r <!-- PROFILES -->\r <target interface="org.simantics.scenegraph.profile.Style">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/SimulationPlaybackStyle"\r class="org.simantics.sysdyn.ui.elements.profiles.SimulationPlaybackStyle">\r </resource>\r <resource uri="http://www.simantics.org/Sysdyn-0.0/IssueStyle"\r class="org.simantics.sysdyn.ui.elements.profiles.IssueDecorationStyle">\r </resource>\r </target>\r \r \r <!-- TODO: currently maps jfree concepts directly to Sysdyn implementations. Sysdyn needs tool specific types for the datasets. -->\r <!-- TODO: AllVariablesOfModel query is run on random Resources; listing all possible types explicitly is cumbersome, we need a better implementation. -->\r <target interface="org.simantics.jfreechart.chart.properties.IAllVariablesOfModel"> \r <type uri="http://www.simantics.org/Sysdyn-1.1/SysdynModel"\r class="org.simantics.sysdyn.ui.trend.AllVariablesOfModel">\r <this />\r </type> \r <type uri="http://www.simantics.org/JFreeChart-1.0/NumberAxis"\r class="org.simantics.sysdyn.ui.trend.AllVariablesOfModel">\r <this />\r </type> \r <type uri="http://www.simantics.org/JFreeChart-1.0/Series"\r class="org.simantics.sysdyn.ui.trend.AllVariablesOfModel">\r <this />\r </type> \r </target> \r \r <target interface="org.simantics.jfreechart.chart.properties.RangeHandlerFactory"> \r <type uri="http://www.simantics.org/Sysdyn-1.1/SysdynModel"\r class="org.simantics.sysdyn.ui.trend.SysdynRangeHandlerFactory">\r </type> \r </target> \r \r <!-- TODO: currently maps jfree concepts directly to Sysdyn implementations. Sysdyn needs tool specific types for the datasets. -->\r <target interface="org.simantics.jfreechart.chart.IDataset">\r <type uri="http://www.simantics.org/JFreeChart-0.0/XYDataset"\r class="org.simantics.sysdyn.ui.trend.XYDataset">\r <graph />\r <this />\r </type>\r <type uri="http://www.simantics.org/JFreeChart-0.0/CategoryDataset"\r class="org.simantics.sysdyn.ui.trend.CategoryDataset">\r <graph />\r <this />\r </type> \r <type uri="http://www.simantics.org/JFreeChart-0.0/PieDataset"\r class="org.simantics.sysdyn.ui.trend.PieDataset">\r <graph />\r <this />\r </type> \r <type uri="http://www.simantics.org/Sysdyn-0.0/SensitivityAnalysisExperiment/SensitivityDataset"\r class="org.simantics.sysdyn.ui.trend.SensitivityDataset">\r <graph />\r <this />\r </type>\r </target>\r
</adapters>
\ No newline at end of file
</with>\r
</visibleWhen>\r
</command>\r
+ <command\r
+ commandId="org.simantics.sysdyn.ui.newSensitivityChart"\r
+ icon="platform:/plugin/com.famfamfam.silk/icons/chart_line.png"\r
+ id="org.simantics.sysdyn.ui.browser.newSensitivityChart"\r
+ label="Sensitivity Chart"\r
+ style="push">\r
+ <visibleWhen\r
+ checkEnabled="true">\r
+ <with\r
+ variable="selection">\r
+ <test\r
+ args="org.simantics.sysdyn.ui.browser.nodes.ChartsFolder"\r
+ property="org.simantics.sysdyn.ui.nodeClass">\r
+ </test>\r
+ </with>\r
+ </visibleWhen>\r
+ </command>\r
<command\r
commandId="org.simantics.sysdyn.ui.newHistoryData"\r
icon="platform:/plugin/com.famfamfam.silk/icons/table.png"\r
id="org.simantics.sysdyn.ui.newPieChart"\r
name="New Pie Chart">\r
</command>\r
+ <command\r
+ defaultHandler="org.simantics.sysdyn.ui.handlers.newComponents.NewSensitivityChartHandler"\r
+ id="org.simantics.sysdyn.ui.newSensitivityChart"\r
+ name="New XY Line Chart">\r
+ </command> \r
<command\r
defaultHandler="org.simantics.sysdyn.ui.handlers.newComponents.NewHistoryDataHandler"\r
id="org.simantics.sysdyn.ui.newHistoryData"\r
\r
kpe = (KeyPressedEvent) ke;\r
\r
- if (kpe.stateMask != java.awt.event.KeyEvent.SHIFT_DOWN_MASK || isEditing()) \r
+ if (!kpe.isShiftDown() || isEditing()) \r
return false;\r
\r
if (kpe.keyCode == java.awt.event.KeyEvent.VK_A) {\r
import org.simantics.sysdyn.JFreeChartResource;\r
import org.simantics.sysdyn.ui.browser.nodes.ChartsFolder;\r
import org.simantics.ui.SimanticsUI;\r
-import org.simantics.ui.utils.AdaptionUtils;\r
+import org.simantics.utils.ui.AdaptionUtils;\r
\r
/**\r
* Handler for creating a new Bar Chart\r
import org.simantics.sysdyn.SysdynResource;\r
import org.simantics.sysdyn.ui.browser.nodes.ExperimentsFolder;\r
import org.simantics.ui.SimanticsUI;\r
-import org.simantics.ui.utils.AdaptionUtils;\r
+import org.simantics.utils.ui.AdaptionUtils;\r
\r
/**\r
* Creates a new normal SysDyn experiment\r
import org.simantics.layer0.utils.direct.GraphUtils;\r
import org.simantics.sysdyn.SysdynResource;\r
import org.simantics.ui.SimanticsUI;\r
-import org.simantics.ui.utils.AdaptionUtils;\r
+import org.simantics.utils.ui.AdaptionUtils;\r
\r
/**\r
* Creates a new function to a SysdynModel or Library.\r
import org.simantics.layer0.utils.direct.GraphUtils;\r
import org.simantics.sysdyn.SysdynResource;\r
import org.simantics.ui.SimanticsUI;\r
-import org.simantics.ui.utils.AdaptionUtils;\r
+import org.simantics.utils.ui.AdaptionUtils;\r
\r
/**\r
* Creates a new function library to a model or other library.\r
import org.simantics.layer0.utils.direct.GraphUtils;\r
import org.simantics.sysdyn.SysdynResource;\r
import org.simantics.ui.SimanticsUI;\r
-import org.simantics.ui.utils.AdaptionUtils;\r
+import org.simantics.utils.ui.AdaptionUtils;\r
\r
/**\r
* Handler for creating new history dataset\r
import org.simantics.sysdyn.ui.browser.actions.newActions.NewModuleTypeAction;\r
import org.simantics.sysdyn.ui.browser.nodes.ModulesNode;\r
import org.simantics.ui.SimanticsUI;\r
-import org.simantics.ui.utils.AdaptionUtils;\r
+import org.simantics.utils.ui.AdaptionUtils;\r
import org.simantics.utils.datastructures.ArrayMap;\r
\r
/**\r
import org.simantics.sysdyn.JFreeChartResource;\r
import org.simantics.sysdyn.ui.browser.nodes.ChartsFolder;\r
import org.simantics.ui.SimanticsUI;\r
-import org.simantics.ui.utils.AdaptionUtils;\r
+import org.simantics.utils.ui.AdaptionUtils;\r
\r
/**\r
* Handler for craeting a new Pie Chart\r
graph.claimLiteral(experiment, sr.SensitivityAnalysisExperiment_minValue, SysdynSensitivityAnalysisExperiment.DEFAULT_MIN_VALUE);\r
graph.claimLiteral(experiment, sr.SensitivityAnalysisExperiment_maxValue, SysdynSensitivityAnalysisExperiment.DEFAULT_MAX_VALUE);\r
graph.claimLiteral(experiment, sr.SensitivityAnalysisExperiment_numValues, SysdynSensitivityAnalysisExperiment.DEFAULT_NUM_VALUES);\r
+ graph.claimLiteral(experiment, sr.SensitivityAnalysisExperiment_mean, SysdynSensitivityAnalysisExperiment.DEFAULT_MEAN);\r
+ graph.claimLiteral(experiment, sr.SensitivityAnalysisExperiment_stdDeviation, SysdynSensitivityAnalysisExperiment.DEFAULT_STD_DEVIATION);\r
graph.claimLiteral(experiment, sr.SensitivityAnalysisExperiment_propabilityDistribution, "uniform");\r
}\r
\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.ui.handlers.newComponents;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collections;\r
+import java.util.UUID;\r
+\r
+import org.eclipse.core.commands.AbstractHandler;\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+import org.eclipse.jface.viewers.ISelection;\r
+import org.eclipse.ui.handlers.HandlerUtil;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.common.utils.ListUtils;\r
+import org.simantics.db.common.utils.NameUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.diagram.stubs.G2DResource;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.layer0.utils.direct.GraphUtils;\r
+import org.simantics.sysdyn.JFreeChartResource;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.ui.browser.nodes.ChartsFolder;\r
+import org.simantics.ui.SimanticsUI;\r
+import org.simantics.utils.ui.AdaptionUtils;\r
+\r
+public class NewSensitivityChartHandler extends AbstractHandler {\r
+ @Override\r
+ public Object execute(ExecutionEvent event) throws ExecutionException {\r
+\r
+\r
+ ISelection sel = HandlerUtil.getCurrentSelection(event);\r
+\r
+ ChartsFolder node = AdaptionUtils.adaptToSingle(sel, ChartsFolder.class);\r
+ if (node == null)\r
+ return null;\r
+\r
+ final Resource model = node.data; \r
+\r
+ SimanticsUI.getSession().asyncRequest(new WriteRequest() {\r
+\r
+ @Override\r
+ public void perform(WriteGraph g) throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(g);\r
+ JFreeChartResource jfree = JFreeChartResource.getInstance(g);\r
+ G2DResource g2d = G2DResource.getInstance(g);\r
+\r
+ Resource jfreechart = GraphUtils.create2(g, jfree.Chart,\r
+ l0.HasName, "SensitivityChart" + UUID.randomUUID().toString(),\r
+ l0.HasLabel, NameUtils.findFreshLabel(g, "SensitivityChart", model),\r
+ l0.PartOf, model,\r
+ jfree.Chart_visibleBorder, true,\r
+ jfree.Chart_borderWidth, 3);\r
+ g.claimLiteral(jfreechart, jfree.Chart_borderColor, g2d.Color, new float[] {0,0,0,1});\r
+\r
+ GraphUtils.create2(g, jfree.TextTitle,\r
+ l0.HasName, "TextTitle" + UUID.randomUUID().toString(),\r
+ l0.HasLabel, "Chart Title",\r
+ jfree.Title_position, jfree.Top,\r
+ l0.PartOf, jfreechart);\r
+\r
+ Resource domainAxis = GraphUtils.create2(g, jfree.NumberAxis,\r
+ l0.HasName, "NumberAxis" + UUID.randomUUID().toString());\r
+ Resource rangeAxis = GraphUtils.create2(g, jfree.NumberAxis,\r
+ l0.HasName, "NumberAxis" + UUID.randomUUID().toString(),\r
+ l0.HasLabel, "Y-axis");\r
+\r
+ Resource renderer = GraphUtils.create2(g, jfree.DeviationRenderer);\r
+\r
+ Resource dataset = GraphUtils.create2(g, SysdynResource.getInstance(g).SensitivityAnalysisExperiment_SensitivityDataset,\r
+ l0.HasName, "SensitivityDataset" + UUID.randomUUID().toString(),\r
+ jfree.Dataset_mapToDomainAxis, domainAxis,\r
+ jfree.Dataset_mapToRangeAxis, rangeAxis,\r
+ jfree.Dataset_seriesList, ListUtils.create(g, new ArrayList<Resource>()),\r
+ jfree.Dataset_renderer, renderer);\r
+\r
+ GraphUtils.create2(g, jfree.XYPlot,\r
+ l0.HasName, "XYPlot" + UUID.randomUUID().toString(),\r
+ l0.PartOf, jfreechart,\r
+ jfree.Plot_domainAxis, domainAxis,\r
+ jfree.Plot_rangeAxis, rangeAxis,\r
+ jfree.Plot_rangeAxisList, ListUtils.create(g, Collections.singletonList(rangeAxis)),\r
+ l0.ConsistsOf, dataset,\r
+ l0.ConsistsOf, domainAxis,\r
+ l0.ConsistsOf, rangeAxis);\r
+ }\r
+\r
+ });\r
+\r
+\r
+\r
+ return null;\r
+ }\r
+}
\ No newline at end of file
import org.eclipse.ui.handlers.HandlerUtil;\r
import org.simantics.browsing.ui.common.node.AbstractNode;\r
import org.simantics.db.Resource;\r
-import org.simantics.ui.utils.AdaptionUtils;\r
+import org.simantics.utils.ui.AdaptionUtils;\r
\r
/**\r
* Creates a new shared function library.\r
import org.simantics.sysdyn.JFreeChartResource;\r
import org.simantics.sysdyn.ui.browser.nodes.ChartsFolder;\r
import org.simantics.ui.SimanticsUI;\r
-import org.simantics.ui.utils.AdaptionUtils;\r
+import org.simantics.utils.ui.AdaptionUtils;\r
\r
/**\r
* Handler for creating a new XYLineChart in model browser\r
if(instanceOf == null) return result;\r
Resource configuration = graph.getSingleObject(instanceOf, sr2.IsDefinedBy);\r
for(Resource input : graph.syncRequest(new ObjectsWithType(configuration, l0.ConsistsOf, sr.Input))) {\r
+ if(!graph.getObjects(input, sr.Variable_isHeadOf).isEmpty())\r
+ continue; // Only inputs with tail dependencies allowed.\r
+ \r
Resource dependency = null;\r
for(Resource dep : graph.getObjects(module, sr.Variable_isHeadOf)) {\r
Resource refersTo = graph.getPossibleObject(dep, sr.Dependency_refersTo);\r
numValues.setInputValidator(new IntegerValidator());\r
numValues.setColorProvider(new SysdynBasicColorProvider(new LocalResourceManager(JFaceResources.getResources(), numValues.getWidget())));\r
\r
+ // mean\r
+ label = new Label(composite, SWT.NONE);\r
+ label.setText("Mean");\r
+ \r
+ TrackedText mean = new TrackedText(composite, support, SWT.BORDER);\r
+ mean.setTextFactory(new DoublePropertyFactory(SysdynResource.URIs.SensitivityAnalysisExperiment_mean));\r
+ mean.addModifyListener(new DoublePropertyModifier(context, SysdynResource.URIs.SensitivityAnalysisExperiment_mean));\r
+ mean.setInputValidator(new DoubleValidator());\r
+ mean.setColorProvider(new SysdynBasicColorProvider(new LocalResourceManager(JFaceResources.getResources(), mean.getWidget())));\r
+ \r
+ // standard deviation\r
+ label = new Label(composite, SWT.NONE);\r
+ label.setText("Standard deviation");\r
+ \r
+ TrackedText stdDeviation = new TrackedText(composite, support, SWT.BORDER);\r
+ stdDeviation.setTextFactory(new DoublePropertyFactory(SysdynResource.URIs.SensitivityAnalysisExperiment_stdDeviation));\r
+ stdDeviation.addModifyListener(new DoublePropertyModifier(context, SysdynResource.URIs.SensitivityAnalysisExperiment_stdDeviation));\r
+ stdDeviation.setInputValidator(new DoubleValidator());\r
+ stdDeviation.setColorProvider(new SysdynBasicColorProvider(new LocalResourceManager(JFaceResources.getResources(), stdDeviation.getWidget())));\r
+ \r
// Scrolled composite settings\r
sc.setContent(composite);\r
sc.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));\r
@Override\r
public void save(final Resource expression, Map<String, Object> data) {\r
final String currentText = this.expression.getExpression();\r
- if(currentText != null) {\r
+ if(currentText != null && !currentText.equals(data.get("initialEquation"))) {\r
SimanticsUI.getSession().asyncRequest(new WriteRequest() {\r
\r
@Override\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.ui.trend;\r
+\r
+import java.awt.BasicStroke;\r
+import java.awt.Paint;\r
+import java.util.ArrayList;\r
+import java.util.Collections;\r
+\r
+import javax.swing.SwingUtilities;\r
+\r
+import org.jfree.chart.ChartColor;\r
+import org.jfree.chart.renderer.AbstractRenderer;\r
+import org.jfree.chart.renderer.xy.DeviationRenderer;\r
+import org.jfree.data.general.Dataset;\r
+import org.jfree.data.xy.YIntervalSeries;\r
+import org.jfree.data.xy.YIntervalSeriesCollection;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.common.procedure.adapter.DisposableListener;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.jfreechart.chart.IRenderer;\r
+import org.simantics.ui.SimanticsUI;\r
+import org.simantics.utils.datastructures.Pair;\r
+\r
+public class SensitivityDataset extends XYDataset {\r
+\r
+ DeviationRenderer renderer;\r
+ \r
+ public SensitivityDataset(ReadGraph graph, Resource resource) throws DatabaseException {\r
+ super(graph, resource);\r
+ }\r
+\r
+ @Override\r
+ public Dataset getDataset() {\r
+ if(dataset == null) {\r
+ dataset = new YIntervalSeriesCollection();\r
+ } \r
+\r
+ if(datasetListener == null || datasetListener.isDisposed()) {\r
+ SimanticsUI.getSession().asyncRequest(getDatasetRequest(), getDatasetListener()); \r
+ }\r
+\r
+ if(timeListener == null || timeListener.isDisposed()) {\r
+ SimanticsUI.getSession().asyncRequest(getTimeRequest(), getTimeListener());\r
+ }\r
+ return dataset;\r
+ }\r
+\r
+ @Override\r
+ public AbstractRenderer getRenderer() {\r
+ if(renderer == null)\r
+ renderer = new DeviationRenderer(true, false);\r
+ return renderer;\r
+ }\r
+ \r
+ @Override\r
+ protected DisposableListener<Pair<ArrayList<TempSeries>, IRenderer>> getDatasetListener() {\r
+ if(datasetListener == null || datasetListener.isDisposed()) {\r
+ datasetListener = new SensitivityDatasetListener();\r
+ }\r
+ return datasetListener;\r
+ }\r
+\r
+ private class SensitivityDatasetListener extends DisposableListener<Pair<ArrayList<TempSeries>, IRenderer>> {\r
+\r
+ @Override\r
+ public void execute(Pair<ArrayList<TempSeries>, IRenderer> result) {\r
+ final ArrayList<TempSeries> series = result.first;\r
+ \r
+ // Modify series in AWT thread to avoid synchronization problems\r
+ SwingUtilities.invokeLater(new Runnable() {\r
+\r
+ @Override\r
+ public void run() {\r
+\r
+ if(dataset == null || !(dataset instanceof YIntervalSeriesCollection))\r
+ return;\r
+ \r
+ YIntervalSeriesCollection ds = (YIntervalSeriesCollection)dataset;\r
+\r
+ DeviationRenderer dr = (DeviationRenderer)getRenderer();\r
+ Paint[] paints = {\r
+ ChartColor.LIGHT_RED,\r
+ ChartColor.LIGHT_YELLOW,\r
+ ChartColor.LIGHT_GREEN,\r
+ ChartColor.LIGHT_BLUE,\r
+ ChartColor.LIGHT_GRAY\r
+ };\r
+ for(int i = 0; i < paints.length; i++) {\r
+ dr.setSeriesStroke(i, new BasicStroke(2F, 1, 1));\r
+ dr.setSeriesPaint(i, paints[i]);\r
+ dr.setSeriesFillPaint(i, paints[i]);\r
+ }\r
+ dr.setAlpha(1);\r
+ \r
+ // Remove all series\r
+ for(int i = ds.getSeriesCount() - 1; i >= 0; i-- ) {\r
+ ds.removeSeries(ds.getSeries(i));\r
+ }\r
+ \r
+ int n = series.size();\r
+ if(n < 1)\r
+ return;\r
+ \r
+ int length = series.get(0).values[0].length;\r
+ \r
+ YIntervalSeries median = new YIntervalSeries("Median");\r
+ YIntervalSeries p100 = new YIntervalSeries("100%");\r
+ YIntervalSeries p75 = new YIntervalSeries("75%");\r
+ YIntervalSeries p50 = new YIntervalSeries("50%");\r
+ YIntervalSeries p25 = new YIntervalSeries("25%");\r
+\r
+ ArrayList<Double> sorter = new ArrayList<Double>();\r
+ for(int i = 0; i < length; i++) {\r
+ sorter.clear();\r
+ for(int j = 0; j < n; j++) {\r
+ sorter.add(series.get(j).values[1][i]); // values is a two-dimensional array. 0 dimension == times, 1 == values\r
+ }\r
+ Collections.sort(sorter);\r
+ \r
+ median.add(\r
+ series.get(0).values[0][i], \r
+ sorter.get(sorter.size()/2),\r
+ sorter.get(sorter.size()/2),\r
+ sorter.get(sorter.size()/2)\r
+ );\r
+ \r
+ if(n > 8)\r
+ p25.add(\r
+ series.get(0).values[0][i], \r
+ sorter.get(sorter.size()/2),\r
+ sorter.get(sorter.size() / 2 - (int)(sorter.size() * 0.25) / 2),\r
+ sorter.get(sorter.size() / 2 + (int)(sorter.size() * 0.25) / 2)\r
+ );\r
+ \r
+ if(n > 4)\r
+ p50.add(\r
+ series.get(0).values[0][i], \r
+ sorter.get(sorter.size()/2),\r
+ sorter.get(sorter.size() / 2 - (int)(sorter.size() * 0.5) / 2),\r
+ sorter.get(sorter.size() / 2 + (int)(sorter.size() * 0.5) / 2)\r
+ );\r
+ \r
+ if(n > 8)\r
+ p75.add(\r
+ series.get(0).values[0][i], \r
+ sorter.get(sorter.size()/2),\r
+ sorter.get(sorter.size() / 2 - (int)(sorter.size() * 0.75) / 2),\r
+ sorter.get(sorter.size() / 2 + (int)(sorter.size() * 0.75) / 2)\r
+ );\r
+ \r
+ p100.add(\r
+ series.get(0).values[0][i], \r
+ sorter.get(sorter.size()/2),\r
+ sorter.get(0),\r
+ sorter.get(sorter.size() - 1)\r
+ );\r
+ }\r
+ \r
+ ds.addSeries(median);\r
+ if(n > 8)\r
+ ds.addSeries(p25);\r
+ if(n > 4)\r
+ ds.addSeries(p50);\r
+ if(n > 8)\r
+ ds.addSeries(p75);\r
+ ds.addSeries(p100);\r
+\r
+ }\r
+ });\r
+ }\r
+\r
+ @Override\r
+ public void exception(Throwable t) {\r
+ t.printStackTrace();\r
+ }\r
+\r
+ }\r
+}\r
import org.simantics.db.layer0.request.PossibleActiveExperiment;\r
import org.simantics.db.layer0.variable.Variable;\r
import org.simantics.db.layer0.variable.Variables;\r
-import org.simantics.db.procedure.Listener;\r
+import org.simantics.db.common.procedure.adapter.DisposableListener;\r
import org.simantics.db.request.Read;\r
import org.simantics.diagram.G2DUtils;\r
import org.simantics.jfreechart.chart.AbstractDataset;\r
*/\r
public class XYDataset extends AbstractDataset implements org.simantics.jfreechart.chart.XYDataset{\r
\r
- private IRenderer renderer;\r
+ protected IRenderer renderer;\r
\r
public XYDataset(ReadGraph graph, final Resource datasetResource) throws DatabaseException {\r
super(graph, datasetResource);\r
}\r
\r
- private DefaultXYDataset dataset;\r
- private DataSetListener datasetListener;\r
- private TimeListener timeListener;\r
-\r
- @Override\r
- public Dataset getDataset() {\r
- if(dataset == null) {\r
- dataset = new DefaultXYDataset();\r
- } \r
-\r
+ protected Dataset dataset;\r
+ protected DisposableListener<Pair<ArrayList<TempSeries>, IRenderer>> datasetListener;\r
+ protected DisposableListener<Double> timeListener;\r
+ \r
+ protected DisposableListener<Pair<ArrayList<TempSeries>, IRenderer>> getDatasetListener() {\r
if(datasetListener == null || datasetListener.isDisposed()) {\r
datasetListener = new DataSetListener();\r
- SimanticsUI.getSession().asyncRequest(new Read<Pair<ArrayList<TempSeries>, IRenderer>>() {\r
-\r
- @Override\r
- public Pair<ArrayList<TempSeries>, IRenderer> perform(ReadGraph graph) throws DatabaseException {\r
- JFreeChartResource jfree = JFreeChartResource.getInstance(graph);\r
-\r
- // Renderer\r
- IRenderer renderer = null;\r
- Resource rendererResource = graph.getPossibleObject(resource, jfree.Dataset_renderer);\r
- if(rendererResource != null)\r
- renderer = graph.adapt(rendererResource, IRenderer.class);\r
-\r
- ArrayList<TempSeries> series = new ArrayList<TempSeries>();\r
-\r
- String realizationURI = getRealizationURI(graph);\r
-\r
- if(realizationURI == null)\r
- return new Pair<ArrayList<TempSeries>, IRenderer>(series, renderer); // No experiment -> No results\r
+ }\r
+ return datasetListener;\r
+ }\r
\r
- // Get a variable for the x-axis (if not time)\r
- double[] domainValues = null;\r
- Resource domainAxis = graph.getPossibleObject(resource, jfree.Dataset_mapToDomainAxis);\r
- if(domainAxis != null) {\r
- String rvi = graph.getPossibleRelatedValue(domainAxis, jfree.variableRVI);\r
- if(rvi != null && !rvi.isEmpty()) {\r
- try {\r
- Variable domainVariable = Variables.getVariable(graph, realizationURI + rvi);\r
- Variable valuesVariable = domainVariable.browsePossible(graph, "#" + Functions.VALUES +"#");\r
- if(valuesVariable != null) {\r
- double[][] valuesArray = valuesVariable.getValue(graph);\r
- if(valuesArray.length > 0)\r
- domainValues = valuesArray[0];\r
- }\r
- } catch(MissingVariableException e) {\r
- //Do nothing, use time as domain axis\r
+ protected DisposableListener<Double> getTimeListener() {\r
+ if(timeListener == null || timeListener.isDisposed()) {\r
+ timeListener = new TimeListener();\r
+ }\r
+ return timeListener;\r
+ }\r
+ \r
+ protected Read<Pair<ArrayList<TempSeries>, IRenderer>> getDatasetRequest() {\r
+ return new Read<Pair<ArrayList<TempSeries>, IRenderer>>() {\r
+\r
+ @Override\r
+ public Pair<ArrayList<TempSeries>, IRenderer> perform(ReadGraph graph) throws DatabaseException {\r
+ JFreeChartResource jfree = JFreeChartResource.getInstance(graph);\r
+\r
+ // Renderer\r
+ IRenderer renderer = null;\r
+ Resource rendererResource = graph.getPossibleObject(resource, jfree.Dataset_renderer);\r
+ if(rendererResource != null)\r
+ renderer = graph.adapt(rendererResource, IRenderer.class);\r
+\r
+ ArrayList<TempSeries> series = new ArrayList<TempSeries>();\r
+\r
+ String realizationURI = getRealizationURI(graph);\r
+\r
+ if(realizationURI == null)\r
+ return new Pair<ArrayList<TempSeries>, IRenderer>(series, renderer); // No experiment -> No results\r
+\r
+ // Get a variable for the x-axis (if not time)\r
+ double[] domainValues = null;\r
+ Resource domainAxis = graph.getPossibleObject(resource, jfree.Dataset_mapToDomainAxis);\r
+ if(domainAxis != null) {\r
+ String rvi = graph.getPossibleRelatedValue(domainAxis, jfree.variableRVI);\r
+ if(rvi != null && !rvi.isEmpty()) {\r
+ try {\r
+ Variable domainVariable = Variables.getVariable(graph, realizationURI + rvi);\r
+ Variable valuesVariable = domainVariable.browsePossible(graph, "#" + Functions.VALUES +"#");\r
+ if(valuesVariable != null) {\r
+ double[][] valuesArray = valuesVariable.getValue(graph);\r
+ if(valuesArray.length > 0)\r
+ domainValues = valuesArray[0];\r
}\r
+ } catch(MissingVariableException e) {\r
+ //Do nothing, use time as domain axis\r
}\r
}\r
+ }\r
\r
- Resource seriesList = graph.getPossibleObject(resource, jfree.Dataset_seriesList);\r
+ Resource seriesList = graph.getPossibleObject(resource, jfree.Dataset_seriesList);\r
\r
- // Get properties for all series\r
- if(seriesList != null) {\r
- for(Resource r : ListUtils.toList(graph, seriesList)) {\r
- String rvi = graph.getPossibleRelatedValue(r, jfree.variableRVI);\r
- if(rvi == null)\r
- continue;\r
+ // Get properties for all series\r
+ if(seriesList != null) {\r
+ for(Resource r : ListUtils.toList(graph, seriesList)) {\r
+ String rvi = graph.getPossibleRelatedValue(r, jfree.variableRVI);\r
+ if(rvi == null)\r
+ continue;\r
\r
- try {\r
- // Get visual properties\r
- Integer width = graph.getPossibleRelatedValue(r, jfree.Series_lineWidth, Bindings.INTEGER);\r
- if(width == null) width = 1;\r
+ try {\r
+ // Get visual properties\r
+ Integer width = graph.getPossibleRelatedValue(r, jfree.Series_lineWidth, Bindings.INTEGER);\r
+ if(width == null) width = 1;\r
\r
- Resource c = graph.getPossibleObject(r, jfree.color);\r
- Color color = c == null ? null : G2DUtils.getColor(graph, c);\r
- \r
- String label = graph.getPossibleRelatedValue(r, Layer0.getInstance(graph).HasLabel);\r
+ Resource c = graph.getPossibleObject(r, jfree.color);\r
+ Color color = c == null ? null : G2DUtils.getColor(graph, c);\r
+ \r
+ String label = graph.getPossibleRelatedValue(r, Layer0.getInstance(graph).HasLabel);\r
\r
- // Get a variable for the series\r
- Variable v = Variables.getVariable(graph, realizationURI + rvi);\r
- if(v == null)\r
- return new Pair<ArrayList<TempSeries>, IRenderer>(series, renderer);\r
+ // Get a variable for the series\r
+ Variable v = Variables.getVariable(graph, realizationURI + rvi);\r
+ if(v == null)\r
+ return new Pair<ArrayList<TempSeries>, IRenderer>(series, renderer);\r
\r
- // Get values\r
- Variable dsVariable = v.browsePossible(graph, "#" + Functions.ACTIVE_DATASETS + "#");\r
- Object object = null;\r
- if(dsVariable != null)\r
- object = dsVariable.getValue(graph);\r
+ // Get values\r
+ Variable dsVariable = v.browsePossible(graph, "#" + Functions.ACTIVE_DATASETS + "#");\r
+ Object object = null;\r
+ if(dsVariable != null)\r
+ object = dsVariable.getValue(graph);\r
\r
- if(object == null || !(object instanceof ArrayList<?>))\r
- return new Pair<ArrayList<TempSeries>, IRenderer>(series, renderer);\r
+ if(object == null || !(object instanceof ArrayList<?>))\r
+ return new Pair<ArrayList<TempSeries>, IRenderer>(series, renderer);\r
\r
- ArrayList<SysdynDataSet> datasets = new ArrayList<SysdynDataSet>();\r
+ ArrayList<SysdynDataSet> datasets = new ArrayList<SysdynDataSet>();\r
\r
- for(Object o : (ArrayList<?>)object) {\r
- if(o instanceof SysdynDataSet)\r
- datasets.add((SysdynDataSet)o);\r
- }\r
+ for(Object o : (ArrayList<?>)object) {\r
+ if(o instanceof SysdynDataSet)\r
+ datasets.add((SysdynDataSet)o);\r
+ }\r
\r
\r
- String[] filter = graph.getPossibleRelatedValue(r, jfree.variableFilter);\r
- if(filter != null) {\r
- ArrayList<SysdynDataSet> result2 = VariableRVIUtils.getDataset(datasets, filter);\r
- if(result2 != null) {\r
- datasets = result2;\r
- }\r
+ String[] filter = graph.getPossibleRelatedValue(r, jfree.variableFilter);\r
+ if(filter != null) {\r
+ ArrayList<SysdynDataSet> result2 = VariableRVIUtils.getDataset(datasets, filter);\r
+ if(result2 != null) {\r
+ datasets = result2;\r
}\r
+ }\r
+\r
+ for(SysdynDataSet dataset : datasets) {\r
+ double[] va = dataset.values;\r
\r
- for(SysdynDataSet dataset : datasets) {\r
- double[] va = dataset.values;\r
-\r
- // Get domain axis values (time OR other variable) \r
- double[] ta;\r
- if(domainValues != null) {\r
- ta = domainValues;\r
-\r
- // If domainAxis is other than time, parameter values size is different. \r
- if(domainValues.length > va.length) {\r
- double value = va[0];\r
- va = new double[domainValues.length];\r
- for(int i = 0; i < domainValues.length; i++)\r
- va[i] = value;\r
- }\r
-\r
- // If domainAxis is a parameter, the domainValues array is too short\r
- if(domainValues.length < va.length && domainValues.length == 2 && domainValues[0] == domainValues[1]) {\r
- double value = domainValues[0];\r
- ta = new double[va.length];\r
- for(int i = 0; i < va.length; i++)\r
- ta[i] = value;\r
- }\r
-\r
- } else {\r
- ta = dataset.times;\r
+ // Get domain axis values (time OR other variable) \r
+ double[] ta;\r
+ if(domainValues != null) {\r
+ ta = domainValues;\r
+\r
+ // If domainAxis is other than time, parameter values size is different. \r
+ if(domainValues.length > va.length) {\r
+ double value = va[0];\r
+ va = new double[domainValues.length];\r
+ for(int i = 0; i < domainValues.length; i++)\r
+ va[i] = value;\r
}\r
\r
- if(ta!=null && va!=null && (va.length == ta.length)) {\r
- // Add series if everything OK\r
- String name = dataset.name;\r
- if(label != null)\r
- name = label;\r
- if(dataset.result != null && !dataset.result.isEmpty())\r
- name = name + " : " + dataset.result;\r
- series.add(new TempSeries(name, new double[][] {ta, va}, width, color));\r
- if(ta.length == 0 || va.length == 0)\r
- System.out.println(dataset.name + " : " + dataset.result + ". Sizes: " + va.length + " and " + ta.length);\r
+ // If domainAxis is a parameter, the domainValues array is too short\r
+ if(domainValues.length < va.length && domainValues.length == 2 && domainValues[0] == domainValues[1]) {\r
+ double value = domainValues[0];\r
+ ta = new double[va.length];\r
+ for(int i = 0; i < va.length; i++)\r
+ ta[i] = value;\r
}\r
+\r
+ } else {\r
+ ta = dataset.times;\r
}\r
\r
- } catch (MissingVariableException e) {\r
- // Do nothing, if variable was not found. Move on to the next series\r
+ if(ta!=null && va!=null && (va.length == ta.length)) {\r
+ // Add series if everything OK\r
+ String name = dataset.name;\r
+ if(label != null)\r
+ name = label;\r
+ if(dataset.result != null && !dataset.result.isEmpty())\r
+ name = name + " : " + dataset.result;\r
+ series.add(new TempSeries(name, new double[][] {ta, va}, width, color));\r
+ if(ta.length == 0 || va.length == 0)\r
+ System.out.println(dataset.name + " : " + dataset.result + ". Sizes: " + va.length + " and " + ta.length);\r
+ }\r
}\r
+\r
+ } catch (MissingVariableException e) {\r
+ // Do nothing, if variable was not found. Move on to the next series\r
}\r
}\r
- return new Pair<ArrayList<TempSeries>, IRenderer>(series, renderer);\r
}\r
-\r
- }, datasetListener); \r
- }\r
-\r
- if(timeListener == null || timeListener.isDisposed()) {\r
- timeListener = new TimeListener();\r
- SimanticsUI.getSession().asyncRequest(new Read<Double>() {\r
- @Override\r
- public Double perform(ReadGraph graph) throws DatabaseException {\r
- JFreeChartResource jfree = JFreeChartResource.getInstance(graph);\r
- // Get properties for all series\r
- Resource series = graph.getPossibleObject(resource, jfree.Dataset_seriesList);\r
- if(series != null) {\r
- List<Resource> seriesList = ListUtils.toList(graph, series);\r
- if(seriesList != null) {\r
- String realizationURI = getRealizationURI(graph);\r
- for(Resource r : seriesList) {\r
- String rvi = graph.getPossibleRelatedValue(r, jfree.variableRVI);\r
- if(rvi == null)\r
- continue;\r
- try {\r
- // Get a variable for the experiment run\r
- Variable v = Variables.getVariable(graph, realizationURI);\r
- if(v == null)\r
- return null;\r
- Variable timeVar = v.browsePossible(graph, "#" + Functions.TIME + "#");\r
- if(timeVar != null)\r
- return timeVar.getValue(graph, Bindings.DOUBLE);\r
- } catch (MissingVariableException e) {\r
- // Do nothing, if variable was not found.\r
- }\r
+ return new Pair<ArrayList<TempSeries>, IRenderer>(series, renderer);\r
+ }\r
+ };\r
+ }\r
+ \r
+ protected Read<Double> getTimeRequest() {\r
+ return new Read<Double>() {\r
+ @Override\r
+ public Double perform(ReadGraph graph) throws DatabaseException {\r
+ JFreeChartResource jfree = JFreeChartResource.getInstance(graph);\r
+ // Get properties for all series\r
+ Resource series = graph.getPossibleObject(resource, jfree.Dataset_seriesList);\r
+ if(series != null) {\r
+ List<Resource> seriesList = ListUtils.toList(graph, series);\r
+ if(seriesList != null) {\r
+ String realizationURI = getRealizationURI(graph);\r
+ for(Resource r : seriesList) {\r
+ String rvi = graph.getPossibleRelatedValue(r, jfree.variableRVI);\r
+ if(rvi == null)\r
+ continue;\r
+ try {\r
+ // Get a variable for the experiment run\r
+ Variable v = Variables.getVariable(graph, realizationURI);\r
+ if(v == null)\r
+ return null;\r
+ Variable timeVar = v.browsePossible(graph, "#" + Functions.TIME + "#");\r
+ if(timeVar != null)\r
+ return timeVar.getValue(graph, Bindings.DOUBLE);\r
+ } catch (MissingVariableException e) {\r
+ // Do nothing, if variable was not found.\r
}\r
}\r
}\r
- return null;\r
}\r
+ return null;\r
+ }\r
+\r
+ };\r
+ }\r
\r
- }, timeListener);\r
+ @Override\r
+ public Dataset getDataset() {\r
+ if(dataset == null) {\r
+ dataset = new DefaultXYDataset();\r
+ } \r
+\r
+ if(datasetListener == null || datasetListener.isDisposed()) {\r
+ SimanticsUI.getSession().asyncRequest(getDatasetRequest(), getDatasetListener()); \r
+ }\r
+\r
+ if(timeListener == null || timeListener.isDisposed()) {\r
+ SimanticsUI.getSession().asyncRequest(getTimeRequest(), getTimeListener());\r
}\r
return dataset;\r
}\r
* @author Teemu Lempinen\r
*\r
*/\r
- private class TimeMarker extends ValueMarker {\r
+ protected class TimeMarker extends ValueMarker {\r
private static final long serialVersionUID = 2018755066561629172L;\r
\r
public TimeMarker(double value, Paint paint, Stroke stroke) {\r
}\r
}\r
\r
- private class DataSetListener implements Listener<Pair<ArrayList<TempSeries>, IRenderer>> {\r
-\r
- private boolean disposed = false;\r
-\r
- public void dispose() {\r
- disposed = true;\r
- }\r
-\r
- @Override\r
- public boolean isDisposed() {\r
- return disposed;\r
- }\r
+ private class DataSetListener extends DisposableListener<Pair<ArrayList<TempSeries>, IRenderer>> {\r
\r
@Override\r
public void execute(Pair<ArrayList<TempSeries>, IRenderer> result) {\r
@Override\r
public void run() {\r
\r
+ if(dataset == null || !(dataset instanceof DefaultXYDataset))\r
+ return;\r
+ \r
+ DefaultXYDataset ds = (DefaultXYDataset)dataset;\r
org.jfree.chart.plot.XYPlot plot = ((AbstractXYItemRenderer)getRenderer()).getPlot();\r
+ \r
if(plot != null) {\r
/*\r
* Drawing supplier with a modified first yellow. The default first\r
plot.setDrawingSupplier(drawingsupplier);\r
}\r
// Remove all series\r
- for(int i = dataset.getSeriesCount() - 1; i >= 0; i-- ) {\r
- dataset.removeSeries(dataset.getSeriesKey(i));\r
+ for(int i = ds.getSeriesCount() - 1; i >= 0; i-- ) {\r
+ ds.removeSeries(ds.getSeriesKey(i));\r
}\r
\r
// Add found series\r
for(int i = 0; i < series.size(); i++) {\r
TempSeries s = series.get(i);\r
- dataset.addSeries(s.name, s.values);\r
+ ds.addSeries(s.name, s.values);\r
getRenderer().setSeriesStroke(i, new BasicStroke((float)s.width));\r
getRenderer().setSeriesPaint(i, s.color);\r
} \r
* @author Teemu Lempinen\r
*\r
*/\r
- private class TimeListener implements Listener<Double> {\r
+ protected class TimeListener extends DisposableListener<Double> {\r
\r
private ValueMarker marker;\r
- private boolean disposed = false;\r
private Stroke dashStroke = new BasicStroke(1.0f, BasicStroke.CAP_BUTT,\r
BasicStroke.JOIN_MITER, 10.0f, new float[] {5.0f, 3.0f, 1.0f, 3.0f}, 0.0f);\r
\r
}\r
\r
public void dispose() {\r
- this.disposed = true;\r
+ super.dispose();\r
if(marker != null) {\r
org.jfree.chart.plot.XYPlot plot = ((AbstractXYItemRenderer)getRenderer()).getPlot();\r
if(plot != null)\r
}\r
}\r
\r
- @Override\r
- public boolean isDisposed() {\r
- return disposed;\r
- }\r
-\r
@Override\r
public void execute(final Double time) {\r
// Modify in AWT thread to avoid synchronization problems\r
* @author Teemu Lempinen\r
*\r
*/\r
- private class TempSeries {\r
+ protected class TempSeries {\r
public double[][] values;\r
public String name;\r
public int width;\r
* @return realization uri for current dataset resource\r
* @throws DatabaseException\r
*/\r
- private String getRealizationURI(ReadGraph graph) throws DatabaseException {\r
+ protected String getRealizationURI(ReadGraph graph) throws DatabaseException {\r
if(resource == null)\r
return null;\r
\r
return ReferenceOption.DOES_NOT_EXIST;\r
else if(Boolean.TRUE.equals(element))\r
return ReferenceOption.CANNOT_BE_CONNECTED;\r
- else if(element instanceof Variable) {\r
- if(element instanceof Enumeration || element instanceof Sheet)\r
+ else if(element instanceof Variable || element instanceof Module) {\r
+ if(element instanceof Enumeration || element instanceof Sheet || element instanceof Module || parts.length > 1)\r
return ReferenceOption.CANNOT_BE_CONNECTED;\r
else\r
return ReferenceOption.CAN_BE_CONNECTED;\r
*\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
+ * Semantum Oy - Bug #4192\r
*******************************************************************************/\r
package org.simantics.sysdyn.ui.utils.imports;\r
\r
import org.simantics.db.common.utils.NameUtils;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.exception.ResourceNotFoundException;\r
+import org.simantics.db.layer0.adapter.impl.DefaultPasteImportAdvisor;\r
+import org.simantics.db.layer0.migration.MigrationState;\r
+import org.simantics.db.layer0.migration.MigrationStateKeys;\r
+import org.simantics.db.layer0.migration.MigrationUtils;\r
import org.simantics.db.layer0.util.RemoverUtil;\r
import org.simantics.db.request.Read;\r
import org.simantics.issues.common.AllBatchIssueSources;\r
\r
Activator.getDefault().getPreferenceStore().setValue(IMPORTMODELTPATH, (new File(path)).getParent());\r
\r
+ MigrationState state = MigrationUtils.newState();\r
+ state.setProperty(MigrationStateKeys.BASE_URI, SysdynResource.URIs.Migration);\r
+ state.setProperty(MigrationStateKeys.UPDATE_DEPENDENCIES, Boolean.FALSE);\r
\r
-\r
- HashMap<String, FormatHandler<Object>> handlers = new HashMap<String, FormatHandler<Object>>();\r
- handlers.put("sysdynModel:1", new SysdynImportFormatHandler(project, SysdynResource.URIs.from1$6to1$7, monitor));\r
-\r
- Object result = ImportUtils.readFile(path, handlers);\r
+ Resource result = null;\r
+ try {\r
+ result = MigrationUtils.importMigrated(monitor, SimanticsUI.getSession(), new File(path), state, new DefaultPasteImportAdvisor(project), project);\r
+ } catch (Exception e1) {\r
+ e1.printStackTrace();\r
+ }\r
\r
if(result == null || !(result instanceof Resource)) {\r
return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Import model failed: File could not be read.", null);\r
} else {\r
try {\r
- final Resource ModelRoot = (Resource) result;\r
+ final Resource ModelRoot = result;\r
IStatus status = SimanticsUI.getSession().syncRequest(new WriteResultRequest<IStatus>() {\r
\r
@Override\r
\r
Activator.getDefault().getPreferenceStore().setValue(IMPORTMODULETPATH, (new File(path)).getParent());\r
\r
- // Handler for importing modules\r
- HashMap<String, FormatHandler<Object>> handlers = new HashMap<String, FormatHandler<Object>>();\r
- handlers.put("sysdynModule:1", new SysdynImportFormatHandler(model, SysdynResource.URIs.from1$6to1$7, monitor));\r
+ MigrationState state = MigrationUtils.newState();\r
+ state.setProperty(MigrationStateKeys.BASE_URI, SysdynResource.URIs.Migration);\r
+ state.setProperty(MigrationStateKeys.UPDATE_DEPENDENCIES, Boolean.FALSE);\r
\r
- // Read module file\r
- Object result = ImportUtils.readFile(path, handlers);\r
+ Resource result = null;\r
+ try {\r
+ result = MigrationUtils.importMigrated(monitor, SimanticsUI.getSession(), new File(path), state, new DefaultPasteImportAdvisor(model), model);\r
+ } catch (Exception e1) {\r
+ e1.printStackTrace();\r
+ }\r
\r
\r
- if(result == null || !(result instanceof Resource)) {\r
+ if(result == null) {\r
return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Import module failed: Module could not be imported.", null);\r
} else {\r
- final Resource ModuleRoot = (Resource) result;\r
+ final Resource ModuleRoot = result;\r
// Check that the imported file actually was a module. Display error message otherwise.\r
try {\r
subTask(monitor, "Validate model");\r
\r
// Ensure that shared functions ontology exists\r
ensureSharedOntologies();\r
+ \r
+ MigrationState state = MigrationUtils.newState();\r
+ state.setProperty(MigrationStateKeys.BASE_URI, SysdynResource.URIs.Migration);\r
+ state.setProperty(MigrationStateKeys.UPDATE_DEPENDENCIES, Boolean.FALSE);\r
\r
- // Handler for importing function libraries\r
- HashMap<String, FormatHandler<Object>> handlers = new HashMap<String, FormatHandler<Object>>();\r
- handlers.put("sysdynFunctionLibrary:1", new SysdynImportFormatHandler(functionLibrary, SysdynResource.URIs.from1$6to1$7, monitor, new SysdynFunctionLibraryImportAdvisor(functionLibrary)));\r
-\r
- // Read function library file\r
- Object result = ImportUtils.readFile(path, handlers);\r
+ Resource result = null;\r
+ try {\r
+ result = MigrationUtils.importMigrated(monitor, SimanticsUI.getSession(), new File(path), state, new DefaultPasteImportAdvisor(functionLibrary), functionLibrary);\r
+ } catch (Exception e1) {\r
+ e1.printStackTrace();\r
+ }\r
\r
- if(result == null || !(result instanceof Resource)) {\r
+ if(result == null) {\r
return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Import Function library failed: Function library not be imported.", null);\r
} else {\r
final Resource FunctionLibraryRoot = (Resource) result;\r
import org.simantics.db.Issue;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
+import org.simantics.db.common.issue.StandardIssue;\r
import org.simantics.db.common.utils.ListUtils;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.layer0.variable.Variable;\r
-import org.simantics.issues.common.StandardIssue;\r
import org.simantics.scl.reflection.annotations.SCLValue;\r
import org.simantics.sysdyn.SysdynResource;\r
\r
import org.simantics.db.Issue;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
+import org.simantics.db.common.issue.StandardIssue;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.layer0.variable.Variable;\r
import org.simantics.issues.common.IssueUtils;\r
-import org.simantics.issues.common.StandardIssue;\r
import org.simantics.scl.reflection.annotations.SCLValue;\r
import org.simantics.sysdyn.SysdynResource;\r
\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.issue.StandardIssue;\r
import org.simantics.db.common.utils.ListUtils;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.layer0.variable.Variable;\r
-import org.simantics.issues.common.StandardIssue;\r
import org.simantics.layer0.Layer0;\r
import org.simantics.sysdyn.SysdynResource;\r
\r
}\r
@Override\r
public void unregistered() {\r
- unregisterSubscription(subscription);\r
- subscription = null;\r
+ if(subscription != null) {\r
+ unregisterSubscription(subscription);\r
+ subscription = null;\r
+ }\r
}\r
\r
@SuppressWarnings("unchecked")\r
for(int i = 0; i < variableNames.size(); i++) {\r
for(SysdynResult r : results) { \r
if(experiment instanceof SysdynGameExperiment) {\r
- result[i] = ((SysdynGameExperiment)experiment).getCurrentValue(variableNames.get(i));\r
+ Double d = ((SysdynGameExperiment)experiment).getCurrentValue(variableNames.get(i)); \r
+ result[i] = d != null ? d : 0;\r
} else {\r
SysdynDataSet ds = r.getDataSet(variableNames.get(i));\r
if(ds != null && ds.values != null && ds.values.length > 0) {\r
import org.simantics.db.Session;\r
import org.simantics.db.WriteGraph;\r
import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.common.utils.Logger;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.procedure.Listener;\r
import org.simantics.db.request.ExternalRead;\r
return request;\r
}\r
\r
-\r
- public void update() {\r
- T value = variable.getValue();\r
- fireValue(value);\r
- }\r
+ public void update() {\r
+ try {\r
+ T value = variable.getValue();\r
+ fireValue(value);\r
+ } catch (Throwable e) {\r
+ fireException(e);\r
+ }\r
+ }\r
\r
void fireValue(T value) {\r
if (listener != null)\r
void fireException(Throwable t) {\r
if (listener != null && excepted.compareAndSet(false, true))\r
listener.exception(t);\r
+ else\r
+ // Can't invoke listener.exception multiple times, but logging\r
+ // further exceptions anyway.\r
+ Logger.defaultLogError(t);\r
}\r
-\r
+ \r
public void setListener(Listener<T> listener) {\r
this.listener = listener;\r
}\r
*/\r
public synchronized void simulate(final IModelicaMonitor monitor, final IProgressMonitor progressMonitor) throws IOException {\r
canceled = false;\r
-\r
progressMonitor.subTask("Write modelica classes");\r
\r
// Write Modelica files\r
-\r
- \r
String modelText = getModelicaCode(monitor, false, getOpenModelicaVersion());\r
if(modelText == null)\r
return;\r
-\r
progressMonitor.worked(1);\r
\r
// Write initial files and add init-parameters\r
progressMonitor.subTask("Write simulation files");\r
HashMap<String, String> experimentParameters = getExperimentParameters(monitor);\r
\r
-\r
// add loadFile script to load all related functions and function libraries\r
String additionalScript = getAdditionalScripts();\r
\r
SimulationLocation simulationLocation = createSimulationFiles(sysdynModel, modelText, experimentParameters, additionalScript, false);\r
progressMonitor.worked(1);\r
\r
-\r
// Build the model and store previous model structure and inits that affect the building\r
// If there is no exe file OR the model structure has not changed, no need to build\r
boolean structureChanged = hasStructureChanged(modelText);\r
e.printStackTrace();\r
}\r
}\r
-\r
progressMonitor.worked(1);\r
\r
if(simulationLocation != null && !canceled) {\r
subscription.update();\r
skippedVariableUpdate = false;\r
}\r
+ \r
+ public int numberOfSimulationRunSteps() {\r
+ /*\r
+ * 1. Write modelica files\r
+ * 2. Write other simulation files\r
+ * 3. Build model OR update parameters\r
+ * 4. Run modelica\r
+ * 5. Read results \r
+ */\r
+ return 5; \r
+ }\r
\r
\r
/* Experiment methods that are not used in this experiment */\r
*******************************************************************************/\r
package org.simantics.sysdyn.manager;\r
\r
+import java.io.File;\r
+import java.io.FileInputStream;\r
+import java.io.FileNotFoundException;\r
+import java.io.FileOutputStream;\r
import java.io.IOException;\r
import java.util.ArrayList;\r
import java.util.HashMap;\r
import org.eclipse.core.runtime.IStatus;\r
import org.eclipse.core.runtime.Status;\r
import org.eclipse.core.runtime.jobs.Job;\r
+import org.simantics.databoard.Bindings;\r
import org.simantics.db.AsyncReadGraph;\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.WriteRequest;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.procedure.AsyncListener;\r
import org.simantics.db.request.Read;\r
SimulationLocation simulationLocation = createSimulationFiles(sysdynModel, modelText, inits, additionalScript, true);\r
progressMonitor.worked(1);\r
\r
-\r
+ // Load precompiled fmu if structure has not changed and it has not yet been loaded\r
+ File fmu = null;\r
+ if(!sysdynModel.isStructureModified()) {\r
+ if(!simulationLocation.executableFile.isFile()) {\r
+ fmu = loadModelFmu(simulationLocation);\r
+ } else {\r
+ fmu = simulationLocation.executableFile;\r
+ }\r
+ }\r
// Build the model and store previous model structure and inits that affect the building\r
// If there is no exe file OR the model structure has not changed, no need to build\r
- if (!simulationLocation.executableFile.isFile() || hasStructureChanged(modelText)) {\r
+ if (fmu == null && (!simulationLocation.executableFile.isFile() || hasStructureChanged(modelText))) {\r
progressMonitor.subTask("Build model");\r
buildModel(simulationLocation, modelText, monitor);\r
previousModelStructure = modelText;\r
+ \r
+ saveModelFmu(simulationLocation);\r
}\r
\r
progressMonitor.worked(1);\r
simulate(false); \r
}\r
\r
+ /**\r
+ * Load fmu file from database, if it exists for the model of this experiment\r
+ * \r
+ * @param simulationLocation SimulationLocation indicating where the fmu should be loaded\r
+ * @return Loaded fmu or null if it was not loaded from database\r
+ */\r
+ private File loadModelFmu(SimulationLocation simulationLocation) {\r
+ File fmu = null;\r
+ try {\r
+ final String fmuLocation = simulationLocation.executableFile.getAbsolutePath();\r
+ fmu = session.syncRequest(new Read<File>() {\r
+ @Override\r
+ public File perform(ReadGraph graph) throws DatabaseException {\r
+ File result = null;\r
+ FileOutputStream fos;\r
+ try {\r
+ fos = new FileOutputStream(fmuLocation);\r
+ byte[] fileBArray = graph.getPossibleRelatedValue(\r
+ getModel(), SysdynResource.getInstance(graph).SysdynModel_fmuFile, Bindings.BYTE_ARRAY);\r
+ \r
+ if(fileBArray != null) {\r
+ fos.write(fileBArray);\r
+ fos.close();\r
+ result = new File(fmuLocation);\r
+ } else {\r
+ fos.close();\r
+ return null;\r
+ }\r
+ \r
+ } catch (FileNotFoundException e) {\r
+ e.printStackTrace();\r
+ } catch (IOException e) {\r
+ e.printStackTrace();\r
+ }\r
+ return result;\r
+ }\r
+ });\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
+ \r
+ return fmu;\r
+ }\r
+ \r
+ /**\r
+ * Save fmu file from simulationLocation to database\r
+ * @param simulationLocation Location for finding fmu\r
+ */\r
+ private void saveModelFmu(SimulationLocation simulationLocation) {\r
+ final String fmuLocation = simulationLocation.executableFile.getAbsolutePath();\r
+ session.asyncRequest(new WriteRequest() {\r
+\r
+ @Override\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+ File file = new File(fmuLocation);\r
+ byte[] fileBArray = new byte[(int)file.length()];\r
+ FileInputStream fis;\r
+ try {\r
+ fis = new FileInputStream(file);\r
+\r
+ fis.read(fileBArray);\r
+ graph.claimLiteral(\r
+ getModel(), \r
+ SysdynResource.getInstance(graph).SysdynModel_fmuFile, \r
+ fileBArray, Bindings.BYTE_ARRAY);\r
+ fis.close();\r
+ } catch (FileNotFoundException e) {\r
+ e.printStackTrace();\r
+ } catch (IOException e) {\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+ });\r
+ }\r
+\r
\r
@Override\r
public void simulateDuration(double duration) {\r
}\r
\r
public Double getCurrentValue(String name) {\r
- Integer index = subscriptionIndexes.get(name);\r
- if(index != null) {\r
- return currentValues[index];\r
- } else {\r
- return null;\r
+ if(subscriptionIndexes != null && name != null) {\r
+ Integer index = subscriptionIndexes.get(name);\r
+ if(index != null) {\r
+ return currentValues[index];\r
+ }\r
}\r
+ return null;\r
}\r
}\r
import org.simantics.sysdyn.representation.Configuration;\r
import org.simantics.sysdyn.representation.IElement;\r
import org.simantics.sysdyn.representation.IndependentVariable;\r
+import org.simantics.sysdyn.representation.Model;\r
import org.simantics.sysdyn.representation.Module;\r
import org.simantics.sysdyn.representation.ParameterOverride;\r
import org.simantics.sysdyn.representation.Sheet;\r
*/\r
public synchronized boolean update(ReadGraph graph) throws DatabaseException {\r
if(mapping.isDomainModified()) {\r
- structureModified = true;\r
+ \r
+\r
\r
try {\r
- mapping.updateRange(graph);\r
+ Collection<Object> updated = mapping.updateRange(graph);\r
+ \r
+ for(Object o : updated) {\r
+ if(!(o instanceof Model)) {\r
+ setStructureModified(true);\r
+ break;\r
+ }\r
+ }\r
+ \r
} catch (MappingException e) {\r
SysdynConsole.INSTANCE.message(\r
"Error: Mapping is broken! Find the problem, " +\r
}\r
else\r
return false;\r
- }\r
+ } \r
\r
/**\r
* Update mapping.\r
return structureModified;\r
}\r
\r
- public void setStructureModeified(boolean structureModified) {\r
+ public void setStructureModified(boolean structureModified) {\r
this.structureModified = structureModified;\r
}\r
}\r
*******************************************************************************/\r
package org.simantics.sysdyn.manager;\r
\r
+import java.io.File;\r
+import java.io.FileNotFoundException;\r
+import java.io.IOException;\r
import java.util.ArrayList;\r
import java.util.Collection;\r
+import java.util.HashMap;\r
+import java.util.Random;\r
import java.util.concurrent.ScheduledExecutorService;\r
\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.simantics.databoard.Bindings;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
-import org.simantics.simulation.experiment.IDynamicExperiment;\r
+import org.simantics.db.common.request.ReadRequest;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.modelica.IModelicaMonitor;\r
+import org.simantics.modelica.ModelicaKeys;\r
+import org.simantics.modelica.ModelicaManager;\r
+import org.simantics.modelica.SimulationLocation;\r
+import org.simantics.modelica.data.CSVSimulationResult;\r
+import org.simantics.modelica.data.MatSimulationResult;\r
+import org.simantics.modelica.data.SimulationResult;\r
+import org.simantics.sysdyn.SysdynResource;\r
\r
/**\r
* Sensitivity analysis experiment\r
* @author Tuomas Miettinen\r
*\r
*/\r
-public class SysdynSensitivityAnalysisExperiment extends SysdynExperiment implements IDynamicExperiment {\r
+public class SysdynSensitivityAnalysisExperiment extends SysdynExperiment {\r
\r
public enum Distribution {\r
UNIFORM,\r
NORMAL\r
}\r
\r
- private final Distribution propabilityDistribution = DEFAULT_PROPABILITY_DISTRIBUTION;\r
+ private Distribution propabilityDistribution = DEFAULT_PROPABILITY_DISTRIBUTION;\r
+ private double minValue = DEFAULT_MIN_VALUE;\r
+ private double maxValue = DEFAULT_MAX_VALUE;\r
+ private int numValues = DEFAULT_NUM_VALUES;\r
+ private String variedParameter = "Auxiliary1";\r
+ private double mean = DEFAULT_MEAN;\r
+ public double stdDeviation = DEFAULT_STD_DEVIATION;\r
+ \r
\r
public static Distribution DEFAULT_PROPABILITY_DISTRIBUTION = Distribution.UNIFORM;\r
public static double DEFAULT_MIN_VALUE = 1.0;\r
public static double DEFAULT_MAX_VALUE = 3.0;\r
public static int DEFAULT_NUM_VALUES = 3;\r
- \r
- private final Collection<Runnable> timeListeners = new ArrayList<Runnable>();\r
+ public static double DEFAULT_MEAN = 0.0;\r
+ public static double DEFAULT_STD_DEVIATION = 1.0;\r
\r
ScheduledExecutorService playbackExecutionService;\r
- //SensitivityAnalysisConfiguration playbackConfiguration;\r
+ private ArrayList<MemoryResult> results = null;\r
\r
public SysdynSensitivityAnalysisExperiment(Resource experiment, Resource model) {\r
super(experiment, model);\r
}\r
\r
+ @Override\r
+ protected void runModelica(SimulationLocation simulationLocation, String modelText, IModelicaMonitor monitor, IProgressMonitor progressMonitor, HashMap<String, String> experimentParameters, HashMap<String, String> changes) throws IOException {\r
+ results = null;\r
+ \r
+ loadConfiguration();\r
+ if (changes == null) {\r
+ changes = new HashMap<String, String>();\r
+ }\r
+ \r
+ String version = ModelicaManager.getOMCVersion(simulationLocation.omcHome);\r
+ experimentParameters.put(ModelicaManager.OMC_VERSION, version);\r
\r
- /**\r
- * Interrupts a possible ongoing playback\r
- * \r
- * @param time\r
- */\r
-// public void setTimeInterrupting(double time) {\r
-// stopPlayback();\r
-// setTime(time);\r
-// }\r
-//\r
-// /**\r
-// * Sets a new time and continues playback from that point if \r
-// * playback was running \r
-// * @param time\r
-// */\r
-// public void setTimeAndContinue(double time) {\r
-// if(isPlaybackRunning()) {\r
-// stopPlayback();\r
-// setTime(time);\r
-// startPlayback(500);\r
-// } else {\r
-// setTime(time);\r
-// }\r
-// }\r
-/*\r
- private void setTime(double time) {\r
- this.time = time;\r
- resultsChanged(); \r
- }\r
+ for (int i = 0; i < numValues; ++i) {\r
+ progressMonitor.subTask("Simulation iteration " + (i+1));\r
\r
- public double getTime() {\r
- return this.time;\r
- }\r
+ double value = 0;\r
\r
- public double getStartTime() {\r
- return this.startTime;\r
- }\r
+ if (propabilityDistribution == Distribution.UNIFORM) {\r
+ double intervalLength = (maxValue - minValue) / (numValues - 1);\r
+ value = minValue + (intervalLength * i);\r
+ } else if (propabilityDistribution == Distribution.NORMAL) {\r
+ Random random = new Random();\r
+ do {\r
+ value = random.nextGaussian() * stdDeviation + mean;\r
+ } while (mean > minValue && mean < maxValue && (value < minValue || value > maxValue));\r
+ } else {\r
+ break;\r
+ }\r
+\r
+ // TODO: What if changes already include similarly named variable?\r
+ /* If the changes is altered, it affects also to the next simulation. So,\r
+ * All the parameters that are to be altered need to be defined explicitly\r
+ * before each new simulation. \r
+ */\r
+ changes.put(variedParameter, Double.toString(value));\r
\r
- public double getEndTime() {\r
- return this.endTime;\r
- }\r
\r
- public void setPlaybackDuration(long duration) {\r
- this.playbackDuration = duration;\r
- if(isPlaybackRunning()) {\r
- //Restart playback with different time settings\r
- startPlayback();\r
+ // Specify result file name\r
+\r
+ int indexOfDot = simulationLocation.resFile.toString().lastIndexOf('.');\r
+ if (indexOfDot > 1) {\r
+ String resFile = simulationLocation.resFile.toString();\r
+ String newResFile = resFile.substring(0, indexOfDot) + i + resFile.substring(indexOfDot);\r
+ experimentParameters.put(ModelicaManager.RESULT_FILE_NAME, newResFile);\r
+ } \r
+ // Simulate the model for one parameter set\r
+ runModelica(simulationLocation, modelText, monitor, progressMonitor, experimentParameters, changes, i);\r
+ progressMonitor.worked(1);\r
}\r
}\r
\r
- public long getPlaybackDuration() {\r
- return this.playbackDuration;\r
+ private void loadConfiguration(){\r
+ try {\r
+ session.syncRequest(new ReadRequest() {\r
+ @Override\r
+ public void run(ReadGraph graph) throws DatabaseException {\r
+ \r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ maxValue = graph.getPossibleRelatedValue(experiment, sr.SensitivityAnalysisExperiment_maxValue, Bindings.DOUBLE);\r
+ minValue = graph.getPossibleRelatedValue(experiment, sr.SensitivityAnalysisExperiment_minValue, Bindings.DOUBLE);\r
+ numValues = graph.getPossibleRelatedValue(experiment, sr.SensitivityAnalysisExperiment_numValues, Bindings.INTEGER);\r
+ variedParameter = graph.getPossibleRelatedValue(experiment, sr.SensitivityAnalysisExperiment_variedParameter, Bindings.STRING);\r
+ String propabilityDistributionTemp = graph.getPossibleRelatedValue(experiment, sr.SensitivityAnalysisExperiment_propabilityDistribution, Bindings.STRING);\r
+ if (propabilityDistributionTemp.equalsIgnoreCase("uniform"))\r
+ propabilityDistribution = Distribution.UNIFORM;\r
+ else if (propabilityDistributionTemp.equalsIgnoreCase("normal"))\r
+ propabilityDistribution = Distribution.NORMAL;\r
+ else\r
+ propabilityDistribution = DEFAULT_PROPABILITY_DISTRIBUTION;\r
+ \r
+ mean = graph.getPossibleRelatedValue(experiment, sr.SensitivityAnalysisExperiment_mean, Bindings.DOUBLE);\r
+ stdDeviation = graph.getPossibleRelatedValue(experiment, sr.SensitivityAnalysisExperiment_stdDeviation, Bindings.DOUBLE);\r
+\r
+ }\r
+ });\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
}\r
+ \r
+ protected void runModelica(SimulationLocation simulationLocation, \r
+ String modelText, \r
+ IModelicaMonitor monitor, \r
+ IProgressMonitor progressMonitor, \r
+ HashMap<String, String> experimentParameters, \r
+ HashMap<String, String> changes, \r
+ int resFileIndex) throws IOException {\r
+ process = ModelicaManager.runModelica(\r
+ simulationLocation,\r
+ monitor,\r
+ experimentParameters, \r
+ changes\r
+ );\r
\r
- @Override\r
- public void init(ReadGraph g) {\r
- super.init(g);\r
- this.session = g.getSession();\r
- session.asyncRequest(new ReadRequest() {\r
+ ModelicaManager.printProcessOutput(process, monitor);\r
\r
- @Override\r
- public void run(ReadGraph graph) throws DatabaseException {\r
- changeState(ExperimentState.RUNNING);\r
- final Resource configuration = graph.getPossibleObject(model, SimulationResource.getInstance(graph).HasConfiguration);\r
- sysdynModel = SysdynModelManager.getInstance(session).getModel(graph, configuration);\r
- toggleActivation(graph, true);\r
- //getPlaybackConfiguration(graph);\r
- startSimulationJob();\r
- }\r
- });\r
+ File resFile = new File(experimentParameters.get(ModelicaManager.RESULT_FILE_NAME));\r
+ Thread resultThread = getResultThread(resFile, experimentParameters, monitor, progressMonitor);\r
+ resultThread.run();\r
+\r
+ process = null;\r
}\r
+ \r
+ /**\r
+ * Get a thread for reading and saving reuslts from a normal simulation\r
+ * @param simulationLocation\r
+ * @param inits\r
+ * @param monitor\r
+ * @param progressMonitor\r
+ * @param resFileIndex \r
+ * @return\r
+ */\r
+ protected Thread getResultThread(final File resFile, \r
+ final HashMap<String, String> experimentParameters, \r
+ final IModelicaMonitor monitor, \r
+ final IProgressMonitor progressMonitor) {\r
+ return new Thread() {\r
+ @Override\r
+ public void run() {\r
+ try {\r
+ process.waitFor();\r
\r
+ if(!canceled) {\r
+ // Get and store results\r
+ SimulationResult result;\r
+ if(resFile.getName().endsWith(".csv"))\r
+ result = new CSVSimulationResult();\r
+ else if(resFile.getName().endsWith(".plt"))\r
+ result = new SimulationResult();\r
+ else\r
+ result = new MatSimulationResult(); // The latest format\r
\r
+ // The interval of results saved. Every result? Every other result? etc...\r
+ int outIntervalInt = 1;\r
+ String outputInterval = experimentParameters.get(ModelicaKeys.OUTPUT_INTERVAL);\r
+ if(outputInterval != null) {\r
+ String stepTime = experimentParameters.get(ModelicaKeys.STEP_VALUE);\r
+ String stopTime = experimentParameters.get(ModelicaKeys.STOP_VALUE);\r
+ \r
+ Double step = Double.parseDouble(stepTime);\r
+ Double stop = Double.parseDouble(stopTime);\r
+ Double outInterval = Double.parseDouble(outputInterval);\r
\r
- private class SensitivityAnalysisConfiguration {\r
- public double simulationDuration, simulationStepLength, intervals, endTime, startTime;\r
- public long playbackDuration;\r
- }\r
+ outIntervalInt = (int)getInterval(outInterval, step);\r
+ // Actually you might be able to use an outInterval one or two longer. \r
+ int maxIntervalInt = (int)Math.round(stop / step);\r
+ if (outIntervalInt > maxIntervalInt)\r
+ outIntervalInt = maxIntervalInt;\r
+ }\r
\r
- @Override\r
- protected void localStateChange() {\r
- super.localStateChange();\r
- }\r
+ result.initRead(resFile);\r
+ result.readTime(resFile, outIntervalInt);\r
+ //result.readInits(simulationLocation.initFile); // Parameter values are read from .mat\r
+ result.filter();\r
+ \r
+ MemoryResult currentResult = new MemoryResult(null, null);\r
+ getCurrentResults().add(currentResult);\r
+ currentResult.setResult(result);\r
+ currentResult.setResultFile(resFile);\r
+ \r
+ resultsChanged();\r
\r
- // TIME LISTENERS\r
- public void addTimeListener(Runnable timeListener) {\r
- if(!this.timeListeners.contains(timeListener))\r
- this.timeListeners.add(timeListener);\r
- }\r
+ simulate(false);\r
\r
- public Collection<Runnable> getTimeListeners() {\r
- return this.timeListeners;\r
+ String errorString = result.getResultReadErrors();\r
+ if(errorString != null && !errorString.isEmpty())\r
+ monitor.message(errorString);\r
+ }\r
+ } catch (FileNotFoundException e) {\r
+ e.printStackTrace();\r
+ } catch (IOException e) {\r
+ e.printStackTrace();\r
+ } catch (InterruptedException e) {\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+ };\r
}\r
-\r
- public void removeTimeListener(Runnable timeListener) {\r
- this.timeListeners.remove(timeListener);\r
+ \r
+ public ArrayList<MemoryResult> getCurrentResults() {\r
+ if(this.results == null) {\r
+ this.results = new ArrayList<MemoryResult>();\r
+ }\r
+ return this.results;\r
}\r
-\r
+ \r
@Override\r
- public void resultsChanged() {\r
- for(Runnable listener : timeListeners) {\r
- listener.run();\r
+ public Collection<SysdynResult> getActiveResults() {\r
+ ArrayList<SysdynResult> result = new ArrayList<SysdynResult>();\r
+ result.addAll(getCurrentResults());\r
+ result.addAll(sysdynModel.getDisplayedResults());\r
+ return result;\r
+ }\r
+ \r
+ @Override\r
+ public MemoryResult getCurrentResult() {\r
+ if (this.results == null || this.results.size() < 1)\r
+ return null;\r
+ /* There should be a better alternative solution for this. Currently\r
+ * the return value is next to nonsense.\r
+ */\r
+ return this.results.get(0);\r
+ }\r
+ \r
+ @Override\r
+ public void saveState() {\r
+ if(results == null || !(results instanceof ArrayList<?>)) \r
+ return;\r
+ //SaveResultJob saveResultJob = new SaveResultJob(SysdynSensitivityAnalysisExperiment.this, session, results);\r
+ //saveResultJob.schedule();\r
+ }\r
+ \r
+ @Override\r
+ public int numberOfSimulationRunSteps() {\r
+ /*\r
+ * From normal experiment:\r
+ * 1. Write modelica files\r
+ * 2. Write other simulation files\r
+ * 3. Build model OR update parameters\r
+ * \r
+ * Sensitivity:\r
+ * 4 - n. Number of iterations\r
+ */\r
+ try {\r
+ Integer numberOfIterations = session.syncRequest(new Read<Integer>() {\r
+ @Override\r
+ public Integer perform(ReadGraph graph) throws DatabaseException {\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ return graph.getPossibleRelatedValue(experiment, sr.SensitivityAnalysisExperiment_numValues, Bindings.INTEGER);\r
+ }\r
+ });\r
+ return 3 + numberOfIterations; \r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
}\r
- super.resultsChanged();\r
+ \r
+ return super.numberOfSimulationRunSteps();\r
\r
}\r
-*/\r
+ \r
}\r
boolean fixed = GraphRefactoringUtils.fixIncorrectRoot(tg1.identities);\r
IdentityStore idStore = TransferableGraphConversion.extractIdentities(tg1);\r
TIntHashSet parentsAffected = new TIntHashSet(); \r
- GraphRefactoringUtils.refactor(idStore, spec, parentsAffected);\r
+ GraphRefactoringUtils.refactor(tg1, idStore, spec, parentsAffected);\r
tg1.resourceCount = idStore.getResourceCount();\r
tg1.identities = idStore.toArray();\r
// GraphRefactoringUtils.compactify(tg1, parentsAffected);\r
*******************************************************************************/\r
package org.simantics.sysdyn.representation;\r
\r
+import gnu.trove.map.hash.THashMap;\r
+import gnu.trove.set.hash.THashSet;\r
+\r
import java.util.ArrayList;\r
-import java.util.HashMap;\r
import java.util.HashSet;\r
\r
import org.simantics.Simantics;\r
@RelatedElement(Layer0.URIs.PartOf)\r
protected Book book;\r
\r
- HashMap<String, Object> cells = new HashMap<String, Object>();\r
- HashSet<String> usedRanges = new HashSet<String>();\r
+ THashMap<String, Object> cells = new THashMap<String, Object>();\r
+ THashSet<String> usedRanges = new THashSet<String>();\r
\r
Resource resource;\r
\r
\r
@UpdateMethod\r
public boolean updateCells(ReadGraph g, Resource r) throws DatabaseException {\r
- cells.clear();\r
- usedRanges.clear();\r
- this.resource = null;\r
-\r
if(g.hasStatement(r)) {\r
this.resource = r;\r
+ THashMap<String, Object> newCells = new THashMap<String, Object>();\r
+ \r
g.getObjects(r, Layer0.getInstance(g).ConsistsOf);\r
Variable v = g.adapt(r, Variable.class);\r
for(Variable child : v.getChildren(g)) {\r
try {\r
SpreadsheetUtils.decodeCellAbsolute(name);\r
Variant value = child.getPropertyValue(g, SheetVariables.CONTENT, Bindings.VARIANT);\r
- cells.put(name, value.getValue());\r
+ newCells.put(name, value.getValue());\r
} catch (CellParseException e) {\r
} catch (MissingVariableException e) {\r
System.out.println("missing content for: " + name);\r
}\r
}\r
+ \r
+ boolean update = false;\r
+ if(newCells.size() == this.cells.size()) {\r
+ // Cells are the same size. There might not be changes. Next up: content\r
+ for(String key : this.cells.keySet()) {\r
+ if(!this.cells.get(key).equals(newCells.get(key))) {\r
+ update = true;\r
+ break;\r
+ }\r
+ }\r
+ } else {\r
+ update = true;\r
+ }\r
+ \r
+ if(update) {\r
+ this.cells = newCells;\r
+ this.usedRanges.clear();\r
+ return true;\r
+ }\r
}\r
- return true;\r
+ return false;\r
}\r
\r
public String getStringRepresentation() {\r
}\r
\r
\r
- public HashMap<String, Object> getCells() {\r
+ public THashMap<String, Object> getCells() {\r
return cells;\r
}\r
\r
import org.eclipse.core.runtime.jobs.Job;\r
import org.eclipse.ui.PlatformUI;\r
import org.simantics.modelica.IModelicaMonitor;\r
-import org.simantics.simulation.experiment.Experiment;\r
import org.simantics.sysdyn.manager.SysdynConsole;\r
import org.simantics.sysdyn.manager.SysdynExperiment;\r
import org.simantics.sysdyn.manager.SysdynModel;\r
public class SimulationJob extends Job {\r
\r
private SysdynModel model;\r
- private Experiment experiment;\r
+ private SysdynExperiment experiment;\r
private IModelicaMonitor monitor;\r
\r
- public SimulationJob(SysdynModel model, Experiment experiment) {\r
+ public SimulationJob(SysdynModel model, SysdynExperiment experiment) {\r
super("Simulate " + model.getConfiguration().getLabel());\r
this.model = model;\r
this.experiment = experiment;\r
\r
@Override\r
protected IStatus run(IProgressMonitor monitor) {\r
- monitor.beginTask("Simulate " + model.getConfiguration().getLabel(), 5); \r
+ monitor.beginTask("Simulate " + model.getConfiguration().getLabel(), experiment.numberOfSimulationRunSteps()); \r
this.monitor.message("Simulate " + model.getConfiguration().getLabel());\r
try {\r
model.update();\r
- if(experiment instanceof SysdynExperiment)\r
+ if(experiment instanceof SysdynExperiment) {\r
((SysdynExperiment)experiment).simulate(this.monitor, monitor);\r
-// model.simulate(this.monitor, monitor, experiment);\r
+ model.setStructureModified(false);\r
+ }\r
} catch (Exception e) {\r
e.printStackTrace();\r
this.monitor.showConsole();\r
*******************************************************************************/\r
package org.simantics.sysdyn.simulation;\r
\r
-import org.simantics.simulation.experiment.Experiment;\r
+import org.simantics.sysdyn.manager.SysdynExperiment;\r
import org.simantics.sysdyn.manager.SysdynModel;\r
\r
public class SimulationScheduler {\r
SysdynModel model;\r
- Experiment experiment;\r
+ SysdynExperiment experiment;\r
SimulationJob job;\r
\r
- private SimulationScheduler(SysdynModel model, Experiment experiment) { \r
+ private SimulationScheduler(SysdynModel model, SysdynExperiment experiment) { \r
this.model = model;\r
this.experiment = experiment;\r
this.job = new SimulationJob(model, experiment);\r
job.schedule();\r
}\r
\r
- public static synchronized SimulationScheduler start(SysdynModel model, Experiment experiment) {\r
+ public static synchronized SimulationScheduler start(SysdynModel model, SysdynExperiment experiment) {\r
SimulationScheduler scheduler = model.getService(SimulationScheduler.class);\r
if(scheduler == null || !scheduler.experiment.equals(experiment)) {\r
scheduler = new SimulationScheduler(model, experiment);\r