/** * Sets the outsideID of this compartment to the id of 'outside'. * * @param outside * @sbml.deprecated Level 3 Version 1 */ @Deprecated public void setOutside(Compartment outside) { setOutside(outside != null ? outside.getId() : null); }
/** * * @param id * @param name * @param compartment * @param fast * @param reversible * @return */ public Reaction buildReaction(String id, String name, Compartment compartment, boolean fast, boolean reversible) { return buildReaction(id, name, compartment != null ? compartment.getId() : null, fast, reversible); }
/** * Creates a new {@link QualitativeSpecies} inside this {@link QualModelPlugin} and returns it. * * @param id the id of the new element to create * @param compartment * @param constant * @return the {@link QualitativeSpecies} object created */ public QualitativeSpecies createQualitativeSpecies(String id, Compartment compartment, boolean constant) { return createQualitativeSpecies(id, compartment.getId(), constant); }
@Override public boolean setCompartment(Compartment compartment) { return setCompartment(compartment.getId()); }
@Override public boolean setCompartment(Compartment compartment) { return setCompartment(compartment != null ? compartment.getId() : null); }
@Override public <T> ASTNode2Value<String> compile(Compartment c) { return new ASTNode2Value<String>(c.getId(), this); }
@Override public boolean setCompartment(Compartment compartment) { return setCompartment(compartment.getId()); }
@Override public ASTNodeValue compile(Compartment c) { return new ASTNodeValue(c.getId(), this); }
/** * * @param id * @param name * @param compartment * @param hasOnlySubstanceUnits * @param boundaryCondition * @param constant * @param initialConcentration * @param substanceUnits * @return */ public Species buildSpecies(String id, String name, Compartment compartment, boolean hasOnlySubstanceUnits, boolean boundaryCondition, boolean constant, double initialConcentration, String substanceUnits) { return buildSpecies(id, name, compartment.getId(), hasOnlySubstanceUnits, boundaryCondition, constant, initialConcentration, substanceUnits); }
@Override public void setValue(double value) { double dim = getSpatialDimensions(); if (isReadingInProgress() || (dim > 0d) || Double.isNaN(dim)) { super.setValue(value); } else { throw new IllegalArgumentException(MessageFormat.format( resourceBundle.getString("Compartment.ERROR_MESSAGE_ZERO_DIM"), "size", getId())); } }
@Override public boolean setCompartment(Compartment compartment) { if (compartment != null) { return setCompartment(compartment.getId()); } return unsetCompartment(); }
@Override public boolean setCompartment(Compartment compartment) { if (compartment != null) { return setCompartment(compartment.getId()); } return unsetCompartment(); }
/** * Sets the {@link Unit} of this {@link Compartment}. * * @param unit * @throws IllegalArgumentException * if spatialDimensions = 0. */ @Override public void setUnits(Unit unit) { if (0d == getSpatialDimensions() && !isReadingInProgress()) { throw new IllegalArgumentException(MessageFormat.format( resourceBundle.getString("Compartment.ERROR_MESSAGE_ZERO_DIM"), "unit", getId())); } super.setUnits(unit); }
/** * Sets the unit of this Compartment. * A new Unit object will be created base on this kind. * * @param unitKind * @throws IllegalArgumentException * if spatialDimensions = 0. */ @Override public void setUnits(Unit.Kind unitKind) { if (0d == getSpatialDimensions() && !isReadingInProgress()) { throw new IllegalArgumentException(MessageFormat.format( resourceBundle.getString("Compartment.ERROR_MESSAGE_ZERO_DIM"), "unit kind", getId())); } super.setUnits(unitKind); }
@Override public boolean check(ValidationContext ctx, Compartment c) { if (c.isSetOutside() && c.getSpatialDimensions() == 0) { Compartment outside = c.getOutsideInstance(); if (outside != null && outside.getSpatialDimensions() != 0) { ValidationConstraint.logError(ctx, CORE_20506, c, c.getId(), outside.getId()); return false; } } return true; } };
throw new IllegalArgumentException(MessageFormat.format( resourceBundle.getString("Compartment.ERROR_MESSAGE_ZERO_DIM"), "units", getId()));
String compartmentId = c.getId();
@Override public boolean check(ValidationContext ctx, Compartment c) { if (c.isSetOutside() && (c.getOutsideInstance() == null)) { ValidationConstraint.logError(ctx, CORE_20504, c, c.getId(), c.getOutside()); return false; } return true; } };
@Override public boolean check(ValidationContext ctx, Compartment c) { if (c.isSetCompartmentType() && c.getCompartmentTypeInstance() == null) { ValidationConstraint.logError(ctx, CORE_20510, c, c.getId(), c.getCompartmentType()); return false; } return true; } };
@Override public boolean check(ValidationContext ctx, Compartment c) { Model m = c.getModel(); if (m != null && !c.isSetSize()) { if (c.isSetSpatialDimensions() && c.getSpatialDimensions() == 0) { return true; } if (ctx.getLevel() >= 3 && (!c.isSetSpatialDimensions())) { // There are no default for spatialDimensions in L3, so don't report this error if spatialDimensions is not set return true; } boolean sizeByAssignment = false; if (c.isSetId()) { sizeByAssignment = m.getInitialAssignmentBySymbol(c.getId()) != null; if (!sizeByAssignment) { Rule r = m.getRuleByVariable(c.getId()); sizeByAssignment = r != null && r.isAssignment(); } } return sizeByAssignment; } return true; } };