Skip to content

Commit

Permalink
Add additional doc for different SelectionTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiri Choi committed Sep 30, 2017
1 parent 73e97d6 commit 1554ef3
Showing 1 changed file with 143 additions and 31 deletions.
174 changes: 143 additions & 31 deletions source/rrSelectionRecord.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,182 +18,294 @@ class RR_DECLSPEC SelectionRecord
enum SelectionType
{
/**
* Selects time
* SelectionType for time.
*/
TIME = (0x1 << 0), // => 0x00000001,

/**
* species must have either a CONCENTRATION or AMOUNT
* SelectionType for concentrations. Species must have either a CONCENTRATION or AMOUNT
* modifer to distinguish it.
*/
CONCENTRATION = (0x1 << 1),

/**
* SelectionType for amounts. Species must have either a CONCENTRATION or AMOUNT
* modifer to distinguish it.
*/
AMOUNT = (0x1 << 2),

/**
* SelectionType for rates.
*/
RATE = (0x1 << 3),

/**
* species must have either a BOUNDARY or FLOATING
* SelectionType for bounary species. Species must have either a BOUNDARY or FLOATING
* modifiers.
*/
BOUNDARY = (0x1 << 4),
/**
* SelectionType for floating species. Species must have either a BOUNDARY or FLOATING
* modifiers.
*/
FLOATING = (0x1 << 5),

/**
* Compartments and parameters can be either current
* SelectionType for comparments. Compartments and parameters can be either current
* or initial values. These values with and underscore, '_'
* are intended to be used with either an CURRENT or
* INITIAL value modifier.
*/
_COMPARTMENT = (0x1 << 6),
_GLOBAL_PARAMETER = (0x1 << 7),

/**
* SelectionType for global parameters. Compartments and parameters can be either current
* or initial values. These values with and underscore, '_'
* are intended to be used with either an CURRENT or
* INITIAL value modifier.
*/
_GLOBAL_PARAMETER = (0x1 << 7),

/**
* SelectionType for reactions.
*/
REACTION = (0x1 << 8),

/**
* sbml elements can be accessed as either a initial value, or
* SelectionType for initial values. SBML elements can be accessed as either a initial value, or
* a current value, they must have one or the other.
*/
INITIAL = (0x1 << 9),

/**
* SelectionType for current values. SBML elements can be accessed as either a initial value, or
* a current value, they must have one or the other.
*/
CURRENT = (0x1 << 10),

/**
* SelectionType for unscaled values.
*/
UNSCALED = (0x1 << 11),

/**
* SelectionType for elasticities.
*/
ELASTICITY = (0x1 << 12),

/**
* SelectionType for control coefficients.
*/
CONTROL = (0x1 << 13),

/**
* eigenvalue without complex is real part of eigenvalue.
* SelectionType for eigenvalues. Eigenvalue without complex is real part of eigenvalue.
*/
EIGENVALUE = (0x1 << 14),

/**
* SelectionType for elements. (Unused)
*/
ELEMENT = (0x1 << 15),

/**
* SelectionType for stoichiometries.
*/
STOICHIOMETRY = (0x1 << 16),

/**
* SelectionType for unknown values.
*/
UNKNOWN = (0x1 << 17),

/**
* SelectionType for dependent species.
*/
DEPENDENT = (0x1 << 18),

/**
* SelectionType for independent species.
*/
INDEPENDENT = (0x1 << 19),

/**
* SelectionType for conserved moieties.
*/
CONSERVED_MOIETY = (0x1 << 20),

/**
* SelectionType for state vectors.
*/
STATE_VECTOR = (0x1 << 21),

/**
* SelectionType for events.
*/
EVENT = (0x1 << 22),

/**
* the complex bit, off to get real values, on to get imaginary parts.
* SelectionType for complex values. The complex bit, off to get real values, on to get imaginary parts.
*
* Only used with EIGENVALUE currently.
*/
COMPLEX = (0x1 << 23),

/**
* complex eigenvalue
* SelectionType for complex eigenvalues.
*/
EIGENVALUE_COMPLEX = EIGENVALUE | COMPLEX,

/**
* SelectionType for unknown concentrations.
*/
UNKNOWN_CONCENTRATION = UNKNOWN | CONCENTRATION,

/**
* the current compartment value
* SelectionType for the current compartment value.
*/
COMPARTMENT = _COMPARTMENT | INDEPENDENT | DEPENDENT | CURRENT,

/**
* the current global parameter value
* SelectionType for the current global parameter value.
*/
GLOBAL_PARAMETER = _GLOBAL_PARAMETER | INDEPENDENT | DEPENDENT | CURRENT,

/**
* current amounts
* SelectionType for current floating species amounts.
*/
FLOATING_AMOUNT = FLOATING | AMOUNT | INDEPENDENT | DEPENDENT | CURRENT,

/**
* SelectionType for independent floating species amounts.
*/
INDEPENDENT_FLOATING_AMOUNT = FLOATING | AMOUNT | INDEPENDENT | CURRENT,

/**
* SelectionType for dependent floating species amounts. (Unused)
*/
DEPENDENT_FLOATING_AMOUNT = FLOATING | AMOUNT | DEPENDENT | CURRENT,

/**
* SelectionType for boundary species amounts.
*/
BOUNDARY_AMOUNT = BOUNDARY | AMOUNT | INDEPENDENT | DEPENDENT | CURRENT,

/**
* current concentrations
* SelectionType for current boundary species concentrations.
*/
BOUNDARY_CONCENTRATION = BOUNDARY | CONCENTRATION | INDEPENDENT | DEPENDENT | CURRENT,

/**
* SelectionType for current floating species concentrations.
*/
FLOATING_CONCENTRATION = FLOATING | CONCENTRATION | INDEPENDENT | DEPENDENT | CURRENT,

/**
* floating species value rates (value, not reaction rates),
* these are always current
* SelectionType for floating species amount rates (value, not reaction rates),
* these are always current.
*/
FLOATING_AMOUNT_RATE = FLOATING | RATE | DEPENDENT,

/**
* SelectionType for floating species concentration rates (value, not reaction rates),
* these are always current. (Unused)
*/
FLOATING_CONCENTRATION_RATE = FLOATING | CONCENTRATION | RATE | DEPENDENT,


/**
* SelectionType for global parameter rates.
*/
GLOBAL_PARAMETER_RATE = _GLOBAL_PARAMETER | RATE,

/**
* reaction rate, always current
* SelectionType for reaction rate, always current
*/
REACTION_RATE = REACTION | RATE | DEPENDENT,

/**
* initial species values
* SelectionType for initial species amounts.
*/
INITIAL_AMOUNT = INITIAL | AMOUNT | INDEPENDENT | DEPENDENT,
INITIAL_FLOATING_AMOUNT = INITIAL | FLOATING | AMOUNT | INDEPENDENT | DEPENDENT,

/**
* SelectionType for initial floating species amounts.
*/
INITIAL_FLOATING_AMOUNT = INITIAL | FLOATING | AMOUNT | INDEPENDENT | DEPENDENT,

/**
* SelectionType for initial species concentrations.
*/
INITIAL_CONCENTRATION = INITIAL | CONCENTRATION | INDEPENDENT | DEPENDENT,
INITIAL_FLOATING_CONCENTRATION = INITIAL | FLOATING | CONCENTRATION | INDEPENDENT | DEPENDENT,

/**
* SelectionType for initial floating species concentrations.
*/
INITIAL_FLOATING_CONCENTRATION = INITIAL | FLOATING | CONCENTRATION | INDEPENDENT | DEPENDENT,

/**
* SelectionType for initial compartment values.
*/
INITIAL_COMPARTMENT = INITIAL | _COMPARTMENT | INDEPENDENT | DEPENDENT,

/**
* SelectionType for initial global parameter values.
*/
INITIAL_GLOBAL_PARAMETER = INITIAL | _GLOBAL_PARAMETER | INDEPENDENT | DEPENDENT,


/**
* Selects global parameters that have initial assignment rules.
* SelectionType for global parameters that have initial assignment rules.
*/
DEPENDENT_INITIAL_GLOBAL_PARAMETER = INITIAL | _GLOBAL_PARAMETER | DEPENDENT,

/**
* Selects unscaled elasticity.
* SelectionType for unscaled elasticity.
*/
UNSCALED_ELASTICITY = UNSCALED | ELASTICITY,

/**
* Selects unscaled control coefficient.
* SelectionType for unscaled control coefficient.
*/
UNSCALED_CONTROL = UNSCALED | CONTROL,

/**
* Selects unscaled control coefficient.
* SelectionType for unscaled control coefficient.
*/
UNKNOWN_ELEMENT = UNKNOWN | ELEMENT,

/**
* Selects everything.
* SelectionType for everything.
*/
ALL = (0xffffffff),

/**
* Selects all values related to independent species.
* SelectionType for all values related to independent species. (Unused)
*/
ALL_INDEPENDENT = ~DEPENDENT,

/**
* Selects all values related to dependent species.
* SelectionType for all values related to dependent species. (Unused)
*/
ALL_DEPENDENT = ~INDEPENDENT,

/**
* Selects all independent species amount.
* SelectionType for all independent species amount. (Unused)
*/
ALL_INDEPENDENT_AMOUNT = ~DEPENDENT & ~CONCENTRATION,

/**
* Selects all dependent species amount.
* SelectionType for all dependent species amount. (Unused)
*/
ALL_DEPENDENT_AMOUNT = ~INDEPENDENT & ~CONCENTRATION,

/**
* Selects all independent species concentration.
* SelectionType for all independent species concentration. (Unused)
*/
ALL_INDEPENDENT_CONCENTRATION = ~DEPENDENT & ~AMOUNT,

/**
* Selects all dependent species concentration.
* SelectionType for all dependent species concentration. (Unused)
*/
ALL_DEPENDENT_CONCENTRATION = ~INDEPENDENT & ~AMOUNT,

Expand All @@ -205,7 +317,7 @@ class RR_DECLSPEC SelectionRecord
* Note, any sbml variable can be defined by a rule, the model state
* is defined as the set of variabls that define the current state of the
* model. These do not include the initial values as the initial values
* can not be changed by advancing the model with the integrator.
* can not be changed by advancing the model with the integrator. (Unused)
*/
MODEL_STATE = ALL_INDEPENDENT_AMOUNT & ~INITIAL,

Expand Down

6 comments on commit 1554ef3

@0u812
Copy link
Member

@0u812 0u812 commented on 1554ef3 Sep 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The failing tests are the RK4 & RK45 integrators. They seem to fail randomly. @kirichoi do you know what might be causing this?

<test suite="TEST_MODEL" name="CHECK_RK4_OUTPUT" time="0"><failure message="Suite_TestModel.cpp(1136) : Unhandled exception: Crash!"/></test>

<test suite="TEST_MODEL" name="CHECK_RK45_OUTPUT" time="0"><failure message="Suite_TestModel.cpp(1168) : Unhandled exception: Crash!"/></test>

@0u812
Copy link
Member

@0u812 0u812 commented on 1554ef3 Sep 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fyi I restarted the build to see if they're random.

@kirichoi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I did fixed this issue as part of pull request #416 which haven't merged yet. In particular, commit 300de2d fixes it. That particular pull request got all over the place with different branches actually. What would you like me to do? I can selectively push that fix and re-issue a new pull request for fixing issue #411.

@0u812
Copy link
Member

@0u812 0u812 commented on 1554ef3 Sep 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just merge your PR 😄

@kirichoi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It failed and fixed again. Not sure what's going on anymore 😨

@0u812
Copy link
Member

@0u812 0u812 commented on 1554ef3 Sep 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the SBML tests is designed to fail spuriously once in a while. I wouldn't worry about it.

Please sign in to comment.