use of cbit.vcell.model.Reactant in project vcell by virtualcell.
the class ReactionSpec method gatherIssues.
/**
* Insert the method's description here.
* Creation date: (11/1/2005 10:06:04 AM)
* @param issueList java.util.Vector
*/
public void gatherIssues(IssueContext issueContext, List<Issue> issueList, ReactionContext rc) {
ReactionCombo r = new ReactionCombo(this, rc);
ReactionStep step = getReactionStep();
if (!isExcluded() && rc.getSimulationContext().isStoch() && (rc.getSimulationContext().getGeometry().getDimension() > 0)) {
boolean haveParticle = false;
boolean haveContinuous = false;
for (ReactionParticipant p : step.getReactionParticipants()) {
if (p instanceof Product || p instanceof Reactant) {
SpeciesContextSpec candidate = rc.getSpeciesContextSpec(p.getSpeciesContext());
if (candidate.isForceContinuous() && !candidate.isConstant()) {
haveParticle = true;
} else if (!candidate.isForceContinuous() && !candidate.isConstant()) {
haveContinuous = true;
}
}
}
if (haveParticle && haveContinuous) {
String msg = "Reaction " + step.getName() + " has both continuous and particle Participants.";
String tip = "Mass conservation for reactions of binding between discrete and continuous species is handled approximately. <br>" + "To avoid any algorithmic approximation, which may produce undesired results, the user is advised to indicate <br>" + "the continuous species in those reactions as modifiers (i.e. 'catalysts') in the physiology.";
issueList.add(new Issue(r, issueContext, IssueCategory.Identifiers, msg, tip, Issue.SEVERITY_WARNING));
}
}
}
use of cbit.vcell.model.Reactant in project vcell by virtualcell.
the class ReactPartTable method getReactionParticipant.
/**
* This method was created in VisualAge.
* @return cbit.vcell.model.ReactionParticipant
* @param rset java.sql.ResultSet
*/
public ReactionParticipant getReactionParticipant(KeyValue rpKey, java.sql.ResultSet rset) throws java.sql.SQLException, DataAccessException {
ReactionParticipant rp = null;
KeyValue key = rpKey;
String role = rset.getString(ReactPartTable.table.role.toString());
int stoichiometry = rset.getInt(ReactPartTable.table.stoich.toString());
if (role.equals(ROLE_CATALYST)) {
rp = new Catalyst(key, null, null);
} else if (role.equals(ROLE_PRODUCT)) {
rp = new Product(key, null, null, stoichiometry);
} else if (role.equals(ROLE_REACTANT)) {
rp = new Reactant(key, null, null, stoichiometry);
} else if (role.equals(ROLE_FLUX)) {
rp = new FluxReaction.Flux(key, null, null);
} else {
throw new DataAccessException("unexpected value of " + ReactPartTable.table.role.toString() + "'" + role + "'");
}
rp.setStoichiometry(stoichiometry);
return rp;
}
Aggregations