Version 1.2 (June 2013)
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Public Attributes | Protected Attributes | List of all members
simulator.reaction.Reaction Class Referenceabstract

Class containing methods to create and query reactions that occur in the simulation. More...

Inheritance diagram for simulator.reaction.Reaction:
simulator.reaction.FirstOrder simulator.reaction.ReactionFactor simulator.reaction.ReactionFactorWithConstant simulator.reaction.ReactionGrowthFitness simulator.reaction.SingleMonod

Public Member Functions

void init (Simulator aSim, XMLParser aReactionRoot)
 Initialises a reaction object, giving the object the properties stated in the protocol file. More...
 
void initFromAgent (ActiveAgent anAgent, Simulator aSim, XMLParser xmlRoot)
 Use the reaction class to fill the parameters fields of the agent. Populate only the yield vector, the kinetic vector will be filled by the subdefined method in the child classes. More...
 
void register (String aReactionName, Simulator aSimulator)
 End of the initialization procedure. Store the name and simulation dictionary index for this reaction. More...
 
LinkedList< String > declareSolutes ()
 Utilised by a solver instance to know the solutes affected by this reaction. More...
 
void fillParameters (Simulator aSim, XMLParser xmlRoot)
 Reads the reaction information (name, solute yield, particle yield etc) from the XML file and initialises this reaction. More...
 
void addAgent (ActiveAgent anAgent)
 Register an agent among the guild of this pathway. More...
 
void removeAgent (ActiveAgent anAgent)
 Remove an agent among the guild of this pathway. More...
 
abstract double computeMassGrowthRate (ActiveAgent anAgent)
 Compute the marginal growth rate (i.e the specific growth rate times the mass of the particle which is mediating this reaction) More...
 
abstract double computeSpecGrowthRate (ActiveAgent anAgent)
 Compute the specific growth rate. More...
 
abstract void computeSpecificGrowthRate (ActiveAgent anAgent)
 Return the specific reaction rate for a given agent. More...
 
abstract void computeSpecificGrowthRate (double[] s, ActiveAgent anAgent)
 Compute specific growth rate in function to concentrations sent. More...
 
abstract void computeSpecificGrowthRate (double[] s)
 Compute specific growth rate in function of concentrations sent Parameters used are those defined for the reaction. More...
 
abstract void computeUptakeRate (double[] s, double mass, double t)
 Update the array of uptake rates and the array of its derivative. Based on default values of parameters. Unit is fg.h-1. More...
 
void applyReaction (SpatialGrid[] concGrid, SpatialGrid[] reacGrid, SpatialGrid[] diffReacGrid, SpatialGrid biomassGrid)
 Compute reaction rate on each concerned solute grids Assumes same parameters for all the agents of a same guild. More...
 
void fitAgentMassOnGrid (SpatialGrid aSpG)
 Add the mass of all the agents of the guild on a received grid. The stored value is a CONCENTRATION. More...
 
double[] readConcentrationSeen (ActiveAgent anAgent, SoluteGrid[] concGrid)
 Return a double array with all concentration seen by an agent on the default solute grid. More...
 
void writeReport (ResultFile bufferState, ResultFile bufferSum) throws Exception
 Write reaction information to the result file stream. More...
 
void fitGuildOnGrid ()
 Build a grid with mass and mass-growth-rate of all agents of the guild. More...
 
double[] getSoluteYield ()
 Return the solute yield. More...
 
int[] getSoluteIndex ()
 Return the solute index. More...
 
double[] getParticulateYield ()
 Return the particulate yield. More...
 
double[] getKinetic ()
 Return the kinetic parameters used in this reaction. More...
 
LinkedList< ActiveAgentgetGuild ()
 Return the guild of this pathway. More...
 
abstract Matrix calcdMUdS (Matrix S, double biomass)
 Calculate the rate of change of each uptake rate with respect to each solute. Returned as a matrix. More...
 
abstract Matrix calcdMUdT (Matrix S, double biomass)
 Calculate the rate of change of each uptake rate with respect to time. More...
 
abstract void updateMarginalMu (double[] s)
 Update the Marginal Mu data matrix. More...
 
