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

rinde.sim.util.SpeedConverter Maven / Gradle / Ivy

There is a newer version: 4.4.6
Show newest version
package rinde.sim.util;

/**
 * Simple speed converter
 * @author Bartosz Michalik 
 * @since 2.0
 */
public class SpeedConverter {
    double value = 0;

    public SpeedConverter from(double meters, TimeUnit per) {
        value = meters / per.toMs();
        return this;
    }

    public double to(TimeUnit per) {
        double result = value;
        value = 0;
        return result * per.toMs();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy