HEADER

biouml.plugins.simulation
Class SimulationEngine

|
+--biouml.plugins.simulation.SimulationEngine
Direct Known Subclasses:
MatlabSimulationEngine, JavaSimulationEngine

public abstract class SimulationEngine
extends Option

General class for simulation engine. It defines common contract (properties and methods) for any simulation engine.


Inner Class Summary
 public static classSimulationEngine.VariableType
           

Field Summary
 final static doubleDEFAULT_ABSOLUTE_TOLERANCE
           
 final static doubleDEFAULT_RELATIVE_TOLERANCE
           
 booleanneedToShowPlot
           
 final static StringsrcDir
           

Method Summary
 voidclearContext()
           
 booleancontainsDelays()
          Returns true if the differential equations contain delays when derivatives computing.
 voiderror(String message)
           
 voiderror(String messageBundleKey, String[] params)
           
 voiderror(String messageBundleKey, String[] params, Throwable t)
           
 voidfillSimulationResult(SimulationResult result)
           
 abstract File[]generateModel()
           
 abstract StringgenerateVariableCodeName(int n)
           
 doublegetAbsTolerance()
           
 doublegetCompletionTime()
           
 DiagramgetDiagram()
           
 EModelgetExecutableModel()
           
 abstract FormattergetFormatter()
          Returns formatter corresponding for given engine.
 doublegetInitialTime()
           
 booleangetNeedToShowPlot()
           
 StringgetOutputDir()
           
 StringgetQualifiedName(String name, DiagramElement de)
          Resolves brief varibale name to fully qualified variable name.
 doublegetRelTolerance()
           
 ResourceBundlegetResourceBundle()
           
 StringgetResourceString(String key)
          Returns string from the resource bundle for the specified key.
 StringgetSolverName()
           
 doublegetTimeIncrement()
           
 Stringnormalize(String name)
          Normalize name to be valid simulation script name.
 voidsetAbsTolerance(double absTolerance)
           
 voidsetCompletionTime(double completionTime)
           
 voidsetDiagram(Diagram diagram)
           
 voidsetInitialTime(double initialTime)
           
 voidsetNeedToShowPlot(boolean value)
           
 voidsetOutputDir(String outputDir)
           
 voidsetRelTolerance(double relTolerance)
           
 voidsetSolverName(String solverName)
           
 voidsetTimeIncrement(double timeIncrement)
           
 abstract Stringsimulate(File[] files)
           
 voidwarn(String messageBundleKey, String[] params)
           
 voidwriteAssignment(String variable, String expression, Role role)
           
 abstract voidwriteComment(String comment)
           
 voidwriteFile(String source, String outDir, String outFile, boolean rewrite)
          Utility method to write needed source files from the specified source to the specified directory.

Field Detail

DEFAULT_ABSOLUTE_TOLERANCE

public final static double DEFAULT_ABSOLUTE_TOLERANCE

DEFAULT_RELATIVE_TOLERANCE

public final static double DEFAULT_RELATIVE_TOLERANCE

needToShowPlot

public boolean needToShowPlot

srcDir

public final static String srcDir
Method Detail

clearContext

public void clearContext()
throws java.lang.Exception

containsDelays

public boolean containsDelays()
Returns true if the differential equations contain delays when derivatives computing.

error

public void error(String message)

error

public void error(String messageBundleKey, String[] params)

error

public void error(String messageBundleKey, String[] params, Throwable t)

fillSimulationResult

public void fillSimulationResult(SimulationResult result)
throws java.lang.Exception

generateModel

public abstract File[] generateModel()
throws java.lang.Exception

generateVariableCodeName

public abstract String generateVariableCodeName(int n)

getAbsTolerance

public double getAbsTolerance()

getCompletionTime

public double getCompletionTime()

getDiagram

public Diagram getDiagram()

getExecutableModel

public EModel getExecutableModel()

getFormatter

public abstract Formatter getFormatter()
Returns formatter corresponding for given engine.

getInitialTime

public double getInitialTime()

getNeedToShowPlot

public boolean getNeedToShowPlot()

getOutputDir

public String getOutputDir()

getQualifiedName

public String getQualifiedName(String name, DiagramElement de)
Resolves brief varibale name to fully qualified variable name. Generates error if variable can not be resolved.
See Also:
biouml.model.dynamics.EModel.getQualifiedName(java.lang.String,biouml.model.DiagramElement)

getRelTolerance

public double getRelTolerance()

getResourceBundle

public ResourceBundle getResourceBundle()

getResourceString

public String getResourceString(String key)
Returns string from the resource bundle for the specified key. If the sting is absent the key string is returned instead and the message is printed in log4j.Category.

getSolverName

public String getSolverName()

getTimeIncrement

public double getTimeIncrement()

normalize

public String normalize(String name)
Normalize name to be valid simulation script name.

setAbsTolerance

public void setAbsTolerance(double absTolerance)

setCompletionTime

public void setCompletionTime(double completionTime)

setDiagram

public void setDiagram(Diagram diagram)

setInitialTime

public void setInitialTime(double initialTime)

setNeedToShowPlot

public void setNeedToShowPlot(boolean value)

setOutputDir

public void setOutputDir(String outputDir)

setRelTolerance

public void setRelTolerance(double relTolerance)

setSolverName

public void setSolverName(String solverName)

setTimeIncrement

public void setTimeIncrement(double timeIncrement)

simulate

public abstract String simulate(File[] files)
throws java.lang.Exception

warn

public void warn(String messageBundleKey, String[] params)

writeAssignment

public void writeAssignment(String variable, String expression, Role role)

writeComment

public abstract void writeComment(String comment)

writeFile

public void writeFile(String source, String outDir, String outFile, boolean rewrite)
throws java.lang.Exception
Utility method to write needed source files from the specified source to the specified directory.

Association Links

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class org.apache.log4j.Category

to Class java.util.Map

Stores list of equations for used diagram variable.

to Class java.util.List

List of all equations.

to Class java.util.List

List of all variables however used in model.

to Class java.util.Map

maps "variable name" -> "scalar equation, calculating this variable"

to Class biouml.plugins.simulation.MathWriter

to Class biouml.model.Diagram

to Class biouml.model.dynamics.EModel

to Class java.lang.String

Output directory where the code will be generated.

to Class java.lang.String

to Class java.util.ResourceBundle

Resource bundle containing necessary String data. This resource bundle contains join of childResources with parentResources.

to Class java.util.ResourceBundle

Resource bundle containing necessary String data.

to Class java.util.ResourceBundle

Common description is located in biouml.plugins.simulation.resources.MessagesBundle. This bundle is used as parent bundle for resources.

FOOTER

BOTTOM