abstract double computeSpecRate (double[] s)
 Compute the specific growth rate. More...
 
abstract double[] computeMarginalDiffMu (double[] s)
 Compute the marginal difference array. More...
 

Public Attributes

String reactionName
 
int reactionIndex
 
int _catalystIndex
 
int[] _mySoluteIndex
 
boolean autocatalytic
 
double[] totalUptake
 
double Dil
 

Protected Attributes

LinkedList< ActiveAgent_guild = new LinkedList<ActiveAgent>()
 
SoluteGrid[] _soluteList
 
SoluteGrid _reacGrid
 
SoluteGrid _guildGrid
 
double _specRate
 
double[] _diffUptakeRate
 
double[] _uptakeRate
 
double[] _soluteYield
 
double[] _kineticParam
 
double[] _particleYield
 
String[] _particleNameYield
 

Detailed Description

Class containing methods to create and query reactions that occur in the simulation.

Reactions in which solutes or biomass are produced or consumed mediate the dynamics of the entire iDynoMiCS simulation. The REACTION markup in the XML file specifies the reactions that occur. These may be defined via both stoichiometric and kinetic forms, and both of these representations are used in definining reactions in the protocol file.

Version
1.2
Author
Andreas Dötsch (andre.nosp@m.as.d.nosp@m.oetsc.nosp@m.h@he.nosp@m.lmhol.nosp@m.tz-h.nosp@m.zi.de), Helmholtz Centre for Infection Research (Germany)
Laurent Lardon (lardo.nosp@m.nl@s.nosp@m.upagr.nosp@m.o.in.nosp@m.ra.fr), INRA, France
Kieran Alden (k.j.a.nosp@m.lden.nosp@m.@bham.nosp@m..ac..nosp@m.uk), Centre for Systems Biology, University of Birmingham, UK

Member Function Documentation

void simulator.reaction.Reaction.addAgent ( ActiveAgent  anAgent)

Register an agent among the guild of this pathway.

Register an agent among the guild of this pathway

Parameters
anAgentActiveAgent to register
void simulator.reaction.Reaction.applyReaction ( SpatialGrid[]  concGrid,
SpatialGrid[]  reacGrid,
SpatialGrid[]  diffReacGrid,
SpatialGrid  biomassGrid 
)

Compute reaction rate on each concerned solute grids Assumes same parameters for all the agents of a same guild.

Compute reaction rate on each concerned solute grids Assumes same parameters for all the agents of a same guild

Parameters
concGridSolute concentration
reacGridContribution of the reaction to the solute concentration dynamics
diffReacGridDerivative of the previous grid
biomassGridCONCENTRATION of the catalyst
See Also
multigrid solver
abstract Matrix simulator.reaction.Reaction.calcdMUdS ( Matrix  S,
double  biomass 
)
pure virtual

Calculate the rate of change of each uptake rate with respect to each solute. Returned as a matrix.

Calculate the rate of change of each uptake rate with respect to each solute. Returned as a matrix

Parameters
STemporary container for solute concentration
biomassTotal particle mass in the system which catalyses this reaction
Returns
Matrix containing rate of change of each uptake rate with respect to each solute

Implemented in simulator.reaction.ReactionFactor, simulator.reaction.ReactionFactorWithConstant, simulator.reaction.ReactionGrowthFitness, simulator.reaction.SingleMonod, and simulator.reaction.FirstOrder.

abstract Matrix simulator.reaction.Reaction.calcdMUdT ( Matrix  S,
double  biomass 
)
pure virtual

Calculate the rate of change of each uptake rate with respect to time.

Calculate the rate of change of each uptake rate with respect to time. dMUdT = catalyticBiomass*specificGrowthRate*soluteYield. Returned as a matrix

Parameters
STemporary container for solute concentration
biomassTotal particle mass in the system which catalyses this reaction
Returns
Matrix containing rate of change of each uptake rate with respect to time

Implemented in simulator.reaction.ReactionFactor, simulator.reaction.ReactionFactorWithConstant, simulator.reaction.ReactionGrowthFitness, simulator.reaction.SingleMonod, and simulator.reaction.FirstOrder.

