Search in sources :

Example 11 with Issue

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);
    }
}
Also used : SimpleBoundsIssue(cbit.vcell.model.SimpleBoundsIssue) Issue(org.vcell.util.Issue) SimpleBoundsIssue(cbit.vcell.model.SimpleBoundsIssue) Parameter(cbit.vcell.model.Parameter) RealInterval(net.sourceforge.interval.ia_math.RealInterval) ExpressionException(cbit.vcell.parser.ExpressionException)

Example 12 with Issue

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));
        }
    }
}
Also used : Issue(org.vcell.util.Issue) VolumeGeometricRegion(cbit.vcell.geometry.surface.VolumeGeometricRegion) GeometricRegion(cbit.vcell.geometry.surface.GeometricRegion) VolumeGeometricRegion(cbit.vcell.geometry.surface.VolumeGeometricRegion)

Example 13 with Issue

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;
            }
        }
    }
}
Also used : LocalParameter(cbit.vcell.mapping.ParameterContext.LocalParameter) SymbolTableEntry(cbit.vcell.parser.SymbolTableEntry) Issue(org.vcell.util.Issue) EventAssignment(cbit.vcell.mapping.BioEvent.EventAssignment) Expression(cbit.vcell.parser.Expression)

Example 14 with Issue

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));
    }
}
Also used : Issue(org.vcell.util.Issue)

Example 15 with Issue

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));
    }
}
Also used : Issue(org.vcell.util.Issue)

Aggregations

Issue (org.vcell.util.Issue)88 ArrayList (java.util.ArrayList)18 IssueContext (org.vcell.util.IssueContext)14 Expression (cbit.vcell.parser.Expression)13 ExpressionException (cbit.vcell.parser.ExpressionException)13 PropertyVetoException (java.beans.PropertyVetoException)9 MolecularType (org.vcell.model.rbm.MolecularType)9 Structure (cbit.vcell.model.Structure)8 VCUnitDefinition (cbit.vcell.units.VCUnitDefinition)8 SymbolTableEntry (cbit.vcell.parser.SymbolTableEntry)7 MolecularComponentPattern (org.vcell.model.rbm.MolecularComponentPattern)7 Model (cbit.vcell.model.Model)6 ModelParameter (cbit.vcell.model.Model.ModelParameter)6 ExpressionBindingException (cbit.vcell.parser.ExpressionBindingException)6 BioModel (cbit.vcell.biomodel.BioModel)5 ModelException (cbit.vcell.model.ModelException)5 Product (cbit.vcell.model.Product)5 Reactant (cbit.vcell.model.Reactant)5 ReactionParticipant (cbit.vcell.model.ReactionParticipant)5 InteriorPoint (org.sbml.jsbml.ext.spatial.InteriorPoint)5