nus-yam/ex-repair huggingface dataset:
Program: 19719
Project: 19719
Buggy source:
@Override protected double updateHappinessAfterHunt(double foodHunted,double foodReceived){
  return 0;
}

Fixed version (ground truth):
/** 
 * This method updates the agent's happiness after hunt.
 * @param foodHunted The amount of food the agent returned from hunting.
 * @param foodReceived The final amount of food the agent received after tax
 * @return The new happiness value
 */
@Override protected double updateHappinessAfterHunt(double foodHunted,double foodReceived){
  double entitlement=getDataModel().getEconomicBelief() * foodHunted;
  double surplus=foodReceived - entitlement;
  Double currentHappiness=getDataModel().getCurrentHappiness();
  if (currentHappiness == null)   currentHappiness=0.5 * getDataModel().getEconomicBelief();
  currentHappiness=scale(currentHappiness,surplus,0.1);
  return currentHappiness;
}
Program: 19720
Project: 19720
Buggy source:
@Override protected double updateEconomicBeliefAfterVotes(Proposition proposition,int votes,double overallMovement){
  return 0;
}

Fixed version (ground truth):
@Override protected double updateEconomicBeliefAfterVotes(Proposition proposition,int votes,double overallMovement){
  return this.getDataModel().getEconomicBelief();
}
Program: 19721
Project: 19721
Buggy source:
@Override protected double updateSocialBeliefAfterVotes(Proposition proposition,int votes,double overallMovement){
  return 0;
}

Fixed version (ground truth):
@Override protected double updateSocialBeliefAfterVotes(Proposition proposition,int votes,double overallMovement){
  return this.getDataModel().getSocialBelief();
}
Program: 19722
Project: 19722
Buggy source:
@Override protected AgentType decideGroupStrategy(){
  return null;
}

Fixed version (ground truth):
@Override protected AgentType decideGroupStrategy(){
  double currentFoodReserve=getDataModel().getCurrentReservedFood();
  if (!loansTaken.isEmpty()) {
  }
  return null;
}
Program: 19723
Project: 19723
Buggy source:
@Override protected double decideTaxForReservePool(){
  return 0.1;
}

Fixed version (ground truth):
@Override protected double decideTaxForReservePool(){
  double currentFoodReserve=getDataModel().getCurrentReservedFood();
  if (achievementThreshold - currentFoodReserve > 500)   return 0.9;
 else   return 0.1;
}
Program: 19724
Project: 19724
Buggy source:
/** 
 * Once the hunters have gathered their winnings, it is processed and distributed here
 */
private void doHandleHuntResults(){
  double shared=0;
  double taxRate=1 - dm.getCurrentEconomicPoisition();
  for (  Double value : huntResult.values()) {
    shared+=value;
  }
  double tax=decideTaxForReservePool();
  double pooledFood=tax * shared;
  this.setReservedFood(getDataModel().getCurrentReservedFood() + pooledFood);
  shared=shared - pooledFood;
  shared=shared * taxRate / dm.getMemberList().size();
  Map<String,Double> result=new HashMap<String,Double>(huntResult.size());
  for (  String agent : huntResult.keySet()) {
    double value=shared + (1 - taxRate) * huntResult.get(agent);
    result.put(agent,value);
  }
  List<String> informedAgents=new ArrayList<String>();
  for (  String agent : result.keySet()) {
    informedAgents.add(agent);
    ec.act(new DistributeFood(agent,huntResult.get(agent),result.get(agent)),getId(),authCode);
  }
  @SuppressWarnings("String_Node_Str") List<String> uninformedAgents=new ArrayList<String>(dm.getMemberList());
  uninformedAgents.removeAll(informedAgents);
  for (  String agent : uninformedAgents) {
    ec.act(new DistributeFood(agent,0,shared),getId(),authCode);
  }
}

Fixed version (ground truth):
/** 
 * Once the hunters have gathered their winnings, it is processed and distributed here
 */
private void doHandleHuntResults(){
  double shared=0;
  double taxRate=1 - dm.getCurrentEconomicPoisition();
  for (  Double value : huntResult.values()) {
    shared+=value;
  }
  double tax=decideTaxForReservePool();
  this.setReservedFood(getDataModel().getCurrentReservedFood() + tax * shared);
  shared=shared - tax * shared;
  shared=shared * taxRate / dm.getMemberList().size();
  Map<String,Double> result=new HashMap<String,Double>(huntResult.size());
  for (  String agent : huntResult.keySet()) {
    double value=shared + (1 - taxRate) * huntResult.get(agent);
    result.put(agent,value);
  }
  List<String> informedAgents=new ArrayList<String>();
  for (  String agent : result.keySet()) {
    informedAgents.add(agent);
    ec.act(new DistributeFood(agent,huntResult.get(agent),result.get(agent)),getId(),authCode);
  }
  @SuppressWarnings("String_Node_Str") List<String> uninformedAgents=new ArrayList<String>(dm.getMemberList());
  uninformedAgents.removeAll(informedAgents);
  for (  String agent : uninformedAgents) {
    ec.act(new DistributeFood(agent,0,shared),getId(),authCode);
  }
}
Program: 19725
Project: 19725
Buggy source:
@Override protected void plugins(){
  addPlugin(new DebugSwitchPlugin());
  addPlugin(new HuntersAlivePlugin(getPath() + "String_Node_Str",1500,1200));
  addPlugin(new HunterListPlugin());
  addPlugin(new PoliticalCompassPlugin());
  addPlugin(new PoliticalCompass2Plugin());
}

Fixed version (ground truth):
@Override protected void plugins(){
  addPlugin(new DebugSwitchPlugin());
  addPlugin(new HuntersAlivePlugin(getPath() + "String_Node_Str",1500,1200));
  addPlugin(new HunterListPlugin());
}
Program: 19726
Project: 19726
Buggy source:
@Override protected void agents(){
  Random randomGenerator=new Random();
  for (int i=0; i < 150; i++) {
    addAgent(new LoansAgent(20,2,AgentType.AC,randomGenerator.nextDouble(),randomGenerator.nextDouble()));
  }
}