abstract double [] simulator.reaction.Reaction.computeMarginalDiffMu ( double[]  s)
pure virtual

Compute the marginal difference array.

Compute the marginal difference array. Don't forget to update marginalMu before calling this!

Parameters
sTemporary container for solute concentration
Returns
Marginal diff array

Implemented in simulator.reaction.ReactionFactorWithConstant, simulator.reaction.ReactionGrowthFitness, simulator.reaction.ReactionFactor, simulator.reaction.SingleMonod, and simulator.reaction.FirstOrder.

abstract double simulator.reaction.Reaction.computeMassGrowthRate ( ActiveAgent  anAgent)
pure virtual

Compute the marginal growth rate (i.e the specific growth rate times the mass of the particle which is mediating this reaction)

Compute the marginal growth rate (i.e the specific growth rate times the mass of the particle which is mediating this reaction)

Parameters
anAgentSpecific growth rate for this ActiveAgent
Returns
The marginal growth rate

Implemented in simulator.reaction.ReactionFactorWithConstant, simulator.reaction.ReactionFactor, simulator.reaction.ReactionGrowthFitness, simulator.reaction.FirstOrder, and simulator.reaction.SingleMonod.

abstract double simulator.reaction.Reaction.computeSpecGrowthRate ( ActiveAgent  anAgent)
pure virtual

Compute the specific growth rate.

Compute the specific growth rate

Parameters
anAgentSpecific growth rate for this ActiveAgent
Returns
The specific growth rate

Implemented in simulator.reaction.ReactionFactorWithConstant, simulator.reaction.ReactionFactor, simulator.reaction.ReactionGrowthFitness, simulator.reaction.SingleMonod, and simulator.reaction.FirstOrder.

abstract void simulator.reaction.Reaction.computeSpecificGrowthRate ( ActiveAgent  anAgent)
pure virtual

Return the specific reaction rate for a given agent.

Return the specific reaction rate for a given agent

Parameters
anAgentAgent to use to determine solute concentration and calculate reaction rate
See Also
ActiveAgent.grow()
Episome.computeRate(EpiBac)

Implemented in simulator.reaction.ReactionGrowthFitness, simulator.reaction.ReactionFactorWithConstant, simulator.reaction.ReactionFactor, simulator.reaction.FirstOrder, and simulator.reaction.SingleMonod.

abstract void simulator.reaction.Reaction.computeSpecificGrowthRate ( double[]  s,
ActiveAgent  anAgent 
)
pure virtual

Compute specific growth rate in function to concentrations sent.

Compute specific growth rate in function to concentrations sent

Parameters
sArray of solute concentration
anAgentParameters used are those defined for THIS agent

Implemented in simulator.reaction.ReactionGrowthFitness, simulator.reaction.ReactionFactor, simulator.reaction.ReactionFactorWithConstant, simulator.reaction.FirstOrder, and simulator.reaction.SingleMonod.

abstract void simulator.reaction.Reaction.computeSpecificGrowthRate ( double[]  s)
pure virtual

Compute specific growth rate in function of concentrations sent Parameters used are those defined for the reaction.

Compute specific growth rate in function of concentrations sent Parameters used are those defined for the reaction.

Parameters
sArray of solute concentration

Implemented in simulator.reaction.ReactionGrowthFitness, simulator.reaction.ReactionFactorWithConstant, simulator.reaction.ReactionFactor, simulator.reaction.SingleMonod, and simulator.reaction.FirstOrder.

abstract double simulator.reaction.Reaction.computeSpecRate ( double[]  s)
pure virtual

Compute the specific growth rate.

Compute the specific growth rate. Don't forget to update marginalMu before calling this!

Parameters
sTemporary container for solute concentration
Returns
The specific growth rate

Implemented in simulator.reaction.ReactionFactorWithConstant, simulator.reaction.ReactionFactor, simulator.reaction.ReactionGrowthFitness, simulator.reaction.SingleMonod, and simulator.reaction.FirstOrder.

abstract void simulator.reaction.Reaction.computeUptakeRate ( double[]  s,
double  mass,
double  t 
)
pure virtual

