Program: 37768
Project: 37768
Buggy source:
public Boolean doDevelop(Generation gen,Organism o){
  StructureOrg s=(StructureOrg)o;
  Structures g=(Structures)gen;
  GAParameters params=GAParameters.getParams();
  double minid=params.getMinInteratomicDistance();
  double maxll=params.getMaxLatticeLength();
  double minll=params.getMinLatticeLength();
  double maxla=params.getMaxLatticeAngleDegrees();
  double minla=params.getMinLatticeAngleDegrees();
  int maxatoms=params.getMaxNumAtoms();
  int minatoms=params.getMinNumAtoms();
  if (s.getCell() == null) {
    GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
    return false;
  }
  if (s.knowsValue() && Double.isNaN(s.getEnergyPerAtom())) {
    GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
    return false;
  }
  if (s.getCell().isMalformed()) {
    GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
    return false;
  }
  if (params.usingSubstrate()) {
    Cell oldCell=s.getCell();
    List<Vect> newBasis=params.getSubstrate().getLatticeVectors();
    List<Site> newSites=new ArrayList<Site>();
    for (    Site site : oldCell.getSites()) {
      site.getCoords().changeBasis(newBasis);
      newSites.add(site);
    }
    s.setCell(new Cell(newBasis,newSites,oldCell.getLabel()));
  }
  if (minid != -1) {
    if (!s.getCell().satisfiesMinInteratomicDistance(minid)) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
      return false;
    }
  }
  if (!s.getCell().satisfiesPerSpeciesMIDs(params.getPerSpeciesMIDs())) {
    GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
    return false;
  }
  if (useNiggliReducedCell) {
    s.standardize();
    if (!s.isReduced()) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
      return false;
    }
  }
  if (use2DNiggliReducedCell) {
    s.standardize2D();
    if (!s.isReduced()) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
      return false;
    }
  }
  Cell structure=s.getCell();
  if (minatoms != -1 && structure.getNumSites() < minatoms) {
    GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str"+ structure.getNumSites()+ "String_Node_Str",GAOut.NOTICE,s.getID());
    return false;
  }
  if (maxatoms != -1 && structure.getNumSites() > maxatoms) {
    GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str"+ structure.getNumSites()+ "String_Node_Str",GAOut.NOTICE,s.getID());
    return false;
  }
  if (structure.getComposition().getNumElements() < params.getMinNumSpecies() && GAParameters.getParams().getRecord().getGenNum() != 0) {
    GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str"+ params.getMinNumSpecies()+ "String_Node_Str"+ structure.getComposition().toString()+ "String_Node_Str",GAOut.NOTICE,s.getID());
    return false;
  }
  if (Double.isInfinite(s.getEnergyPerAtom())) {
    GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
    return false;
  }
  if (params.getDoNonnegativityConstraint()) {
    if (s.knowsValue() && s.getValue() >= 0) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str"+ s.getValue()+ "String_Node_Str",GAOut.NOTICE,s.getID());
      return false;
    }
  }
  if (params.getOptimizeDensity() && !s.knowsValue() && GAParameters.getParams().getRecord().getGenNum() != 0) {
    double volume=GAParameters.getParams().getRecord().getBestDensityEstimate() * s.getCell().getNumSites();
    s.setCell(s.getCell().scaleTo(volume));
  }
  double[] lLengths=structure.getCellLengths();
  for (int i=0; i <= 2; i++) {
    if (minll != -1 && lLengths[i] < minll) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str"+ i+ "String_Node_Str"+ lLengths[i]+ "String_Node_Str",GAOut.NOTICE,s.getID());
      return false;
    }
    if (maxll != -1 && lLengths[i] > maxll) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str"+ i+ "String_Node_Str"+ lLengths[i]+ "String_Node_Str",GAOut.NOTICE,s.getID());
      return false;
    }
  }
  double[] lAngles=structure.getCellAnglesDegrees();
  for (int i=0; i <= 2; i++) {
    if (minla != -1 && lAngles[i] < minla) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str"+ i+ "String_Node_Str"+ lAngles[i]+ "String_Node_Str",GAOut.NOTICE,s.getID());
      return false;
    }
    if (maxla != -1 && lAngles[i] > maxla) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str"+ i+ "String_Node_Str"+ lAngles[i]+ "String_Node_Str",GAOut.NOTICE,s.getID());
      return false;
    }
  }
  if (structure.getHeight() > GAParameters.getParams().getMaxCellHeight()) {
    GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
    return false;
  }
  if (!params.getCompSpace().contains(s.getCell().getComposition())) {
    GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
    return false;
  }
  if (params.getMaxNearestNeighborLength() != 0) {
    List<Set<String>> excludedPairs=params.getNotNearestNeighbors();
    if (excludedPairs != null) {
      List<Site> sites=structure.getSites();
      for (int i=0; i < sites.size(); i++) {
        String symbol=sites.get(i).getElement().getSymbol();
        String otherSymb=null;
        for (        Set<String> pair : excludedPairs) {
          Iterator<String> k=pair.iterator();
          String first=k.next();
          String second=k.next();
          if (symbol == first)           otherSymb=second;
 else           if (symbol == second)           otherSymb=first;
 else           continue;
        }
        if (otherSymb == null)         continue;
        List<Site> atomsInSphere=structure.getAtomsInSphereSorted(sites.get(i).getCoords(),params.getMaxNearestNeighborLength());
        if (atomsInSphere.size() < 2)         continue;
        String nearestNeighbor=atomsInSphere.get(1).getElement().getSymbol();
        if (otherSymb.equalsIgnoreCase(nearestNeighbor)) {
          GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
          return false;
        }
      }
    }
  }
  if (usePerGenRG) {
    Integer orgID=g.getRedundancyGuard().checkStructureOrg(s);
    if (orgID != null) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str"+ orgID+ "String_Node_Str",GAOut.NOTICE,s.getID());
      Organism org=g.getOrgByID(orgID);
      if (org != null && s.knowsValue() && s.getValue() < org.getValue()) {
        g.removeOrganism(org);
        g.addOrganism(s);
        GAOut.out().stdout("String_Node_Str" + orgID + "String_Node_Str"+ s.getID(),GAOut.INFO,s.getID());
      }
      return false;
    }
  }
  if (useWholePopRG && !s.knowsValue()) {
    Integer orgID=rGuard.checkStructureOrg(s);
    if (orgID != null) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str"+ orgID+ "String_Node_Str",GAOut.NOTICE,s.getID());
      return false;
    }
  }
  double dValue=params.getDValue();
  if (dValue != 0)   if (o.knowsValue()) {
    Organism[] orgs=g.getOrganismsOfValue(o.getValue(),dValue);
    if (orgs.length >= 1) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
      if (o.getValue() < orgs[0].getValue()) {
        g.removeOrganism(orgs[0]);
        g.addOrganism(o);
        GAOut.out().stdout("String_Node_Str" + orgs[0].getID() + "String_Node_Str"+ o.getID(),GAOut.INFO,s.getID());
      }
      return false;
    }
  }
  if (s.knowsValue() && params.usingSurrogateModel()) {
    surrogate.addEntry(s);
    if (surrogate.fails(s))     return false;
  }
  if (useWholePopRG)   rGuard.addStructureOrg(s);
  return true;
}

