source: src/main/java/agents/anac/y2014/Gangster/Utils.java@ 345

Last change on this file since 345 was 1, checked in by Wouter Pasman, 6 years ago

Initial import : Genius 9.0.0

File size: 438 bytes
Line 
1package agents.anac.y2014.Gangster;
2
3
4import genius.core.Bid;
5import genius.core.issue.ValueInteger;
6
7class Utils {
8
9
10
11 public static int calculateManhattanDistance(Bid bid1, Bid bid2) throws Exception{
12
13 int numIssues = bid1.getValues().size();
14
15 int x = 0;
16 for(int i=1; i<=numIssues; i++){
17 x += Math.abs(((ValueInteger)bid1.getValue(i)).getValue() - ((ValueInteger)bid2.getValue(i)).getValue());
18 }
19
20 return x;
21
22 }
23
24}
Note: See TracBrowser for help on using the repository browser.