Update the array of uptake rates and the array of its derivative. Based on default values of parameters. Unit is fg.h-1.

Update the array of uptake rates and the array of its derivative. Based on default values of parameters. Unit is fg.h-1

Parameters
sThe concentration of solute locally observed
massMass of the catalyst (cell...)
tTime

Implemented in simulator.reaction.ReactionGrowthFitness, simulator.reaction.ReactionFactorWithConstant, simulator.reaction.ReactionFactor, simulator.reaction.SingleMonod, and simulator.reaction.FirstOrder.

LinkedList<String> simulator.reaction.Reaction.declareSolutes ( )

Utilised by a solver instance to know the solutes affected by this reaction.

Utility method called by a solver instance to know the solutes affected by this reaction

Returns
a list of solutes affected by this reaction
See Also
DiffusionSolver.addReaction()
void simulator.reaction.Reaction.fillParameters ( Simulator  aSim,
XMLParser  xmlRoot 
)

Reads the reaction information (name, solute yield, particle yield etc) from the XML file and initialises this reaction.

This method takes one reaction from the XML file and initialises a Reaction object with the properties stated in the protocol file. This includes reaction name, what the reaction is catalysed by, reaction kinetics, and solute and particle yields

Parameters
aSimThe simulation object used to simulate the conditions specified in the protocol file
xmlRootThe XML object containing the definition of one reaction in the protocol file
void simulator.reaction.Reaction.fitAgentMassOnGrid ( SpatialGrid  aSpG)

Add the mass of all the agents of the guild on a received grid. The stored value is a CONCENTRATION.

Add the mass of all the agents of the guild on a received grid. The stored value is a CONCENTRATION

Parameters
aSpGSpatial grid of reactive biomass
void simulator.reaction.Reaction.fitGuildOnGrid ( )

Build a grid with mass and mass-growth-rate of all agents of the guild.

Build a grid with mass and mass-growth-rate of all agents of the guild. Used when outputting simulation state to file

LinkedList<ActiveAgent> simulator.reaction.Reaction.getGuild ( )

Return the guild of this pathway.

Return the guild of this pathway

Returns
LinkedList containing all agents in the guild
double [] simulator.reaction.Reaction.getKinetic ( )

Return the kinetic parameters used in this reaction.

Return the kinetic parameters used in this reaction

Returns
Double array containing kinetic parameters
double [] simulator.reaction.Reaction.getParticulateYield ( )

Return the particulate yield.

Return the particulate yield

Returns
Double array of particulate yield
int [] simulator.reaction.Reaction.getSoluteIndex ( )

Return the solute index.

Return the solute index

Returns
Integer array of solute index
double [] simulator.reaction.Reaction.getSoluteYield ( )

Return the solute yield.

Return the solute yield

Returns
Double array of solute yield
void simulator.reaction.Reaction.init ( Simulator  aSim,
XMLParser  aReactionRoot 
)

Initialises a reaction object, giving the object the properties stated in the protocol file.

Reactions in which solutes or biomass are produced or consumed mediate the dynamics of iDynoMiCS. This constructor initialises a particular reaction that is stated in the protocol file. Kinetic parameters are managed by the subdefined method in the children class

Parameters
aSimThe simulation object used to simulate the conditions specified in the protocol file
aReactionRootThe XML object containing the definition of one reaction in the protocol file
See Also
Simulator.createReaction()
void simulator.reaction.Reaction.initFromAgent ( ActiveAgent  anAgent,
Simulator  aSim,
XMLParser  xmlRoot 
)

Use the reaction class to fill the parameters fields of the agent. Populate only the yield vector, the kinetic vector will be filled by the subdefined method in the child classes.

Use the reaction class to fill the parameters fields of the agent. Populate only the yield vector, the kinetic vector will be filled by the subdefined method in the child classes

Parameters
anAgentThe ActiveAgent which parameters are being populated
aSimThe simulation object used to simulate the conditions specified in the protocol file
xmlRootThe XML object containing the definition of one reaction in the protocol file
See Also
Simulator.createReaction()
double [] simulator.reaction.Reaction.readConcentrationSeen ( ActiveAgent  anAgent,
SoluteGrid[]  concGrid 
)