Fixed version (ground truth):
public Boolean doDevelop(Generation gen,Organism o){
  StructureOrg s=(StructureOrg)o;
  Structures g=(Structures)gen;
  GAParameters params=GAParameters.getParams();
  double minid=params.getMinInteratomicDistance();
  double maxll=params.getMaxLatticeLength();
  double minll=params.getMinLatticeLength();
  double maxla=params.getMaxLatticeAngleDegrees();
  double minla=params.getMinLatticeAngleDegrees();
  int maxatoms=params.getMaxNumAtoms();
  int minatoms=params.getMinNumAtoms();
  if (s.getCell() == null) {
    GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
    return false;
  }
  if (s.knowsValue() && Double.isNaN(s.getEnergyPerAtom())) {
    GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
    return false;
  }
  if (s.getCell().isMalformed()) {
    GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
    return false;
  }
  if (params.usingSubstrate()) {
    Cell oldCell=s.getCell();
    Cell substrate=params.getSubstrate();
    List<Vect> newBasis=new ArrayList<Vect>();
    newBasis.add(substrate.getLatticeVectors().get(0));
    newBasis.add(substrate.getLatticeVectors().get(1));
    newBasis.add(oldCell.getLatticeVectors().get(2));
    List<Site> newSites=new ArrayList<Site>();
    for (    Site site : oldCell.getSites()) {
      Vect v=site.getCoords().changeBasis(newBasis);
      newSites.add(new Site(site.getElement(),v));
    }
    Cell newCell=new Cell(newBasis,newSites,oldCell.getLabel());
    s.setCell(newCell);
  }
  if (minid != -1) {
    if (!s.getCell().satisfiesMinInteratomicDistance(minid)) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
      return false;
    }
  }
  if (!s.getCell().satisfiesPerSpeciesMIDs(params.getPerSpeciesMIDs())) {
    GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
    return false;
  }
  if (useNiggliReducedCell) {
    s.standardize();
    if (!s.isReduced()) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
      return false;
    }
  }
  if (use2DNiggliReducedCell) {
    s.standardize2D();
    if (!s.isReduced()) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
      return false;
    }
  }
  Cell structure=s.getCell();
  if (minatoms != -1 && structure.getNumSites() < minatoms) {
    GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str"+ structure.getNumSites()+ "String_Node_Str",GAOut.NOTICE,s.getID());
    return false;
  }
  if (maxatoms != -1 && structure.getNumSites() > maxatoms) {
    GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str"+ structure.getNumSites()+ "String_Node_Str",GAOut.NOTICE,s.getID());
    return false;
  }
  if (structure.getComposition().getNumElements() < params.getMinNumSpecies() && GAParameters.getParams().getRecord().getGenNum() != 0) {
    GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str"+ params.getMinNumSpecies()+ "String_Node_Str"+ structure.getComposition().toString()+ "String_Node_Str",GAOut.NOTICE,s.getID());
    return false;
  }
  if (Double.isInfinite(s.getEnergyPerAtom())) {
    GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
    return false;
  }
  if (params.getDoNonnegativityConstraint()) {
    if (s.knowsValue() && s.getValue() >= 0) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str"+ s.getValue()+ "String_Node_Str",GAOut.NOTICE,s.getID());
      return false;
    }
  }
  if (params.getOptimizeDensity() && !s.knowsValue() && GAParameters.getParams().getRecord().getGenNum() != 0) {
    double volume=GAParameters.getParams().getRecord().getBestDensityEstimate() * s.getCell().getNumSites();
    s.setCell(s.getCell().scaleTo(volume));
  }
  double[] lLengths=structure.getCellLengths();
  for (int i=0; i <= 2; i++) {
    if (minll != -1 && lLengths[i] < minll) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str"+ i+ "String_Node_Str"+ lLengths[i]+ "String_Node_Str",GAOut.NOTICE,s.getID());
      return false;
    }
    if (maxll != -1 && lLengths[i] > maxll) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str"+ i+ "String_Node_Str"+ lLengths[i]+ "String_Node_Str",GAOut.NOTICE,s.getID());
      return false;
    }
  }
  double[] lAngles=structure.getCellAnglesDegrees();
  for (int i=0; i <= 2; i++) {
    if (minla != -1 && lAngles[i] < minla) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str"+ i+ "String_Node_Str"+ lAngles[i]+ "String_Node_Str",GAOut.NOTICE,s.getID());
      return false;
    }
    if (maxla != -1 && lAngles[i] > maxla) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str"+ i+ "String_Node_Str"+ lAngles[i]+ "String_Node_Str",GAOut.NOTICE,s.getID());
      return false;
    }
  }
  if (structure.getHeight() > GAParameters.getParams().getMaxCellHeight()) {
    GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
    return false;
  }
  if (!params.getCompSpace().contains(s.getCell().getComposition())) {
    GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
    return false;
  }
  if (params.getMaxNearestNeighborLength() != 0) {
    List<Set<String>> excludedPairs=params.getNotNearestNeighbors();
    if (excludedPairs != null) {
      List<Site> sites=structure.getSites();
      for (int i=0; i < sites.size(); i++) {
        String symbol=sites.get(i).getElement().getSymbol();
        String otherSymb=null;
        for (        Set<String> pair : excludedPairs) {
          Iterator<String> k=pair.iterator();
          String first=k.next();
          String second=k.next();
          if (symbol == first)           otherSymb=second;
 else           if (symbol == second)           otherSymb=first;
 else           continue;
        }
        if (otherSymb == null)         continue;
        List<Site> atomsInSphere=structure.getAtomsInSphereSorted(sites.get(i).getCoords(),params.getMaxNearestNeighborLength());
        if (atomsInSphere.size() < 2)         continue;
        String nearestNeighbor=atomsInSphere.get(1).getElement().getSymbol();
        if (otherSymb.equalsIgnoreCase(nearestNeighbor)) {
          GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
          return false;
        }
      }
    }
  }
  if (usePerGenRG) {
    Integer orgID=g.getRedundancyGuard().checkStructureOrg(s);
    if (orgID != null) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str"+ orgID+ "String_Node_Str",GAOut.NOTICE,s.getID());
      Organism org=g.getOrgByID(orgID);
      if (org != null && s.knowsValue() && s.getValue() < org.getValue()) {
        g.removeOrganism(org);
        g.addOrganism(s);
        GAOut.out().stdout("String_Node_Str" + orgID + "String_Node_Str"+ s.getID(),GAOut.INFO,s.getID());
      }
      return false;
    }
  }
  if (useWholePopRG && !s.knowsValue()) {
    Integer orgID=rGuard.checkStructureOrg(s);
    if (orgID != null) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str"+ orgID+ "String_Node_Str",GAOut.NOTICE,s.getID());
      return false;
    }
  }
  double dValue=params.getDValue();
  if (dValue != 0)   if (o.knowsValue()) {
    Organism[] orgs=g.getOrganismsOfValue(o.getValue(),dValue);
    if (orgs.length >= 1) {
      GAOut.out().stdout("String_Node_Str" + s.getID() + "String_Node_Str",GAOut.NOTICE,s.getID());
      if (o.getValue() < orgs[0].getValue()) {
        g.removeOrganism(orgs[0]);
        g.addOrganism(o);
        GAOut.out().stdout("String_Node_Str" + orgs[0].getID() + "String_Node_Str"+ o.getID(),GAOut.INFO,s.getID());
      }
      return false;
    }
  }
  if (s.knowsValue() && params.usingSurrogateModel()) {
    surrogate.addEntry(s);
    if (surrogate.fails(s))     return false;
  }
  if (useWholePopRG)   rGuard.addStructureOrg(s);
  return true;
}