Fixed version (ground truth):
@Override protected void agents(){
  Random randomGenerator=new Random();
  for (int i=0; i < 150; i++) {
    addAgent(new LoansAgent(20,2,AgentType.AC,randomGenerator.nextDouble(),randomGenerator.nextDouble()));
    addAgent(new LoansAgent(20,2,AgentType.AD,randomGenerator.nextDouble(),randomGenerator.nextDouble()));
  }
}
Program: 19728
Project: 19728
Buggy source:
/** 
 * This method enables agents who received an invitation to check if they want to accept that invitation
 * @param none
 * @return The group ID held in the invitation. If null, the agent has rejected the invitation.
 */
private boolean inviteeAccepts(String invitee,Double esFaction){
  Double trustValue=getConn().getAgentById(invitee).getTrust(getDataModel().getId());
  double heuristicValue;
  if (trustValue != null) {
    heuristicValue=0.7 * trustValue + 0.3 * esFaction;
  }
 else {
    heuristicValue=0.3 * esFaction;
  }
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + getConn().getAgentById(invitee).getName());
  System.out.println("String_Node_Str" + getDataModel().getName());
  System.out.println("String_Node_Str" + heuristicValue);
  System.out.println("String_Node_Str");
  System.out.println();
  System.out.println();
  if (heuristicValue > 0.6) {
    invitationHolders.add(invitee);
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * This method enables agents who received an invitation to check if they want to accept that invitation
 * @param none
 * @return The group ID held in the invitation. If null, the agent has rejected the invitation.
 */
private boolean inviteeAccepts(String invitee,Double esFaction){
  Double trustValue=getConn().getAgentById(invitee).getTrust(getDataModel().getId());
  double heuristicValue;
  if (trustValue != null) {
    heuristicValue=0.7 * trustValue + 0.3 * esFaction;
  }
 else {
    heuristicValue=0.3 * esFaction;
  }
  if (heuristicValue > 0.6) {
    invitationHolders.add(invitee);
    return true;
  }
 else {
    return false;
  }
}
Program: 19730
Project: 19730
Buggy source:
@Override protected void beforeNewRound(){
  if (getDataModel().getMemberList().size() != 1) {
    TreeSet<String> currentPanel=getDataModel().getPanel();
    TreeSet<String> newPanel=updatePanel();
    this.setPanel(newPanel);
  }
}

Fixed version (ground truth):
@Override protected void beforeNewRound(){
  if (getDataModel().getMemberList().size() != 1) {
    TreeSet<String> newPanel=updatePanel();
    this.setPanel(newPanel);
  }
}
Program: 19732
Project: 19732
Buggy source:
double getEstimatedSocialLocation(){
  List<Double> avg_trusts=new ArrayList<Double>(memberList.size());
  PublicEnvironmentConnection ec=PublicEnvironmentConnection.getInstance();
  if (ec == null)   return 0.5;
  for (  String candidate : memberList) {
    int n=0;
    double sum=0;
    for (    String truster : memberList) {
      PublicAgentDataModel dm=ec.getAgentById(truster);
      Double t=(dm == null ? null : dm.getTrust(candidate));
      if (t != null && !candidate.equals(truster)) {
        sum+=t;
        ++n;
      }
    }
    if (n > 0)     avg_trusts.add(sum / n);
  }
  int n=avg_trusts.size();
  if (n == 0)   return 0.5;
  double sum=0;
  for (  Double v : avg_trusts)   sum+=v;
  double mu=sum / n;
  double variance=0;
  for (  Double v : avg_trusts)   variance+=(v - mu) * (v - mu);
  double st_dev=2 * Math.sqrt(variance / n);
  return st_dev;
}

Fixed version (ground truth):
double getEstimatedSocialLocation(){
  List<Double> avg_trusts=new ArrayList<Double>(memberList.size());
  PublicEnvironmentConnection ec=PublicEnvironmentConnection.getInstance();
  if (ec == null)   return 0.5;
  for (  String candidate : memberList) {
    int n=0;
    double sum=0;
    for (    String truster : memberList) {
      PublicAgentDataModel dm=ec.getAgentById(truster);
      Double t=(dm == null ? null : dm.getTrust(candidate));
      if (t != null && !candidate.equals(truster)) {
        sum+=t;
        ++n;
      }
    }
    if (n > 0)     avg_trusts.add(sum / n);
  }
  int n=avg_trusts.size();
  if (n == 0)   return 0.5;
  double sum=0;
  for (  Double v : avg_trusts)   sum+=v;
  double mu=sum / n;
  double variance=0;
  for (  Double v : avg_trusts)   variance+=(v - mu) * (v - mu);
  double st_dev=2 * Math.sqrt(variance / n);
  return 1 - st_dev;
}
Program: 19733
Project: 19733
Buggy source:
@Override protected void agents(){
  Random randomGenerator=new Random(this.randomSeed);
  for (int i=0; i < 7; i++) {
    addAgent(new TestPoliticalAgent(20,2,AgentType.AC,randomGenerator.nextDouble(),randomGenerator.nextDouble()));
  }
}

Fixed version (ground truth):
@Override protected void agents(){
  Random randomGenerator=new Random(this.randomSeed);
  for (int i=0; i < 50; i++) {
    addAgent(new TestPoliticalAgent(20,2,AgentType.AC,randomGenerator.nextDouble(),randomGenerator.nextDouble()));
  }
}
Program: 19734
Project: 19734
Buggy source:
/** 
 * Run per-step-in-simulation code that changes the plugin's state. Get new information from the alive agents of the simulation
 */
@Override public void execute(){
  try {
    updatePoliticalPlayers();
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + e.getMessage());
  }
  repaint();
  if (this.outputdirectory != null) {
    writeToPNG();
  }
}

Fixed version (ground truth):
/** 
 * Run per-step-in-simulation code that changes the plugin's state. Get new information from the alive agents of the simulation
 */
@Override public void execute(){
  try {
    updatePoliticalPlayers();
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + e.getMessage());
  }
  repaint();
  if (this.outputdirectory != null && (PublicEnvironmentConnection.getInstance().getRoundsPassed() % 50 == 0)) {
    writeToPNG();
  }
}
Program: 19735
Project: 19735
Buggy source:
private void writeToPNG(){
  BufferedImage bi=new BufferedImage(this.getSize().width,this.getSize().height,BufferedImage.TYPE_INT_ARGB);
  Graphics big=bi.getGraphics();
  big.setClip(0,0,500,500);
  this.paint(big);
  try {
    File f=new File(this.outputdirectory + "String_Node_Str" + this.framecount+ "String_Node_Str");
    f.mkdirs();
    ImageIO.write(bi,"String_Node_Str",f);
    this.framecount++;
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + this.framecount);
  }
}

