I am unclear, due to my limited java abilities, how to sort a bag of steppable agents by an attribute. Specifically. I have a bag of agents that I would like to sort by a value stored as a double (public double diff). The documentation states that I need to provide a comparator:
public void sort(java.util.Comparator c)
but am uncertain how to provide the java.lang.Double.compare method such that it sorts the bag of objects by the "diff" attribute, if in fact that is what I need to do.
Thank you for your assistance.
Michael D. Makowsky