DelaySim
Class Reaction

java.lang.Object
  extended by DelaySim.Reaction

public class Reaction
extends java.lang.Object

A class describing a generic reaction. This reaction is described by - a name; - a stoichiometry vector for reactants, and one for products; - a kinetic constant; - a delay, which can be either greater or equal to 0.


Field Summary
 double delay
          the delay
 double k
          the kinetic constant
 java.lang.String name
          the reaction name
 int[] nu_p
          the stoichiometry vector for products
 int[] nu_r
          the stoichiometry vector for reactants
 double rate
           
 
Constructor Summary
Reaction(java.lang.String name, int[] reactants, int[] products, double constant, double delay)
          Constructor for a Reaction object.
 
Method Summary
 void insert_producs(int[] state)
          Perform insertion of the products in the state vector given as parameter.
 boolean is_applicable(int[] state)
          Check if reaction is applicable in the state vector given as parameter.
 double rate(int[] state)
          Evaluate the propensity function for the reaction in the state described by the vector used as parameter.
 void remove_reactants(int[] state)
          Perform removal of the reactants from the state vector given as parameter.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nu_r

public int[] nu_r
the stoichiometry vector for reactants


nu_p

public int[] nu_p
the stoichiometry vector for products


k

public double k
the kinetic constant


delay

public double delay
the delay


name

public java.lang.String name
the reaction name


rate

public double rate
Constructor Detail

Reaction

public Reaction(java.lang.String name,
                int[] reactants,
                int[] products,
                double constant,
                double delay)
Constructor for a Reaction object.

Parameters:
name - the name of the reaction;
reactants - the stoichiometry vector for reactants;
products - the stoichiometry vector for products;
constant - the kinetic constant;
delay - the delay of the reaction.
Method Detail

rate

public double rate(int[] state)
Evaluate the propensity function for the reaction in the state described by the vector used as parameter. The analytical form of the propensity function is the classical by Gillespie.

Parameters:
state - the integer vector describing the state;
Returns:
the evaluation of the propensity function.

is_applicable

public boolean is_applicable(int[] state)
Check if reaction is applicable in the state vector given as parameter.

Parameters:
state - the integer vector describing the state;

remove_reactants

public void remove_reactants(int[] state)
Perform removal of the reactants from the state vector given as parameter.

Parameters:
state - the integer vector describing the state;

insert_producs

public void insert_producs(int[] state)
Perform insertion of the products in the state vector given as parameter.

Parameters:
state - the integer vector describing the state;

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a string representation of this reaction