Fixed version (ground truth):
private void writeToPNG(){
  BufferedImage bi=new BufferedImage(this.getSize().width,this.getSize().height,BufferedImage.TYPE_INT_ARGB);
  Graphics big=bi.getGraphics();
  big.setClip(0,0,this.getSize().width,this.getSize().height);
  this.paint(big);
  try {
    File f=new File(this.outputdirectory + "String_Node_Str" + this.framecount+ "String_Node_Str");
    f.mkdirs();
    ImageIO.write(bi,"String_Node_Str",f);
    this.framecount++;
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + this.framecount);
  }
}
Program: 19736
Project: 19736
Buggy source:
private void writeToPNG(){
  BufferedImage bi=new BufferedImage(this.getSize().width,this.getSize().height,BufferedImage.TYPE_INT_ARGB);
  Graphics big=bi.getGraphics();
  big.setClip(0,0,500,500);
  this.paint(big);
  try {
    File f=new File(this.outputdirectory + "String_Node_Str" + this.framecount+ "String_Node_Str");
    f.mkdirs();
    ImageIO.write(bi,"String_Node_Str",f);
    this.framecount++;
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + this.framecount);
  }
}

Fixed version (ground truth):
private void writeToPNG(){
  BufferedImage bi=new BufferedImage(this.getSize().width,this.getSize().height,BufferedImage.TYPE_INT_ARGB);
  Graphics big=bi.getGraphics();
  big.setClip(0,0,this.getSize().width,this.getSize().height);
  this.paint(big);
  try {
    File f=new File(this.outputdirectory + "String_Node_Str" + this.framecount+ "String_Node_Str");
    f.mkdirs();
    ImageIO.write(bi,"String_Node_Str",f);
    this.framecount++;
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + this.framecount);
  }
}
Program: 19737
Project: 19737
Buggy source:
@Override public boolean deregister(ENVDeRegisterRequest deregistrationObject){
  if (!authenticator.get(deregistrationObject.getParticipantID()).equals(deregistrationObject.getParticipantAuthCode())) {
    return false;
  }
  return dmodel.removeParticipant(deregistrationObject.getParticipantID());
}

Fixed version (ground truth):
@Override public boolean deregister(ENVDeRegisterRequest deregistrationObject){
  if (!authenticator.get(deregistrationObject.getParticipantID()).equals(deregistrationObject.getParticipantAuthCode())) {
    logger.log(Level.FINE,"String_Node_Str",nameOf(deregistrationObject.getParticipantID()));
    return false;
  }
  boolean succeeded=dmodel.removeParticipant(deregistrationObject.getParticipantID());
  logger.log(Level.FINE,"String_Node_Str",new Object[]{nameOf(deregistrationObject.getParticipantID()),succeeded});
  return succeeded;
}
Program: 19738
Project: 19738
Buggy source:
public boolean removeParticipant(String id){
  return (agents.remove(id) != null);
}

Fixed version (ground truth):
public boolean removeParticipant(String id){
  if (agents.remove(id) == null) {
    return (agentGroups.remove(id) != null);
  }
  return true;
}
Program: 19741
Project: 19741
Buggy source:
/** 
 * Here you implement any code concerning data storage about the events of this round before it is all deleted for a new round to begin. N.B: a "round" occurs after all   {@link TurnType turn types} have been iterated through. This is to avoid confusion between "cycles", "turn" and "time".  Alternatively, use of the unit "Harcourt" may also be used.  1 Round = 1 Harcourt
 */
abstract protected void beforeNewRound();

Fixed version (ground truth):
abstract protected void beforeNewRound();
Program: 19742
Project: 19742
Buggy source:
/** 
 * Function called upon group execution, where it has access to data concerning other objects in the simulation
 */
@Override public void execute(){
  TurnType turn=ec.getCurrentTurnType();
  if (TurnType.firstTurn.equals(turn)) {
    beforeNewRound();
    clearRoundData();
  }
switch (turn) {
case GroupSelect:
    break;
case TeamSelect:
  doTeamSelect();
break;
case GoHunt:
break;
case HuntResults:
doHandleHuntResults();
break;
case MakeProposals:
break;
case Voting:
countVotes();
break;
}
}

Fixed version (ground truth):
/** 
 * Function called upon group execution, where it has access to data concerning other objects in the simulation
 */
@Override public void execute(){
  TurnType turn=ec.getCurrentTurnType();
  if (TurnType.firstTurn.equals(turn)) {
    beforeNewRound();
    clearRoundData();
  }
switch (turn) {
case GroupSelect:
    break;
case TeamSelect:
  doTeamSelect();
break;
case GoHunt:
doLeadersHunt();
break;
case HuntResults:
doHandleHuntResults();
break;
case MakeProposals:
break;
case Voting:
countVotes();
break;
}
}
Program: 19743
Project: 19743
Buggy source:
@Override protected void plugins(){
  addPlugin(new DebugSwitchPlugin());
  addPlugin(new HuntersAlivePlugin(getPath() + "String_Node_Str",1500,1200));
  addPlugin(new DatabasePlugin(comment,true));
  addPlugin(new HunterListPlugin());
  addPlugin(new PoliticalCompassPlugin());
  addPlugin(new PoliticalCompass2Plugin());
}

Fixed version (ground truth):
@Override protected void plugins(){
  addPlugin(new DebugSwitchPlugin());
  addPlugin(new HuntersAlivePlugin(getPath() + "String_Node_Str",1500,1200));
  addPlugin(new HunterListPlugin());
  addPlugin(new PoliticalCompassPlugin());
  addPlugin(new PoliticalCompass2Plugin());
}
Program: 19744
Project: 19744
Buggy source:
@Override protected void agents(){
  Random randomGenerator=new Random();
  for (int i=0; i < 10; i++) {
    addAgent(new TestPoliticalAgent(20,2,AgentType.AC,randomGenerator.nextDouble(),randomGenerator.nextDouble()));
    addAgent(new TestPoliticalAgent(20,2,AgentType.TFT,randomGenerator.nextDouble(),randomGenerator.nextDouble()));
    addAgent(new TestPoliticalAgent(20,2,AgentType.AD,randomGenerator.nextDouble(),randomGenerator.nextDouble()));
    addAgent(new TestPoliticalAgent(20,2,AgentType.R,randomGenerator.nextDouble(),randomGenerator.nextDouble()));
  }
}

