All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.cilib.util.selection.WeightedObject Maven / Gradle / Ivy

/**           __  __
 *    _____ _/ /_/ /_    Computational Intelligence Library (CIlib)
 *   / ___/ / / / __ \   (c) CIRG @ UP
 *  / /__/ / / / /_/ /   http://cilib.net
 *  \___/_/_/_/_.___/
 */
package net.sourceforge.cilib.util.selection;

/**
 *
 */
public class WeightedObject implements Comparable {

    private final Object object;
    private final double weight;

    public WeightedObject(Object object, double weight) {
        this.object = object;
        this.weight = weight;
    }

    public Object getObject() {
        return object;
    }

    public double getWeight() {
        return weight;
    }

    @Override
    public int compareTo(WeightedObject o) {
        return Double.compare(weight, o.weight);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy