@Override public boolean check(ValidationContext ctx, Compartment c) { /* * Invalid use of the 'size' attribute for a * zero-dimensional compartment */ if (c.getSpatialDimensions() == 0 && c.isSetSize()) { return false; } return true; } };
if (isSetSize()) { attributes.put("size", StringTools.toString(en, getSize()));
if (compartment.isSetSize()) { concept.createAttribute(sizeA, compartment.getSize(), false);
if (compartment.isSetSize()) { concept.createAttribute(sizeA, compartment.getSize(), false);
@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; } };