Fixed version (ground truth):
@Override protected void agents(){
  Random randomGenerator=new Random();
  for (int i=0; i < 40; i++) {
    addAgent(new TestPoliticalAgent(20,2,AgentType.AC,randomGenerator.nextDouble(),randomGenerator.nextDouble()));
  }
}
Program: 19745
Project: 19745
Buggy source:
public TanhFeedForwardNetwork(int... nodeCounts){
  int layerCount=nodeCounts.length;
  if (layerCount < 2) {
    throw new RuntimeException("String_Node_Str");
  }
  this.setInputs(nodeCounts[0]);
  this.setOutputs(nodeCounts[layerCount - 1]);
  ArrayList<TanhLayer> layers=new ArrayList<TanhLayer>();
  for (int i=1; i < layerCount; i++) {
    layers.add(new TanhLayer(nodeCounts[i],nodeCounts[i + 1]));
  }
  this.setLayers((TanhLayer[])layers.toArray());
}

Fixed version (ground truth):
public TanhFeedForwardNetwork(int... nodeCounts){
  int layerCount=nodeCounts.length;
  if (layerCount < 2) {
    throw new RuntimeException("String_Node_Str");
  }
  this.setInputs(nodeCounts[0]);
  this.setOutputs(nodeCounts[layerCount - 1]);
  TanhLayer layers[]=new TanhLayer[layerCount - 1];
  for (int i=0; i < layerCount - 1; i++) {
    layers[i]=new TanhLayer(nodeCounts[i],nodeCounts[i + 1]);
  }
  this.setLayers(layers);
}
Program: 19747
Project: 19747
Buggy source:
/** 
 * This method assesses an agent's satisfaction in the group. If the agent is satisfied remains in the group otherwise it will request to leave the group.
 * @param none
 * @return Satisfied or not?
 */
