Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/22/13 16:13:05 (11 years ago)
Author:
ascheibe
Message:

#2069 fixed bug in quality calculation

Location:
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/External Evaluator/BattleRunner.java

    r9891 r9899  
    125125            else
    126126                opponentScore = result.getScore();
    127         }   
    128     BattleRunner.score.add(robotScore / (robotScore + opponentScore));   
     127        }
     128   
     129    //prevent div / 0 which can happen if both robots do not score
     130    if((robotScore + opponentScore) == 0) {
     131      BattleRunner.score.add(0.0);   
     132    } else {
     133      BattleRunner.score.add(robotScore / (robotScore + opponentScore));   
     134    }
    129135    }
    130136}
Note: See TracChangeset for help on using the changeset viewer.