Browse Source

Fixes order of supplied buildings, smallest minimum demand first now

Andreas T. Meyer-Berg 7 years ago
parent
commit
a7344ebb01
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/classes/comparator/MinEnergyComparator.java

+ 2 - 2
src/classes/comparator/MinEnergyComparator.java

@@ -26,11 +26,11 @@ public class MinEnergyComparator implements Comparator<HolonObject> {
 		float minEnergy1 = o1.getMinEnergy(timeStep);
 		float minEnergy2 = o2.getMinEnergy(timeStep);
 		if(minEnergy1<minEnergy2)
-			return -1;
+			return 1;
 		else if (minEnergy1 == minEnergy2) 
 			return 0;
 		else
-			return 1;
+			return -1;
 	}
 
 }