use of org.vcell.util.Issue in project vcell by virtualcell.
the class StructureMapping method gatherIssues.
/**
* Insert the method's description here.
* Creation date: (11/1/2005 9:57:23 AM)
* @param issueVector java.util.Vector
*/
public void gatherIssues(IssueContext issueContext, List<Issue> issueVector) {
// size parameter must be set to non zero value for new ode, and all stoch simulations.
if (simulationContext != null) {
Parameter sizeParam = null;
if (simulationContext.getGeometry().getDimension() == 0) {
sizeParam = getSizeParameter();
} else {
sizeParam = getUnitSizeParameter();
}
if (sizeParam != null) {
if (sizeParam.getExpression() == null) {
if (!simulationContext.getGeometryContext().isAllVolFracAndSurfVolSpecified()) {
issueVector.add(new Issue(this, issueContext, IssueCategory.StructureMappingSizeParameterNotSet, "Size parameter is not set.", Issue.SEVERITY_ERROR));
}
} else {
try {
double val = sizeParam.getExpression().evaluateConstant();
if (val <= 0) {
issueVector.add(new Issue(this, issueContext, IssueCategory.StructureMappingSizeParameterNotPositive, "Size parameter is not positive.", Issue.SEVERITY_ERROR));
}
} catch (ExpressionException e) {
e.printStackTrace();
issueVector.add(new Issue(this, issueContext, IssueCategory.StructureMappingSizeParameterNotConstant, "Size parameter is not a constant.", Issue.SEVERITY_ERROR));
}
}
}
}
//
for (int i = 0; fieldParameters != null && i < fieldParameters.length; i++) {
RealInterval simpleBounds = parameterBounds[fieldParameters[i].getRole()];
if (simpleBounds != null) {
String parmName = fieldParameters[i].getNameScope().getName() + "." + fieldParameters[i].getName();
issueVector.add(new SimpleBoundsIssue(fieldParameters[i], issueContext, simpleBounds, "parameter " + parmName + ": must be within " + simpleBounds.toString()));
}
}
if (geometryClass == null) {
issueVector.add(new Issue(this, issueContext, IssueCategory.StructureNotMapped, getStructure().getTypeName() + " " + getStructure().getName() + " is not mapped to a geometry subdomain.", Issue.SEVERITY_WARNING));
}
if (geometryClass != null && simulationContext.getGeometryContext().getGeometry().getDimension() > 0) {
detectMappingConflictIssues(issueContext, issueVector, this);
}
}
use of org.vcell.util.Issue in project vcell by virtualcell.
the class VolumeRegionObject method gatherIssues.
@Override
public void gatherIssues(IssueContext issueContext, List<Issue> issueList) {
if (simulationContext.getGeometry().getGeometrySurfaceDescription() != null && simulationContext.getGeometry().getGeometrySurfaceDescription().getGeometricRegions() != null) {
GeometricRegion[] regions = simulationContext.getGeometry().getGeometrySurfaceDescription().getGeometricRegions();
boolean bFound = false;
for (GeometricRegion region : regions) {
if (region instanceof VolumeGeometricRegion) {
VolumeGeometricRegion vr = (VolumeGeometricRegion) region;
if (getSubVolume() == vr.getSubVolume() && getRegionID() == vr.getRegionID()) {
bFound = true;
break;
}
}
}
if (!bFound) {
issueList.add(new Issue(this, issueContext, IssueCategory.Identifiers, "geometry missing volume region (subvolume " + subVolume.getName() + " region " + regionID + ")", Issue.Severity.ERROR));
}
}
}
use of org.vcell.util.Issue in project vcell by virtualcell.
the class BioEvent method gatherIssues.
public void gatherIssues(IssueContext issueContext, List<Issue> issueList) {
// check all event assignment symbols
if (eventAssignmentList != null) {
for (EventAssignment ea : eventAssignmentList) {
// the target of the event assignment
SymbolTableEntry ste = simulationContext.getEntry(ea.getTarget().getName());
// SymbolTableEntry ste = parameterContext.getEntry(ea.getTarget().getName());
if (ste == null) {
String msg = "Missing Parameter '" + ea.getTarget().getName() + "' used in BioEvent '" + name + "'.";
String tip = "Remove the Action containing the missing parameter from the BioEvent '" + name + "'.";
issueList.add(new Issue(this, issueContext, IssueCategory.Identifiers, msg, tip, Issue.Severity.ERROR));
// found one issue on this event assignment, we show it and go to next
break;
}
// the expression of the event assignment
Expression exp = ea.assignmentExpression;
String[] symbols = exp.getSymbols();
if (symbols != null) {
boolean found = false;
for (String symbol : symbols) {
ste = simulationContext.getEntry(symbol);
if (ste == null) {
String msg = "Missing Symbol '" + symbol + "' in Assignment Expression for BioEvent '" + name + "'.";
String tip = "Remove the Action containing the missing Symbol from the Assignment Expression of the BioEvent '" + name + "'.";
issueList.add(new Issue(this, issueContext, IssueCategory.Identifiers, msg, tip, Issue.Severity.ERROR));
found = true;
break;
}
}
if (found == true) {
// found one issue on this event assignment, we show it and go to next
break;
}
}
}
} else {
String msg = "No Action assigned to BioEvent '" + name + "'.";
String tip = "Please assign an Action to the BioEvent '" + name + "'.";
issueList.add(new Issue(this, issueContext, IssueCategory.Identifiers, msg, tip, Issue.Severity.WARNING));
}
// check all trigger condition symbols
for (LocalParameter lp : getEventParameters()) {
if (lp.getExpression() != null && lp.getExpression().getSymbols() != null) {
String[] symbols = lp.getExpression().getSymbols();
boolean found = false;
for (String symbol : symbols) {
SymbolTableEntry ste = simulationContext.getEntry(symbol);
if (ste == null) {
String msg = "Missing Symbol '" + symbol + "' in the Trigger Condition for BioEvent '" + name + "'.";
String tip = "Remove the Action containing the missing Symbol from the Trigger Condition of the BioEvent '" + name + "'.";
issueList.add(new Issue(this, issueContext, IssueCategory.Identifiers, msg, tip, Issue.Severity.ERROR));
found = true;
break;
}
}
if (found == true) {
// found one issue with a parameter on this trigger condition, we show it and stop
break;
}
}
}
}
use of org.vcell.util.Issue in project vcell by virtualcell.
the class GHKKinetics method gatherIssues.
/**
* Insert the method's description here.
* Creation date: (5/12/2004 3:11:16 PM)
* @return cbit.util.Issue[]
*/
@Override
public void gatherIssues(IssueContext issueContext, List<Issue> issueList) {
super.gatherIssues(issueContext, issueList);
//
// check for correct number of reactants and products
//
int reactantCount = 0;
int productCount = 0;
ReactionParticipant[] reactionParticipants = getReactionStep().getReactionParticipants();
for (int i = 0; i < reactionParticipants.length; i++) {
if (reactionParticipants[i] instanceof Product) {
reactantCount++;
}
if (reactionParticipants[i] instanceof Reactant) {
productCount++;
}
}
if (reactantCount != 1) {
issueList.add(new Issue(getReactionStep(), issueContext, IssueCategory.KineticsApplicability, "GHK Kinetics must have exactly one reactant", Issue.SEVERITY_ERROR));
}
if (productCount != 1) {
issueList.add(new Issue(getReactionStep(), issueContext, IssueCategory.KineticsApplicability, "GHK Kinetics must have exactly one product", Issue.SEVERITY_WARNING));
}
}
use of org.vcell.util.Issue in project vcell by virtualcell.
the class GeneralPermeabilityKinetics method gatherIssues.
/**
* Insert the method's description here.
* Creation date: (5/12/2004 3:26:54 PM)
* @return cbit.util.Issue[]
*/
@Override
public void gatherIssues(IssueContext issueContext, List<Issue> issueList) {
super.gatherIssues(issueContext, issueList);
//
// check for correct number of reactants and products
//
int reactantCount = 0;
int productCount = 0;
ReactionParticipant[] reactionParticipants = getReactionStep().getReactionParticipants();
for (int i = 0; i < reactionParticipants.length; i++) {
if (reactionParticipants[i] instanceof Product) {
reactantCount++;
}
if (reactionParticipants[i] instanceof Reactant) {
productCount++;
}
}
if (reactantCount != 1) {
issueList.add(new Issue(getReactionStep(), issueContext, IssueCategory.KineticsApplicability, "GeneralPermeability Kinetics must have exactly one reactant", Issue.SEVERITY_ERROR));
}
if (productCount != 1) {
issueList.add(new Issue(getReactionStep(), issueContext, IssueCategory.KineticsApplicability, "GeneralPermeability Kinetics must have exactly one product", Issue.SEVERITY_WARNING));
}
}
Aggregations