|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.beanexplorer.beans.Option
biouml.plugins.simulation.SimulationEngine
General class for simulation engine. It defines common contract (properties and methods) for any simulation engine.
| Nested Class Summary | |
static class |
SimulationEngine.VariableType
|
| Field Summary | |
protected double |
absTolerance
|
protected java.util.ResourceBundle |
childResources
Resource bundle containing necessary String data. |
protected java.lang.String |
currentIndent
|
static double |
DEFAULT_ABSOLUTE_TOLERANCE
|
static double |
DEFAULT_RELATIVE_TOLERANCE
|
protected Diagram |
diagram
|
protected static java.lang.String |
endl
|
protected java.util.List |
equationList
List of all equations. |
protected java.util.Map |
equationMap
Stores list of equations for used diagram variable. |
protected EModel |
executableModel
|
protected boolean |
hasConstVariables
Indicates whether model has boundary variables that should be treated as constants. |
protected org.apache.log4j.Category |
log
|
protected java.util.Map |
macros
maps "variable name" -> "scalar equation, calculating this variable" |
protected int |
modelType
Type of the model: STATIC, ODE, etc. |
boolean |
needToShowPlot
|
protected java.lang.String |
outputDir
Output directory where the code will be generated. |
protected static java.util.ResourceBundle |
parentResources
Common description is located in biouml.plugins.simulation.resources.MessagesBundle. |
protected double |
relTolerance
|
protected java.util.ResourceBundle |
resources
Resource bundle containing necessary String data. |
protected java.lang.String |
solverName
|
static java.lang.String |
srcDir
|
protected int |
status
Math processing status. |
protected java.lang.String |
tab
|
protected java.lang.String |
tab2
|
protected java.lang.String |
tab3
|
protected java.lang.String |
tab4
|
protected java.util.List |
usedVariableList
List of all variables however used in model. |
protected MathWriter |
writer
|
| Fields inherited from class com.beanexplorer.beans.Option |
notificationEnabled, propagationEnabled |
| Constructor Summary | |
SimulationEngine()
|
|
| Method Summary | |
void |
clearContext()
|
boolean |
containsDelays()
Returns true if the differential equations contain delays when derivatives computing. |
void |
error(java.lang.String message)
|
void |
error(java.lang.String messageBundleKey,
java.lang.String[] params)
|
void |
error(java.lang.String messageBundleKey,
java.lang.String[] params,
java.lang.Throwable t)
|
void |
fillSimulationResult(SimulationResult result)
|
protected SimulationEngine.VariableType |
findVariable(java.lang.String name)
|
abstract java.io.File[] |
generateModel()
|
abstract java.lang.String |
generateVariableCodeName(int n)
|
double |
getAbsTolerance()
|
double |
getCompletionTime()
|
Diagram |
getDiagram()
|
EModel |
getExecutableModel()
|
abstract Formatter |
getFormatter()
Returns formatter corresponding for given engine. |
double |
getInitialTime()
|
boolean |
getNeedToShowPlot()
|
java.lang.String |
getOutputDir()
|
java.lang.String |
getQualifiedName(java.lang.String name,
DiagramElement de)
Resolves brief varibale name to fully qualified variable name. |
double |
getRelTolerance()
|
java.util.ResourceBundle |
getResourceBundle()
|
java.lang.String |
getResourceString(java.lang.String key)
Returns string from the resource bundle for the specified key. |
protected Equation[] |
getScalarEquations()
|
java.lang.String |
getSolverName()
|
double |
getTimeIncrement()
|
protected void |
init()
Initilaze internal structures for model generation: 1) map: variable - List(equations) 2) variables type. 3) status, errors |
protected void |
initAlgebraic(DiagramElement de)
|
protected void |
initMath(DiagramElement de)
Initialize variable types and equations map. |
protected void |
initResources(java.lang.String resourceBundleName,
java.lang.Class c)
Initialize resources necessary to retrieve localized strings. |
protected boolean |
isSignificantVariable(java.lang.String type)
|
java.lang.String |
normalize(java.lang.String name)
Normalize name to be valid simulation script name. |
protected void |
parseAssignments(Assignment[] assignments,
Role role)
|
protected void |
parseEquation(DiagramElement de)
|
protected void |
processMath(Node node,
Role role)
Substitutes BioUML variable names with variable names used in simulation script. |
protected void |
processVarNode(AstVarNode node,
Role role)
|
void |
setAbsTolerance(double absTolerance)
|
void |
setCompletionTime(double completionTime)
|
void |
setDiagram(Diagram diagram)
|
void |
setInitialTime(double initialTime)
|
void |
setNeedToShowPlot(boolean value)
|
void |
setOutputDir(java.lang.String outputDir)
|
void |
setRelTolerance(double relTolerance)
|
void |
setSolverName(java.lang.String solverName)
|
void |
setTimeIncrement(double timeIncrement)
|
abstract java.lang.String |
simulate(java.io.File[] files)
|
void |
warn(java.lang.String messageBundleKey,
java.lang.String[] params)
|
void |
writeAssignment(java.lang.String variable,
java.lang.String expression,
Role role)
|
protected void |
writeAssignmentImpl(java.lang.String variable,
java.lang.String expression,
Role role,
boolean declare)
|
abstract void |
writeComment(java.lang.String comment)
|
void |
writeFile(java.lang.String source,
java.lang.String outDir,
java.lang.String outFile,
boolean rewrite)
Utility method to write needed source files from the specified source to the specified directory. |
protected void |
writeFunctionDeclarations()
|
protected void |
writeInitialStateEntering()
|
protected void |
writeMath(java.lang.String math,
Role role)
|
protected void |
writeRateEquation(java.util.List list)
|
protected void |
writeRules()
|
protected void |
writeRulesImpl(boolean acceptInternal)
Write rules that are equations with type TYPE_SCALAR. |
protected void |
writeScalarRule(Equation equation,
boolean acceptInternal)
|
protected void |
writeSignificantRules()
|
protected void |
writeTransition(State currentState,
Transition transition)
|
| Methods inherited from class com.beanexplorer.beans.Option |
addPropertyChangeListener, copyListenersTo, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getParent, isNotificationEnabled, isPropagationEnabled, removePropertyChangeListener, setNotificationEnabled, setParent, setPropagationEnabled |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static java.lang.String endl
protected java.lang.String currentIndent
protected java.lang.String tab
protected java.lang.String tab2
protected java.lang.String tab3
protected java.lang.String tab4
public static final double DEFAULT_RELATIVE_TOLERANCE
public static final double DEFAULT_ABSOLUTE_TOLERANCE
public static final java.lang.String srcDir
protected org.apache.log4j.Category log
protected java.util.Map equationMap
protected java.util.List equationList
protected java.util.List usedVariableList
protected boolean hasConstVariables
protected java.util.Map macros
protected int modelType
protected int status
ru.biosoft.math.model.Parser.protected MathWriter writer
protected Diagram diagram
protected EModel executableModel
protected java.lang.String outputDir
protected java.lang.String solverName
protected double absTolerance
protected double relTolerance
public boolean needToShowPlot
protected java.util.ResourceBundle resources
protected java.util.ResourceBundle childResources
protected static java.util.ResourceBundle parentResources
| Constructor Detail |
public SimulationEngine()
| Method Detail |
public abstract java.lang.String generateVariableCodeName(int n)
public abstract java.io.File[] generateModel()
throws java.lang.Exception
java.lang.Exception
public abstract java.lang.String simulate(java.io.File[] files)
throws java.lang.Exception
java.lang.Exception
public void clearContext()
throws java.lang.Exception
java.lang.Exceptionpublic abstract Formatter getFormatter()
public boolean containsDelays()
public Diagram getDiagram()
public void setDiagram(Diagram diagram)
public EModel getExecutableModel()
public java.lang.String getOutputDir()
public void setOutputDir(java.lang.String outputDir)
public java.lang.String getSolverName()
public void setSolverName(java.lang.String solverName)
public double getInitialTime()
public void setInitialTime(double initialTime)
public double getCompletionTime()
public void setCompletionTime(double completionTime)
public double getTimeIncrement()
public void setTimeIncrement(double timeIncrement)
public double getAbsTolerance()
public void setAbsTolerance(double absTolerance)
public double getRelTolerance()
public void setRelTolerance(double relTolerance)
public void setNeedToShowPlot(boolean value)
public boolean getNeedToShowPlot()
public java.util.ResourceBundle getResourceBundle()
public java.lang.String getResourceString(java.lang.String key)
log4j.Category.
protected void initResources(java.lang.String resourceBundleName,
java.lang.Class c)
public void error(java.lang.String message)
public void error(java.lang.String messageBundleKey,
java.lang.String[] params)
public void error(java.lang.String messageBundleKey,
java.lang.String[] params,
java.lang.Throwable t)
public void warn(java.lang.String messageBundleKey,
java.lang.String[] params)
protected SimulationEngine.VariableType findVariable(java.lang.String name)
public java.lang.String getQualifiedName(java.lang.String name,
DiagramElement de)
EModel.getQualifiedName(java.lang.String, biouml.model.DiagramElement)public java.lang.String normalize(java.lang.String name)
protected void init()
throws java.lang.Exception
java.lang.Exceptionprotected void initMath(DiagramElement de)
protected void initAlgebraic(DiagramElement de)
protected void parseEquation(DiagramElement de)
protected void parseAssignments(Assignment[] assignments,
Role role)
protected void writeMath(java.lang.String math,
Role role)
throws java.lang.Exception
java.lang.Exception
protected void writeAssignmentImpl(java.lang.String variable,
java.lang.String expression,
Role role,
boolean declare)
public void writeAssignment(java.lang.String variable,
java.lang.String expression,
Role role)
public abstract void writeComment(java.lang.String comment)
protected void writeInitialStateEntering()
protected void writeScalarRule(Equation equation,
boolean acceptInternal)
protected void writeRules()
protected void writeSignificantRules()
protected void writeRulesImpl(boolean acceptInternal)
protected void writeRateEquation(java.util.List list)
protected void writeTransition(State currentState,
Transition transition)
protected Equation[] getScalarEquations()
protected void processMath(Node node,
Role role)
protected void processVarNode(AstVarNode node,
Role role)
protected void writeFunctionDeclarations()
public void fillSimulationResult(SimulationResult result)
throws java.lang.Exception
java.lang.Exceptionprotected boolean isSignificantVariable(java.lang.String type)
public void writeFile(java.lang.String source,
java.lang.String outDir,
java.lang.String outFile,
boolean rewrite)
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||