Program: 19729
Project: 19729
Buggy source:
@Override protected AgentType decideGroupStrategy(){
  TreeSet<String> currentPanel=getDataModel().getPanel();
  if (currentPanel.isEmpty())   return null;
  Tuple<AgentType,Double> tftTypes=new Tuple<AgentType,Double>(AgentType.TFT,0.0);
  Tuple<AgentType,Double> acTypes=new Tuple<AgentType,Double>(AgentType.AC,0.0);
  Tuple<AgentType,Double> adTypes=new Tuple<AgentType,Double>(AgentType.AD,0.0);
  Tuple<AgentType,Double> rTypes=new Tuple<AgentType,Double>(AgentType.R,0.0);
  for (  String followerID : getDataModel().getMemberList()) {
switch (getConn().getAgentById(followerID).getAgentType()) {
case AC:
      double oldCountAC=acTypes.getValue();
    acTypes.setValue(oldCountAC + 1);
  break;
case AD:
double oldCountAD=adTypes.getValue();
adTypes.setValue(oldCountAD + 1);
break;
case TFT:
double oldCountTFT=tftTypes.getValue();
tftTypes.setValue(oldCountTFT + 1);
break;
case R:
double oldCountR=rTypes.getValue();
rTypes.setValue(oldCountR + 1);
break;
}
}
List<Tuple<AgentType,Double>> typesCounterList=new LinkedList<Tuple<AgentType,Double>>();
int population=getDataModel().getMemberList().size();
acTypes.setValue(acTypes.getValue() / population);
adTypes.setValue(adTypes.getValue() / population);
tftTypes.setValue(tftTypes.getValue() / population);
rTypes.setValue(rTypes.getValue() / population);
typesCounterList.add(acTypes);
typesCounterList.add(adTypes);
typesCounterList.add(tftTypes);
typesCounterList.add(rTypes);
int followers=population - currentPanel.size();
double quotum=(followers * getDataModel().getEstimatedSocialLocation()) / population;
Iterator<Tuple<AgentType,Double>> i=typesCounterList.iterator();
while (i.hasNext()) {
Tuple<AgentType,Double> typeRatio=i.next();
if (typeRatio.getValue() > quotum) {
return typeRatio.getKey();
}
}
return null;
}

Fixed version (ground truth):
@Override protected AgentType decideGroupStrategy(){
  TreeSet<String> currentPanel=getDataModel().getPanel();
  if (currentPanel.isEmpty())   return null;
  Tuple<AgentType,Double> tftTypes=new Tuple<AgentType,Double>(AgentType.TFT,0.0);
  Tuple<AgentType,Double> acTypes=new Tuple<AgentType,Double>(AgentType.AC,0.0);
  Tuple<AgentType,Double> adTypes=new Tuple<AgentType,Double>(AgentType.AD,0.0);
  Tuple<AgentType,Double> rTypes=new Tuple<AgentType,Double>(AgentType.R,0.0);
  for (  String followerID : getDataModel().getMemberList()) {
switch (getConn().getAgentById(followerID).getAgentType()) {
case AC:
      double oldCountAC=acTypes.getValue();
    acTypes.setValue(oldCountAC + 1);
  break;
case AD:
double oldCountAD=adTypes.getValue();
adTypes.setValue(oldCountAD + 1);
break;
case TFT:
double oldCountTFT=tftTypes.getValue();
tftTypes.setValue(oldCountTFT + 1);
break;
case R:
double oldCountR=rTypes.getValue();
rTypes.setValue(oldCountR + 1);
break;
}
}
List<Tuple<AgentType,Double>> typesCounterList=new LinkedList<Tuple<AgentType,Double>>();
int population=getDataModel().getMemberList().size();
acTypes.setValue(acTypes.getValue() / population);
adTypes.setValue(adTypes.getValue() / population);
tftTypes.setValue(tftTypes.getValue() / population);
rTypes.setValue(rTypes.getValue() / population);
typesCounterList.add(acTypes);
typesCounterList.add(adTypes);
typesCounterList.add(tftTypes);
typesCounterList.add(rTypes);
int followers=population - currentPanel.size();
double quotum=(followers * getDataModel().getEstimatedSocialLocation()) / population;
System.out.println("String_Node_Str");
System.out.println(followers);
Iterator<Tuple<AgentType,Double>> i=typesCounterList.iterator();
while (i.hasNext()) {
Tuple<AgentType,Double> typeRatio=i.next();
if (typeRatio.getValue() > quotum) {
return typeRatio.getKey();
}
}
return null;
}