public class SBMLinterpreter extends EquationSystem
This differential equation system (DESystem
) takes a model in
SBML
format and maps it to a data structure that is understood by the AbstractDESSolver
.
Therefore, this class implements all necessary functions expected by SBML.
changeRate, TEMP_VALUE
Constructor and Description |
---|
SBMLinterpreter(org.sbml.jsbml.Model model)
This constructs a new
DESystem for the given SBML Model . |
SBMLinterpreter(org.sbml.jsbml.Model model,
double defaultSpeciesValue,
double defaultParameterValue,
double defaultCompartmentValue) |
SBMLinterpreter(org.sbml.jsbml.Model model,
double defaultSpeciesValue,
double defaultParameterValue,
double defaultCompartmentValue,
Map<String,Boolean> amountHash)
Creates a new
SBMLinterpreter |
Modifier and Type | Method and Description |
---|---|
double |
compileReaction(int reactionIndex) |
void |
computeDerivatives(double time,
double[] Y,
double[] changeRate) |
void |
computeDerivativeWithChangingCompartment(org.sbml.jsbml.Species sp,
double[] changeRate) |
double[] |
getAdditionalValues(double t,
double[] Y)
Computes and/or delivers the intermediate results at the given time and for the given results
from the previous time step.
|
EventInProgress |
getNextEventAssignments(double t,
double previousTime,
double[] Y)
Returns a list with event assignments for the events triggered either by the time t or by the
concentrations of the species stored in Y.
|
void |
init()
This method initializes the differential equation system for simulation.
|
void |
init(boolean refreshTree)
This method initializes the differential equation system for simulation.
|
void |
init(boolean renewTree,
double defaultSpeciesValue,
double defaultParameterValue,
double defaultCompartmentValue)
This method initializes the differential equation system for simulation.
|
void |
init(boolean renewTree,
double defaultSpeciesValue,
double defaultParameterValue,
double defaultCompartmentValue,
Map<String,Boolean> amountHash)
This method initializes the differential equation system for simulation.
|
boolean |
processAssignmentRules(double t,
double[] Y)
Calculates the changes or assignments that are defined by all rules in the system at the given
simulation time point.
|
void |
processInitialAssignments(double time,
double[] Y)
Processes the initial assignments
|
boolean |
processRules(double time,
double[] changeRate,
double[] Y,
boolean initialCalculations)
Processes the rules
|
void |
setParameters(double[] params)
This method allows us to set the parameters of the model to the specified values in the given
array.
|
void |
updateSpeciesConcentration(AmountManager amountManager)
Updates the species concentration as per the updated values in the AmountManager.
|
addConstraintListener, computeDelayedValue, containsEventsOrRules, containsFastProcesses, copyAST, getAdditionalValueCount, getAdditionalValueIds, getChangeRate, getConstantHash, getConstraintListenerCount, getCurrentCompartmentSize, getCurrentCompartmentValueOf, getCurrentParameterValue, getCurrentSpeciesValue, getCurrentStoichiometry, getCurrentTime, getCurrentValueOf, getCurrentValueOf, getDimension, getEventCount, getIdentifiers, getInitialValues, getModel, getNoDerivatives, getParameterCount, getPositionOfParameters, getPositiveValueCount, getRateRulesRoots, getRuleCount, getSymbolHash, getY, propertyChange, registerDelayValueHolder, removeConstraintListener, removeConstraintListener, setCurrentTime, setDelaysIncluded, setFastProcessComputation, setPreviousTimePoint
public SBMLinterpreter(org.sbml.jsbml.Model model) throws org.sbml.jsbml.validator.ModelOverdeterminedException, org.sbml.jsbml.SBMLException
This constructs a new DESystem
for the given SBML Model
. Note that only a
maximum of Integer.MAX_VALUE
Species
can be simulated. If the model contains
more Species
, this class is not applicable.
Note that currently, units are not considered.
model
- org.sbml.jsbml.validator.ModelOverdeterminedException
org.sbml.jsbml.SBMLException
public SBMLinterpreter(org.sbml.jsbml.Model model, double defaultSpeciesValue, double defaultParameterValue, double defaultCompartmentValue) throws org.sbml.jsbml.SBMLException, org.sbml.jsbml.validator.ModelOverdeterminedException
model
- defaultSpeciesValue
- defaultParameterValue
- defaultCompartmentValue
- org.sbml.jsbml.SBMLException
org.sbml.jsbml.validator.ModelOverdeterminedException
public SBMLinterpreter(org.sbml.jsbml.Model model, double defaultSpeciesValue, double defaultParameterValue, double defaultCompartmentValue, Map<String,Boolean> amountHash) throws org.sbml.jsbml.SBMLException, org.sbml.jsbml.validator.ModelOverdeterminedException
SBMLinterpreter
model
- the model to interpretdefaultSpeciesValue
- the default value for species, if no value is givendefaultParameterValue
- the default value for parameters, if no value is givendefaultCompartmentValue
- the default value for compartments, if no value is givenamountHash
- a hash that states for the species in the model, whether their
amount or their concentration should be computedorg.sbml.jsbml.SBMLException
org.sbml.jsbml.validator.ModelOverdeterminedException
public double[] getAdditionalValues(double t, double[] Y) throws org.apache.commons.math.ode.DerivativeException
t
- The time point for which intermediate results are to be computed.Y
- The result vector from the previous time step.org.apache.commons.math.ode.DerivativeException
- If the system cannot be solved for the given configuration or no
intermediate results can be computed in this step.public EventInProgress getNextEventAssignments(double t, double previousTime, double[] Y) throws org.apache.commons.math.ode.DerivativeException
t
- The current simulation time.Y
- The current change of the system.org.apache.commons.math.ode.DerivativeException
public void computeDerivatives(double time, double[] Y, double[] changeRate) throws org.apache.commons.math.ode.DerivativeException
org.apache.commons.math.ode.DerivativeException
public void init() throws org.sbml.jsbml.validator.ModelOverdeterminedException, org.sbml.jsbml.SBMLException
This method initializes the differential equation system for simulation. In more detail: the
initial amounts or concentration will be assigned to every Species
or InitialAssignment
s if any are executed.
To save computation time the results of this method should be stored in an array. Hence this method must only be called once. However, if the SBML model to be simulated contains initial assignments, this can lead to wrong simulation results because initial assignments may depend on current parameter values.
org.sbml.jsbml.validator.ModelOverdeterminedException
org.sbml.jsbml.SBMLException
init(boolean, double, double, double)
public void init(boolean refreshTree) throws org.sbml.jsbml.validator.ModelOverdeterminedException, org.sbml.jsbml.SBMLException
ASTNode
s has to be refreshed.refreshTree
- org.sbml.jsbml.validator.ModelOverdeterminedException
org.sbml.jsbml.SBMLException
public void init(boolean renewTree, double defaultSpeciesValue, double defaultParameterValue, double defaultCompartmentValue) throws org.sbml.jsbml.validator.ModelOverdeterminedException, org.sbml.jsbml.SBMLException
ASTNode
s has to be refreshed and give some default values.renewTree
- defaultSpeciesValue
- defaultParameterValue
- defaultCompartmentValue
- org.sbml.jsbml.validator.ModelOverdeterminedException
org.sbml.jsbml.SBMLException
public void init(boolean renewTree, double defaultSpeciesValue, double defaultParameterValue, double defaultCompartmentValue, Map<String,Boolean> amountHash) throws org.sbml.jsbml.validator.ModelOverdeterminedException, org.sbml.jsbml.SBMLException
ASTNode
s has to be refreshed, give some default values and state
whether a Species
is seen as an amount or a concentration.init
in class EquationSystem
renewTree
- defaultSpeciesValue
- defaultParameterValue
- defaultCompartmentValue
- amountHash
- org.sbml.jsbml.validator.ModelOverdeterminedException
org.sbml.jsbml.SBMLException
public boolean processAssignmentRules(double t, double[] Y) throws org.apache.commons.math.ode.DerivativeException
t
- The current simulation time.Y
- The current change of the system.true
if there has been a change in the Y vector caused by the
rules.org.apache.commons.math.ode.DerivativeException
public void processInitialAssignments(double time, double[] Y) throws org.sbml.jsbml.SBMLException
time
- the ASTNode
timeY
- the Y vectororg.sbml.jsbml.SBMLException
public boolean processRules(double time, double[] changeRate, double[] Y, boolean initialCalculations) throws org.sbml.jsbml.SBMLException
time
- the current timechangeRate
- the changeRate vectorY
- the Y vectorinitialCalculations
- org.sbml.jsbml.SBMLException
public void computeDerivativeWithChangingCompartment(org.sbml.jsbml.Species sp, double[] changeRate)
public void setParameters(double[] params)
params
- An array of parameter values to be set for this model. If the number of given
parameters does not match the number of model parameters, an exception will be
thrown.public void updateSpeciesConcentration(AmountManager amountManager)
amountManager
- public double compileReaction(int reactionIndex)
reactionIndex
- index of the reactionCopyright © 2007–2021. All rights reserved.