protected boolean SatisfiedInGroup(){
  if (satisfaction.isEmpty())   satisfaction.newEntry(0.0);
  Double previousSatisfaction=satisfaction.getValue();
  double myEconomic=getDataModel().getEconomicBelief();
  double mySocial=getDataModel().getSocialBelief();
  double groupEconomic=getConn().getGroupById(getDataModel().getGroupId()).getCurrentEconomicPoisition();
  double groupSocial=getConn().getGroupById(getDataModel().getGroupId()).getEstimatedSocialLocation();
  double deltaEconomic=groupEconomic - myEconomic;
  double deltaSocial=groupSocial - mySocial;
  Double currentSatisfaction=Math.sqrt(Math.pow(deltaEconomic,2) + Math.pow(deltaSocial,2));
  satisfaction.newEntry(currentSatisfaction);
  Double deltaSatisfaction=currentSatisfaction - previousSatisfaction;
  if (deltaSatisfaction >= 0) {
    return true;
  }
 else   if (currentSatisfaction > 0.5) {
    return false;
  }
 else   if (deltaSatisfaction < -0.2) {
    return false;
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
/** 
 * This method assesses an agent's satisfaction in the group. If the agent is satisfied remains in the group otherwise it will request to leave the group.
 * @param none
 * @return Satisfied or not?
 */
protected boolean SatisfiedInGroup(){
  if (satisfaction.isEmpty())   satisfaction.newEntry(0.0);
  Double previousSatisfaction=satisfaction.getValue();
  double myEconomic=getDataModel().getEconomicBelief();
  double mySocial=getDataModel().getSocialBelief();
  double groupEconomic=getConn().getGroupById(getDataModel().getGroupId()).getCurrentEconomicPoisition();
  double groupSocial=getConn().getGroupById(getDataModel().getGroupId()).getEstimatedSocialLocation();
  double deltaEconomic=groupEconomic - myEconomic;
  double deltaSocial=groupSocial - mySocial;
  Double currentSatisfaction=Math.sqrt(Math.pow(deltaEconomic,2) + Math.pow(deltaSocial,2));
  satisfaction.newEntry(currentSatisfaction);
  Double deltaSatisfaction=currentSatisfaction - previousSatisfaction;
  if (deltaSatisfaction >= 0) {
    return true;
  }
 else   if (currentSatisfaction > 0.7) {
    return false;
  }
 else   if (deltaSatisfaction < -0.2) {
    return false;
  }
 else {
    return true;
  }
}
Program: 19748
Project: 19748
Buggy source:
/** 
 * This method updates the agent's economic belief after the voting results are published.
 * @param proposition The proposition
 * @param votes How many votes this proposition got. If votes > 0 proposition passed otherwise has not.
 * @param overallMovement The overall change in group's position after voting
 * @return The new social belief
 */
@Override protected double updateEconomicBeliefAfterVotes(Proposition proposition,int votes,double overallMovement){
  double currentEconomic=getDataModel().getEconomicBelief();
  String groupId=getDataModel().getGroupId();
  if ((groupId != null) && (getConn().getGroupById(groupId).getMemberList().size() > 1)) {
    if (this.getDataModel().getGroupId().equals(proposition.getOwnerGroup())) {
      double groupEconomic=getConn().getGroupById(getDataModel().getGroupId()).getCurrentEconomicPoisition();
      double deltaEconomic=groupEconomic - currentEconomic;
      if (moreLoyal() && moreHappy()) {
        currentEconomic=scale(currentEconomic,deltaEconomic,Math.abs(overallMovement));
      }
 else {
        if (deltaEconomic != 0) {
          currentEconomic=scale(currentEconomic,-deltaEconomic,Math.abs(overallMovement));
        }
 else {
          boolean random=uniformRandBoolean();
          if (random)           currentEconomic=scale(currentEconomic,1,Math.abs(overallMovement));
 else           currentEconomic=scale(currentEconomic,-1,Math.abs(overallMovement));
        }
      }
    }
    return currentEconomic;
  }
 else   return currentEconomic;
}

Fixed version (ground truth):
/** 
 * This method updates the agent's economic belief after the voting results are published.
 * @param proposition The proposition
 * @param votes How many votes this proposition got. If votes > 0 proposition passed otherwise has not.
 * @param overallMovement The overall change in group's position after voting
 * @return The new social belief
 */
@Override protected double updateEconomicBeliefAfterVotes(Proposition proposition,int votes,double overallMovement){
  double currentEconomic=getDataModel().getEconomicBelief();
  String groupId=getDataModel().getGroupId();
  if ((groupId != null) && (getConn().getGroupById(groupId).getMemberList().size() > 1)) {
    if (this.getDataModel().getGroupId().equals(proposition.getOwnerGroup())) {
      double groupEconomic=getConn().getGroupById(getDataModel().getGroupId()).getCurrentEconomicPoisition();
      double deltaEconomic=groupEconomic - currentEconomic;
      if (moreLoyal() && moreHappy()) {
        currentEconomic=scale(currentEconomic,1 / deltaEconomic,Math.abs(overallMovement));
      }
 else {
        if (deltaEconomic != 0) {
          currentEconomic=scale(currentEconomic,1 / -deltaEconomic,Math.abs(overallMovement));
        }
 else {
          boolean random=uniformRandBoolean();
          if (random)           currentEconomic=scale(currentEconomic,1,Math.abs(overallMovement));
 else           currentEconomic=scale(currentEconomic,-1,Math.abs(overallMovement));
        }
      }
    }
    return currentEconomic;
  }
 else   return currentEconomic;
}
Program: 19749
Project: 19749
Buggy source:
protected void checkBeforeLeave(){
  PublicGroupDataModel myGroup=getConn().getGroupById(getDataModel().getGroupId());
  if (myGroup.getMemberList().size() == 2)   for (  String member : myGroup.getMemberList())   if (!member.equals(getDataModel().getId()))   membersToKickOut.add(member);
}

Fixed version (ground truth):
/** 
 * This procedure is primarily used right before an agent issues the choice to leave the group it is currently in. If the group it is leaving had only one other member then that member is stored in a dedicated tree structure 'membersToKickOut' so that it is known that this member will have to leave in the next turn. This is necessary as you cannot have a group characterised by only one member.
 * @param none
 * @return none
 */
protected void checkBeforeLeave(){
  PublicGroupDataModel myGroup=getConn().getGroupById(getDataModel().getGroupId());
  if (myGroup.getMemberList().size() == 2)   for (  String member : myGroup.getMemberList())   if (!member.equals(getDataModel().getId()))   membersToKickOut.add(member);
}
Program: 19751
Project: 19751
Buggy source:
/** 
 * This method updates the agent's social belief after the voting results are published.
 * @param proposition The proposition
 * @param votes How many votes this proposition got. If votes > 0 proposition passed otherwise has not.
 * @param overallMovement The overall change in group's position after voting
 * @return The new social belief
 */
@Override protected double updateSocialBeliefAfterVotes(Proposition proposition,int votes,double overallMovement){
  double currentSocial=getDataModel().getSocialBelief();
  String groupId=getDataModel().getGroupId();
  if ((groupId != null) && (getConn().getGroupById(groupId).getMemberList().size() > 1)) {
    if (this.getDataModel().getGroupId().equals(proposition.getOwnerGroup())) {
      double groupSocial=getConn().getGroupById(getDataModel().getGroupId()).getEstimatedSocialLocation();
      double deltaSocial=groupSocial - currentSocial;
      if (votes > 0) {
        currentSocial=scale(currentSocial,deltaSocial,Math.abs(overallMovement));
      }
 else       if (votes < 0) {
        currentSocial=scale(currentSocial,-deltaSocial,Math.abs(overallMovement));
      }
    }
    return currentSocial;
  }
 else {
    return currentSocial;
  }
}

Fixed version (ground truth):
/** 
 * This method updates the agent's social belief after the voting results are published.
 * @param proposition The proposition
 * @param votes How many votes this proposition got. If votes > 0 proposition passed otherwise has not.
 * @param overallMovement The overall change in group's position after voting
 * @return The new social belief
 */
@Override protected double updateSocialBeliefAfterVotes(Proposition proposition,int votes,double overallMovement){
  double currentSocial=getDataModel().getSocialBelief();
  String groupId=getDataModel().getGroupId();
  if ((groupId != null) && (getConn().getGroupById(groupId).getMemberList().size() > 1)) {
    if (this.getDataModel().getGroupId().equals(proposition.getOwnerGroup())) {
      double groupSocial=getConn().getGroupById(getDataModel().getGroupId()).getEstimatedSocialLocation();
      double deltaSocial=groupSocial - currentSocial;
      if (votes > 0) {
        currentSocial=scale(currentSocial,1 / deltaSocial,Math.abs(overallMovement));
      }
 else       if (votes < 0) {
        currentSocial=scale(currentSocial,1 / -deltaSocial,Math.abs(overallMovement));
      }
    }
    return currentSocial;
  }
 else {
    return currentSocial;
  }
}
Program: 19753
Project: 19753
Buggy source:
/** 
 * This method enables agents to form groups. It uses a heuristic based on mutual trust and the socio-economic beliefs. The agent can either try the heuristic with another free agent or with an existing group. The priority is to find an existing group to join. If that fails then we check compatibility between two free agents.
 * @param none
 * @return The group ID that this agent has chosen to join. If null no group is chosen. If leaveGroup is returned the agent requested to leave the group
 */
@Override protected String chooseGroup(){
  String chosenGroup="String_Node_Str";
  if (this.getDataModel().getGroupId() != null) {
    if (groupFounders.contains(this.getId())) {
      groupFounders.remove(this.getId());
    }
    if (invitationHolders.contains(this.getId())) {
      invitationHolders.remove(this.getId());
    }
    if (membersToKickOut.contains(this.getId())) {
      membersToKickOut.remove(this.getId());
      return leaveGroup;
    }
  }
 else   if (this.invitationToGroup != null) {
    return this.invitationToGroup;
  }
 else {
    chosenGroup=agentGroupGrouping();
  }
  if (chosenGroup.equals("String_Node_Str")) {
    chosenGroup=freeAgentsGrouping();
  }
  return chosenGroup;
}

Fixed version (ground truth):
/** 
 * This method enables agents to form groups. It uses a heuristic based on mutual trust and the socio-economic beliefs. The agent can either try the heuristic with another free agent or with an existing group. The priority is to find an existing group to join. If that fails then we check compatibility between two free agents.
 * @param none
 * @return The group ID that this agent has chosen to join. If null no group is chosen. If leaveGroup is returned the agent requested to leave the group
 */
@Override protected String chooseGroup(){
  String chosenGroup="String_Node_Str";
  if (this.getDataModel().getGroupId() != null) {
    if (groupFounders.contains(this.getId())) {
      groupFounders.remove(this.getId());
    }
    if (invitationHolders.contains(this.getId())) {
      invitationHolders.remove(this.getId());
    }
    if (membersToKickOut.contains(this.getId())) {
      membersToKickOut.remove(this.getId());
      return leaveGroup;
    }
    if (SatisfiedInGroup()) {
      return null;
    }
 else {
      checkBeforeLeave();
      return leaveGroup;
    }
  }
 else   if (this.invitationToGroup != null) {
    return this.invitationToGroup;
  }
 else {
    chosenGroup=agentGroupGrouping();
  }
  if (chosenGroup.equals("String_Node_Str")) {
    chosenGroup=freeAgentsGrouping();
  }
  return chosenGroup;
}
Program: 19754
Project: 19754
Buggy source:
/** 
 * An agent which belongs to a group can consult another agent to choose what type of food to hunt given its current opponent
 * @param none
 * @return The suggested food type
 */
private Food askAdvice(){
  Food suggestedFood=null;
  String opponentID=null;
  List<String> members=this.getDataModel().getHuntingTeam().getMembers();
  if (members.size() == 1)   return null;
  if (members.get(0).equals(this.getId())) {
    if (getConn().getAgentById(members.get(1)) != null) {
      opponentID=members.get(1);
    }
  }
 else {
    if (getConn().getAgentById(members.get(0)) != null) {
      opponentID=members.get(0);
    }
  }
  if (opponentID != null) {
    HuntingTeam opponentPreviousTeam=getConn().getAgentById(opponentID).getTeamHistory().getValue(1);
    if (opponentPreviousTeam != null) {
      for (      String agent : opponentPreviousTeam.getMembers()) {
        if (!agent.equals(opponentID) && !agent.equals(this.getId())) {
          return suggestedFood=seekAvice(agent);
        }
      }
    }
  }
  return suggestedFood;
}

Fixed version (ground truth):
/** 
 * An agent which belongs to a group can consult another agent to choose what type of food to hunt given its current opponent
 * @param none
 * @return The suggested food type
 */
private Food askAdvice(List<String> members){
  Food suggestedFood=null;
  String opponentID=null;
  if (members.size() == 1)   return null;
  if (members.get(0).equals(this.getId())) {
    if (getConn().getAgentById(members.get(1)) != null) {
      opponentID=members.get(1);
    }
  }
 else {
    if (getConn().getAgentById(members.get(0)) != null) {
      opponentID=members.get(0);
    }
  }
  if (opponentID != null) {
    HuntingTeam opponentPreviousTeam=getConn().getAgentById(opponentID).getTeamHistory().getValue(1);
    if (opponentPreviousTeam != null) {
      for (      String agent : opponentPreviousTeam.getMembers()) {
        if (!agent.equals(opponentID) && !agent.equals(this.getId())) {
          return suggestedFood=seekAvice(agent);
        }
      }
    }
  }
  return suggestedFood;
}
Program: 19755
Project: 19755
Buggy source:
private void doGroupSelect(){
  String gid=chooseGroup();
  if (gid == null ? true : gid.equals(dm.getGroupId()))   return;
  if (gid.equals(leaveGroup)) {
    ec.act(new ApplyToGroup(gid),getId(),authCode);
    this.dm.setGroup(null);
    return;
  }
  if (getConn().isGroupId(gid))   ec.act(new ApplyToGroup(gid),getId(),authCode);
}

Fixed version (ground truth):
private void doGroupSelect(){
  String gid=chooseGroup();
  if (gid == null ? true : gid.equals(dm.getGroupId()))   return;
  if (gid.equals(leaveGroup)) {
    ec.act(new ApplyToGroup(gid),getId(),authCode);
    return;
  }
  if (getConn().isGroupId(gid))   ec.act(new ApplyToGroup(gid),getId(),authCode);
}
Program: 19756
Project: 19756
Buggy source:
private Food askAdvice(){
  Food suggestedFood=null;
  String opponentID=null;
  List<String> members=this.getDataModel().getHuntingTeam().getMembers();
  if (members.size() == 1)   return null;
  if (members.get(0).equals(this.getId())) {
    if (getConn().getAgentById(members.get(1)) != null) {
      opponentID=members.get(1);
    }
  }
 else {
    if (getConn().getAgentById(members.get(0)) != null) {
      opponentID=members.get(0);
    }
  }
  if (opponentID != null) {
    try {
      HuntingTeam opponentPreviousTeam=getConn().getAgentById(opponentID).getTeamHistory().getValue(1);
      if (opponentPreviousTeam != null) {
        for (        String agent : opponentPreviousTeam.getMembers()) {
          if (!agent.equals(opponentID) && !agent.equals(this.getId())) {
            return suggestedFood=seekAvice(agent);
          }
        }
      }
    }
 catch (    IndexOutOfBoundsException ex) {
      return suggestedFood=this.askAdvice();
    }
  }
  return suggestedFood;
}

Fixed version (ground truth):
private Food askAdvice(){
  Food suggestedFood=null;
  String opponentID=null;
  List<String> members=this.getDataModel().getHuntingTeam().getMembers();
  if (members.size() == 1)   return null;
  if (members.get(0).equals(this.getId())) {
    if (getConn().getAgentById(members.get(1)) != null) {
      opponentID=members.get(1);
    }
  }
 else {
    if (getConn().getAgentById(members.get(0)) != null) {
      opponentID=members.get(0);
    }
  }
  if (opponentID != null) {
    try {
      HuntingTeam opponentPreviousTeam=getConn().getAgentById(opponentID).getTeamHistory().getValue(1);
      if (opponentPreviousTeam != null) {
        for (        String agent : opponentPreviousTeam.getMembers()) {
          if (!agent.equals(opponentID) && !agent.equals(this.getId())) {
            return suggestedFood=seekAvice(agent);
          }
        }
      }
    }
 catch (    IndexOutOfBoundsException ex) {
      return null;
    }
  }
  return suggestedFood;
}
Program: 19757
Project: 19757
Buggy source:
private boolean moreLoyal(){
  if (this.getDataModel().getGroupId() != null) {
    double myEconomic=getDataModel().getEconomicBelief();
    double myGroupEconomic=getConn().getGroupById(getDataModel().getGroupId()).getCurrentEconomicPoisition();
    double deltaEconomic=Math.abs(myGroupEconomic - myEconomic);
    Double oneTurnAgoHappiness=getDataModel().getHappinessHistory().getValue(1).doubleValue();
    if (oneTurnAgoHappiness == null) {
      oneTurnAgoHappiness=0.5 * myEconomic;
    }
    Double curretnHappiness=getDataModel().getCurrentHappiness();
    if (curretnHappiness == null) {
      curretnHappiness=0.5 * myEconomic;
    }
    ScaledDouble tmp=getDataModel().getLoyaltyHistory().getValue(1);
    double oneTurnAgoLoyalty;
    if (tmp == null) {
      oneTurnAgoLoyalty=0.5 * (oneTurnAgoHappiness * deltaEconomic);
    }
 else {
      oneTurnAgoLoyalty=tmp.doubleValue();
    }
    Double currentLoyalty=getDataModel().getCurrentLoyalty();
    if (currentLoyalty == null) {
      currentLoyalty=0.5 * (curretnHappiness * deltaEconomic);
    }
    double deltaLoyalty=currentLoyalty - oneTurnAgoLoyalty;
    if (deltaLoyalty > 0) {
      return true;
    }
 else     if (deltaLoyalty < 0) {
      return false;
    }
 else     return true;
  }
 else   return false;
}

Fixed version (ground truth):
private boolean moreLoyal(){
  if (this.getDataModel().getGroupId() != null) {
    double myEconomic=getDataModel().getEconomicBelief();
    double myGroupEconomic=getConn().getGroupById(getDataModel().getGroupId()).getCurrentEconomicPoisition();
    double deltaEconomic=Math.abs(myGroupEconomic - myEconomic);
    ScaledDouble tmp=getDataModel().getHappinessHistory().getValue(1);
    double oneTurnAgoHappiness;
    if (tmp == null) {
      oneTurnAgoHappiness=0.5 * myEconomic;
    }
 else {
      oneTurnAgoHappiness=tmp.doubleValue();
    }
    Double curretnHappiness=getDataModel().getCurrentHappiness();
    if (curretnHappiness == null) {
      curretnHappiness=0.5 * myEconomic;
    }
    double oneTurnAgoLoyalty;
    try {
      oneTurnAgoLoyalty=getDataModel().getLoyaltyHistory().getValue(1).doubleValue();
    }
 catch (    Exception ex) {
      if (!(ex instanceof IndexOutOfBoundsException) && !(ex instanceof NullPointerException)) {
        throw new Error(ex);
      }
      oneTurnAgoLoyalty=0.5 * (oneTurnAgoHappiness * deltaEconomic);
    }
    Double currentLoyalty=getDataModel().getCurrentLoyalty();
    if (currentLoyalty == null) {
      currentLoyalty=0.5 * (curretnHappiness * deltaEconomic);
    }
    double deltaLoyalty=currentLoyalty - oneTurnAgoLoyalty;
    if (deltaLoyalty > 0) {
      return true;
    }
 else     if (deltaLoyalty < 0) {
      return false;
    }
 else     return true;
  }
 else   return false;
}
Program: 19759
Project: 19759
Buggy source:
public Politics(){
  super("String_Node_Str",400,0,0.1);
}

Fixed version (ground truth):
public Politics(){
  super("String_Node_Str",300,0,0.1);
}
Program: 19760
Project: 19760
Buggy source:
@Override protected void agents(){
  addAgent(new TestPoliticalAgent(20,2,AgentType.AC,0.5,0.5));
  addAgent(new TestPoliticalAgent(20,2,AgentType.AC,0.5,0.4));
  addAgent(new TestPoliticalAgent(20,2,AgentType.AC,0.4,0.5));
}

Fixed version (ground truth):
@Override protected void agents(){
  Random randomGenerator=new Random();
  for (int i=0; i < 10; i++) {
    addAgent(new TestPoliticalAgent(20,2,AgentType.AC,randomGenerator.nextDouble(),randomGenerator.nextDouble()));
    addAgent(new TestPoliticalAgent(20,2,AgentType.TFT,randomGenerator.nextDouble(),randomGenerator.nextDouble()));
    addAgent(new TestPoliticalAgent(20,2,AgentType.AD,randomGenerator.nextDouble(),randomGenerator.nextDouble()));
    addAgent(new TestPoliticalAgent(20,2,AgentType.R,randomGenerator.nextDouble(),randomGenerator.nextDouble()));
  }
}
Program: 19761
Project: 19761
Buggy source:
private String agentGroupGrouping(){
  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, trustSum;
  int numKnownTrustValues;
  PublicGroupDataModel aGroup;
  for (  String groupID : getConn().availableGroups()) {
    aGroup=getConn().getGroupById(groupID);
    numKnownTrustValues=0;
    trustSum=0;
    for (    String trustee : aGroup.getMemberList()) {
      Double trustValue=this.getDataModel().getTrust(trustee);
      if (trustValue != null) {
        trustSum+=trustValue;
        numKnownTrustValues++;
      }
    }
    if (numKnownTrustValues != 0)     trustFaction=trustSum / numKnownTrustValues;
 else     trustFaction=0;
    economic=aGroup.getCurrentEconomicPoisition() - this.getDataModel().getEconomicBelief();
    social=aGroup.getEstimatedSocialLocation() - 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.4) && (previousHeuristic < currentHeuristic)) {
      chosenGroup=aGroup.getId();
      previousHeuristic=currentHeuristic;
    }
  }
  return chosenGroup;
}

