Program: 19770
Project: 19770
Buggy source:
private String freeAgentsGrouping(){
  String chosenGroup="String_Node_Str";
  double currentHeuristic=0, previousHeuristic=0;
  double vectorDistance;
  double maxDistance=Math.sqrt(2);
  double economic, social, esFaction=0;
  double trustFaction=0;
  String bestPartner="String_Node_Str";
  for (  String trustee : getConn().getUngroupedAgents()) {
    if ((!this.getId().equals(trustee)) && (!invitationHolders.contains(trustee)) && (!groupFounders.contains(trustee))) {
      Double trustValue=this.getDataModel().getTrust(trustee);
      if (trustValue != null)       trustFaction=trustValue;
      economic=getConn().getAgentById(trustee).getEconomicBelief() - getDataModel().getEconomicBelief();
      social=getConn().getAgentById(trustee).getSocialBelief() - getDataModel().getSocialBelief();
      vectorDistance=Math.sqrt(Math.pow(economic,2) + Math.pow(social,2));
      esFaction=1 - (vectorDistance / maxDistance);
      currentHeuristic=0.5 * trustFaction + 0.5 * esFaction;
      if ((currentHeuristic > 0.75) && (previousHeuristic < currentHeuristic)) {
        bestPartner=trustee;
        previousHeuristic=currentHeuristic;
      }
    }
  }
  if (bestPartner.equals("String_Node_Str"))   return null;
 else {
    GroupDataInitialiser myGroup=new GroupDataInitialiser(this.uniformRandLong(),(this.getDataModel().getEconomicBelief() + getConn().getAgentById(bestPartner).getEconomicBelief()) / 2);
    Class<? extends AbstractGroupAgent> gtype=getConn().getAllowedGroupTypes().get(0);
    chosenGroup=getConn().createGroup(gtype,myGroup,bestPartner);
    groupFounders.add(this.getId());
    logger.log(Level.INFO,"String_Node_Str" + this.getConn().getAgentById(bestPartner).getName());
    logger.log(Level.INFO,"String_Node_Str" + previousHeuristic);
    logger.log(Level.INFO,"String_Node_Str" + this.getConn().getAgentById(bestPartner).getName());
    return chosenGroup;
  }
}

Fixed version (ground truth):
private String freeAgentsGrouping(){
  String chosenGroup="String_Node_Str";
  double currentHeuristic=0, previousHeuristic=0;
  double vectorDistance;
  double maxDistance=Math.sqrt(2);
  double economic, social, esFaction=0;
  double trustFaction=0;
  String bestPartner="String_Node_Str";
  for (  String trustee : getConn().getUngroupedAgents()) {
    if ((!this.getId().equals(trustee)) && (!invitationHolders.contains(trustee)) && (!groupFounders.contains(trustee))) {
      Double trustValue=this.getDataModel().getTrust(trustee);
      if (trustValue != null)       trustFaction=trustValue;
      economic=getConn().getAgentById(trustee).getEconomicBelief() - getDataModel().getEconomicBelief();
      social=getConn().getAgentById(trustee).getSocialBelief() - getDataModel().getSocialBelief();
      vectorDistance=Math.sqrt(Math.pow(economic,2) + Math.pow(social,2));
      esFaction=1 - (vectorDistance / maxDistance);
      currentHeuristic=0.5 * trustFaction + 0.5 * esFaction;
      if ((currentHeuristic > 0.6) && (previousHeuristic < currentHeuristic)) {
        bestPartner=trustee;
        previousHeuristic=currentHeuristic;
      }
    }
  }
  if (bestPartner.equals("String_Node_Str"))   return null;
 else {
    GroupDataInitialiser myGroup=new GroupDataInitialiser(this.uniformRandLong(),(this.getDataModel().getEconomicBelief() + getConn().getAgentById(bestPartner).getEconomicBelief()) / 2);
    Class<? extends AbstractGroupAgent> gtype=getConn().getAllowedGroupTypes().get(0);
    chosenGroup=getConn().createGroup(gtype,myGroup,bestPartner);
    groupFounders.add(this.getId());
    logger.log(Level.INFO,"String_Node_Str" + this.getConn().getAgentById(bestPartner).getName());
    logger.log(Level.INFO,"String_Node_Str" + previousHeuristic);
    logger.log(Level.INFO,"String_Node_Str" + this.getConn().getAgentById(bestPartner).getName());
    return chosenGroup;
  }
}