@Override public boolean check(ValidationContext ctx, Species s) { Compartment c = s.getCompartmentInstance(); if (c != null && c.getSpatialDimensions() == 0 && s.isSetInitialConcentration()) { ValidationConstraint.logError(ctx, CORE_20604, s, s.getId(), s.getCompartment()); return false; } return true; } };
for (int j = 0; (j < speciesIds.length) && !thisCompartmentSelected; j++) { Species species = model.getSpecies(speciesIds[j]); thisCompartmentSelected = species.getCompartment().equals(compartmentId);
@Override public boolean check(ValidationContext ctx, Species s) { /* * Invalid value found for Species 'compartment' attribute */ if (s.isSetCompartment() && s.getModel() != null && s.getCompartmentInstance() == null) { ValidationConstraint.logError(ctx, CORE_20601, s, s.getId(), s.getCompartment()); return false; } return true; } };
/** * Returns an id depending of the type of SBase given. If it is a {@link Reaction}, returns reaction.id, * if it is an {@link Assignment}, returns assignment.variable (symbol or variable attribute), if it is * a {@link Species}, returns species.compartment. For any other type of {@link SBase}, returns null. * * @param sb an {@link SBase} * @return an id depending of the type of SBase given. */ private String getRelatedId(SBase sb, boolean isCompartment) { if (sb instanceof Reaction) { return ((Reaction) sb).getId(); } else if (sb instanceof Assignment) { return ((Assignment) sb).getVariable(); } else if (sb instanceof Species && isCompartment) { return ((Species) sb).getCompartment(); } return null; }
@Override public boolean check(ValidationContext ctx, Species s) { if (s.getModel() != null) { Compartment c = s.getCompartmentInstance(); if (c != null && c.getSpatialDimensions() == 0 && s.isSetSpatialSizeUnits()) { ValidationConstraint.logError(ctx, CORE_20603, s, s.getId(), s.getCompartment()); return false; } } return true; } };
@Override public boolean check(ValidationContext ctx, Species s) { // TODO - change the way we report the error, to report the error per compartment, only once. // And we should be able to avoid a loop over the full listofSpecies for each species Model m = s.getModel(); if (s.isSetSpeciesType() && m != null) { String st = s.getSpeciesType(); for (Species spec: m.getListOfSpecies()) { // Are species in same compartment but not the same? if (spec.isSetSpeciesType() && spec.getCompartment().equals(s.getCompartment()) && !spec.getId().equals(s.getId())) { // Must have different Types if (spec.getSpeciesType().equals(st)) { return false; } } } } return true; } };
@Override public boolean check(ValidationContext ctx, Species s) { Compartment c = s.getCompartmentInstance(); boolean checkResult = true; if (c != null && c.getSpatialDimensions() == 3 && s.isSetSpatialSizeUnits()) { UnitDefinition def = s.getSpatialSizeUnitsInstance(); if (def == null) { checkResult = false; } boolean isVolume = checkResult && def.isVariantOfVolume(); if (checkResult && ctx.getLevel() == 2 && ctx.getLevel() == 1 && !isVolume) { checkResult = false; } if (checkResult && ctx.getLevel() >= 2 && (! (def.isVariantOfDimensionless() || isVolume))) { checkResult = false; } } if (!checkResult) { // report error ValidationConstraint.logError(ctx, CORE_20607, s, s.getId(), s.getCompartment(), s.getSpatialSizeUnits()); } return checkResult; } };
if ((species.getCompartment()).equals(compartmentsIds[j])) { thisSpeciesSelected = true; break;
Locale en = Locale.ENGLISH; if (isSetCompartment()) { attributes.put(TreeNodeChangeEvent.compartment, getCompartment());
@Override public int hashCode() { final int prime = 997; int hashCode = super.hashCode(); hashCode += prime * Boolean.valueOf(amount).hashCode(); if (isSetBoundaryCondition()) { hashCode += prime * boundaryCondition.hashCode(); } if (isSetHasOnlySubstanceUnits()) { hashCode += prime * hasOnlySubstanceUnits.hashCode(); } if (isSetCharge()) { hashCode += prime * charge.hashCode(); } if (isSetSpeciesType()) { hashCode += prime * getSpeciesType().hashCode(); } if (isSetCompartment()) { hashCode += prime * getCompartment().hashCode(); } if (isSetSpatialSizeUnits()) { hashCode += prime * getSpatialSizeUnits().hashCode(); } if (isSetConversionFactor()) { hashCode += prime * getConversionFactor().hashCode(); } return hashCode; }
@Override public boolean check(ValidationContext ctx, Species s) { Compartment c = s.getCompartmentInstance(); boolean checkResult = true; if (c != null && c.getSpatialDimensions() == 1 && s.isSetSpatialSizeUnits()) { UnitDefinition def = s.getSpatialSizeUnitsInstance(); if (def == null) { checkResult = false; } boolean isLength = checkResult && def.isVariantOfLength(); if (ctx.getLevel() == 2 && ctx.getLevel() == 1 && !isLength) { checkResult = false; } if (ctx.getLevel() >= 2 && (! (def.isVariantOfDimensionless() || isLength)) ) { checkResult = false; } } if (!checkResult) { // report error ValidationConstraint.logError(ctx, CORE_20605, s, s.getId(), s.getCompartment(), s.getSpatialSizeUnits()); } return checkResult; } };
/** * Creates a new {@link QualitativeSpecies} instance. * * <p> * Copy constructor that clones all values from the input {@code species} that * are also available in {@link QualitativeSpecies}. * </p> * <p> * You should consider setting a new id and meta_id afterwards to avoid * duplicate identifiers. * </p> * * @param species * the species to be used to initialize the new instance */ public QualitativeSpecies(Species species) { super(species); initDefaults(); if (species.isSetCompartment()) { compartment = species.getCompartment(); } if (species.isSetConstant()) { constant = species.getConstant(); } /* * initialLevel, maxLevel and listOfSymbolicValues are only for qual species. */ }
@Override public boolean check(ValidationContext ctx, Species s) { Compartment c = s.getCompartmentInstance(); boolean checkResult = true; if (c != null && c.getSpatialDimensions() == 2 && s.isSetSpatialSizeUnits()) { UnitDefinition def = s.getSpatialSizeUnitsInstance(); if (def == null) { checkResult = false; } boolean isArea = checkResult && def.isVariantOfArea(); if (ctx.getLevel() == 2 && ctx.getLevel() == 1 && !isArea) { checkResult = false; } if (ctx.getLevel() >= 2 && (! (def.isVariantOfDimensionless() || isArea))) { checkResult = false; } } if (!checkResult) { // report error ValidationConstraint.logError(ctx, CORE_20606, s, s.getId(), s.getCompartment(), s.getSpatialSizeUnits()); } return checkResult; } };
setCompartment(new String(species.getCompartment()));
final String cid = s.getCompartment();
logger.warn(MessageFormat.format( bundle.getString("SBMLCoreParser.unknownReferenceError1"), "Compartment", "compartmentID", species.getCompartment(), species.getElementName(), SBMLtools.getIdOrName(species)));
ONDEXConcept compC = compartmentsById.get(species.getCompartment()); if (compC != null) { graph.getFactory().createRelation(speciesC, compC, locatedIn, etSBML); } else { logFail("Failed to resolve compartment concept: " + species.getCompartment());
ONDEXConcept compC = compartmentsById.get(species.getCompartment()); if (compC != null) { graph.getFactory().createRelation(speciesC, compC, locatedIn, etSBML); } else { logFail("Failed to resolve compartment concept: " + species.getCompartment());
equals &= s.getCompartment().equals(getCompartment());