Fixed version (ground truth):
private String agentGroupGrouping(){
  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, trustSum;
  int numKnownTrustValues;
  PublicGroupDataModel aGroup;
  for (  String groupID : getConn().availableGroups()) {
    aGroup=getConn().getGroupById(groupID);
    numKnownTrustValues=0;
    trustSum=0;
    for (    String trustee : aGroup.getMemberList()) {
      Double trustValue=this.getDataModel().getTrust(trustee);
      if (trustValue != null) {
        trustSum+=trustValue;
        numKnownTrustValues++;
      }
    }
    if (numKnownTrustValues != 0)     trustFaction=trustSum / numKnownTrustValues;
 else     trustFaction=0;
    economic=aGroup.getCurrentEconomicPoisition() - this.getDataModel().getEconomicBelief();
    social=aGroup.getEstimatedSocialLocation() - 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.5) && (previousHeuristic < currentHeuristic)) {
      chosenGroup=aGroup.getId();
      previousHeuristic=currentHeuristic;
    }
  }
  return chosenGroup;
}
Program: 19762
Project: 19762
Buggy source:
@Override protected Map<String,Double> updateTrustAfterHunt(double foodHunted,double foodReceived){
  Food lastHunted=this.getDataModel().getLastHunted();
  List<String> members=this.getDataModel().getHuntingTeam().getMembers();
  String opponentID;
  Map<String,Double> newTrustValue=new HashMap<String,Double>();
  double trust;
  if ((lastHunted == null) || (members.size() < 2))   return null;
  if (members.get(0).equals(this.getId())) {
    opponentID=members.get(1);
  }
 else {
    opponentID=members.get(0);
  }
  if (this.getDataModel().getTrust(opponentID) != null) {
    trust=this.getDataModel().getTrust(opponentID);
  }
 else {
    trust=0;
  }
  if (lastHunted.getName().equals("String_Node_Str")) {
    if (foodHunted == 0) {
      trust=ValueScaler.scale(trust,-1,0.5);
    }
 else {
      trust=ValueScaler.scale(trust,1,0.5);
    }
  }
 else {
    trust=ValueScaler.scale(trust,0,0.5);
  }
  newTrustValue.put(opponentID,trust);
  return newTrustValue;
}