Return a double array with all concentration seen by an agent on the default solute grid.

Return a double array with all concentration seen by an agent on the default solute grid

Parameters
anAgentActiveAgent responding to solute levels
concGridSolute concentration grid
Returns
all the concentration seen by an agent on the default solute grid
void simulator.reaction.Reaction.register ( String  aReactionName,
Simulator  aSimulator 
)

End of the initialization procedure. Store the name and simulation dictionary index for this reaction.

End of the initialization procedure. Store the name and simulation dictionary index for this reaction

Parameters
aReactionNameName of this reaction
aSimulatorInteger reference to the readcion simulation dictionary
See Also
Simulator.addReaction()
void simulator.reaction.Reaction.removeAgent ( ActiveAgent  anAgent)

Remove an agent among the guild of this pathway.

Remove an agent among the guild of this pathway

Parameters
anAgentActiveAgent to remove
abstract void simulator.reaction.Reaction.updateMarginalMu ( double[]  s)
pure virtual

Update the Marginal Mu data matrix.

Update the Marginal Mu data matrix

Parameters
sTemporary container for solute concentration

Implemented in simulator.reaction.ReactionFactorWithConstant, simulator.reaction.ReactionFactor, simulator.reaction.SingleMonod, simulator.reaction.ReactionGrowthFitness, and simulator.reaction.FirstOrder.

void simulator.reaction.Reaction.writeReport ( ResultFile  bufferState,
ResultFile  bufferSum 
) throws Exception

Write reaction information to the result file stream.

Write reaction information to the result file stream

Parameters
bufferStateBuffer for state result files
bufferSumBuffer for sum result files
Exceptions
ExceptionException thrown if these files cannot be opened

Member Data Documentation

int simulator.reaction.Reaction._catalystIndex

Holds an integer that references the simulation particle dictionary - notes the particle that catalyses this reaction

double [] simulator.reaction.Reaction._diffUptakeRate
protected

Buffer vector used to communicate diffision uptake rate to the solver, for each solute

LinkedList<ActiveAgent> simulator.reaction.Reaction._guild = new LinkedList<ActiveAgent>()
protected

Agents hosting this process

SoluteGrid simulator.reaction.Reaction._guildGrid
protected

Grid concerning the biomass that catalyses this reaction

double [] simulator.reaction.Reaction._kineticParam
protected

Array to store the kinetic factors involved in this reaction

int [] simulator.reaction.Reaction._mySoluteIndex

A list of solute indices: if that solute's yield in this reaction is non-zero then it is on this list. Hence, this is the list of solutes which are affected by this reaction.

String [] simulator.reaction.Reaction._particleNameYield
protected

Array to store the names of the particles yielded in this reaction (sonia: 21-05-09)

double [] simulator.reaction.Reaction._particleYield
protected

Array to store the particle yield from this reaction. If a solute is not concerned by the current reaction, the yield will be zero

SoluteGrid simulator.reaction.Reaction._reacGrid
protected

Solute grid that stores reaction rate for this reaction

SoluteGrid [] simulator.reaction.Reaction._soluteList
protected

Local copy of the solute grids used in this simulation. Used for efficiency purposes

double [] simulator.reaction.Reaction._soluteYield
protected

Array to store the solute yield from this reaction. If a solute is not concerned by the current reaction, the yield will be zero

double simulator.reaction.Reaction._specRate
protected

Temporary storage used during computation of reaction rates

double [] simulator.reaction.Reaction._uptakeRate
protected

Buffer vector used to communicate uptake rate to the solver, for each solute

boolean simulator.reaction.Reaction.autocatalytic

Boolean noting whether or not the catalytic particle is affected by the reaction

double simulator.reaction.Reaction.Dil

dilution rate from associated bulk (sonia 21-04-10)

int simulator.reaction.Reaction.reactionIndex

Index to this reaction in the simulation dictionary

String simulator.reaction.Reaction.reactionName

Name of this reaction. Set from the relevant tag in the protocol file

double [] simulator.reaction.Reaction.totalUptake

Buffer vector used to communicate uptake rate to the solver, for each solute


The documentation for this class was generated from the following file: