You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
631 B
25 lines
631 B
package Model;
|
|
|
|
import static java.lang.Math.random;
|
|
|
|
public class GenerateurBorne implements StrategieDeGenerationDeTemperature {
|
|
private double temperatureMax;
|
|
private double temperatureMin;
|
|
|
|
|
|
public GenerateurBorne(){
|
|
this.temperatureMax=Double.MAX_VALUE;
|
|
this.temperatureMin=Double.MIN_VALUE;
|
|
}
|
|
|
|
public GenerateurBorne(double temperatureMax, double temperatureMin) {
|
|
this.temperatureMax = temperatureMax;
|
|
this.temperatureMin = temperatureMin;
|
|
}
|
|
|
|
|
|
public double generer() {
|
|
return Math.random() * ( temperatureMax - temperatureMin ) + temperatureMin;
|
|
}
|
|
}
|