/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package SchedulesRecovery;

import java.util.Comparator;

/**
 *
 * @author frabe
 */
public class BankRecoveredSchedulesComparator implements Comparator< BankRecoveredSchedules > {
    public int compare(BankRecoveredSchedules b1, BankRecoveredSchedules b2) {
        int meanCostCmp = Double.compare(b1.meanCostRecoveredSimulations, b2.meanCostRecoveredSimulations);
        if (meanCostCmp !=0) {
            return meanCostCmp;
        }
        return Integer.compare(b1.initialSchedulesArray.initialScheduleSolutionNumber, b2.initialSchedulesArray.initialScheduleSolutionNumber);
    }
}