Fixed version (ground truth):
@Override protected Map<String,Double> updateTrustAfterHunt(double foodHunted,double foodReceived){
  Food lastHunted=this.getDataModel().getLastHunted();
  List<String> members=this.getDataModel().getHuntingTeam().getMembers();
  String opponentID;
  Map<String,Double> newTrustValue=new HashMap<String,Double>();
  double trust;
  if ((lastHunted == null) || (members.size() < 2))   return null;
  if (members.get(0).equals(this.getId())) {
    opponentID=members.get(1);
  }
 else {
    opponentID=members.get(0);
  }
  if (this.getDataModel().getTrust(opponentID) != null) {
    trust=this.getDataModel().getTrust(opponentID);
  }
 else {
    trust=0.1;
  }
  if (lastHunted.getName().equals("String_Node_Str")) {
    if (foodHunted == 0) {
      trust=ValueScaler.scale(trust,-1,0.3);
    }
 else {
      trust=ValueScaler.scale(trust,1,0.3);
      System.out.println(trust);
    }
  }
 else {
    trust=ValueScaler.scale(trust,0,0.3);
  }
  newTrustValue.put(opponentID,trust);
  return newTrustValue;
}
Program: 19763
Project: 19763
Buggy source:
@Override protected double updateHappinessAfterVotes(Proposition proposition,int votes,double overallMovement){
  Double currentHappiness=getDataModel().getCurrentHappiness();
  if (currentHappiness == null) {
    currentHappiness=0.5 * getDataModel().getEconomicBelief();
  }
  System.out.println(votes);
  if (this.getDataModel().getGroupId().equals(proposition.getOwnerGroup())) {
    if (votes > 0) {
      currentHappiness=ValueScaler.scale(currentHappiness,votes,overallMovement);
    }
 else     if (votes < 0) {
      currentHappiness=ValueScaler.scale(currentHappiness,votes,overallMovement);
    }
 else     currentHappiness=ValueScaler.scale(currentHappiness,0,overallMovement);
  }
  return currentHappiness;
}

