/*
 * 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 RecoveringActionComparator implements Comparator< RecoveringAction > {
    public int compare(RecoveringAction a1, RecoveringAction a2) {
        int actionCostCmp = Integer.compare(a1.recoveringActionCost, a2.recoveringActionCost);
        if (actionCostCmp !=0) {
            return actionCostCmp;
        }
        int workPeriodCmp = Integer.compare(a1.workPeriod, a2.workPeriod);
        return workPeriodCmp;
    }

}