Fixed version (ground truth):
@Override protected double updateHappinessAfterVotes(Proposition proposition,int votes,double overallMovement){
  Double currentHappiness=getDataModel().getCurrentHappiness();
  if (currentHappiness == null) {
    currentHappiness=0.5 * getDataModel().getEconomicBelief();
  }
  if (this.getDataModel().getGroupId().equals(proposition.getOwnerGroup())) {
    if (votes > 0) {
      currentHappiness=ValueScaler.scale(currentHappiness,votes,overallMovement);
    }
 else     if (votes < 0) {
      currentHappiness=ValueScaler.scale(currentHappiness,votes,overallMovement);
    }
 else     currentHappiness=ValueScaler.scale(currentHappiness,0,overallMovement);
  }
  return currentHappiness;
}
Program: 19764
Project: 19764
Buggy source:
@Override protected Map<String,Double> updateTrustAfterVotes(Proposition proposition,int votes,double overallMovement){
  Map<String,Double> newTrustValue=new HashMap<String,Double>();
  String proposer=proposition.getProposer();
  double proposerTrust;
  if (!this.getDataModel().getId().equals(proposer)) {
    if (this.getDataModel().getTrust(proposer) != null) {
      proposerTrust=this.getDataModel().getTrust(proposer);
    }
 else {
      proposerTrust=0;
    }
    proposerTrust+=ValueScaler.scale(overallMovement,votes,overallMovement);
    newTrustValue.put(proposer,proposerTrust);
  }
 else {
    newTrustValue=null;
  }
  return newTrustValue;
}

Fixed version (ground truth):
@Override protected Map<String,Double> updateTrustAfterVotes(Proposition proposition,int votes,double overallMovement){
  Map<String,Double> newTrustValue=new HashMap<String,Double>();
  String proposer=proposition.getProposer();
  double proposerTrust;
  if (!this.getDataModel().getId().equals(proposer)) {
    if (this.getDataModel().getTrust(proposer) != null) {
      proposerTrust=this.getDataModel().getTrust(proposer);
    }
 else {
      proposerTrust=0;
    }
    proposerTrust=ValueScaler.scale(proposerTrust,votes,overallMovement);
    newTrustValue.put(proposer,proposerTrust);
  }
 else {
    newTrustValue=null;
  }
  return newTrustValue;
}