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

toxgene.core.random.ToxConstant Maven / Gradle / Ivy

/**
 * Implements a "random" generator for a discrete probability distribution
 * for which a single value has all the probability mass.
 *
 * @author Denilson Barbosa
 * @version 0.1
 */

package toxgene.core.random;

public class ToxConstant implements ToxRandom{
  private float value;
  private long longValue;
  
  public ToxConstant(float value){
		this.value = value;
		this.longValue = Math.round((double)value);
  }

  public long nextInt(){
		return longValue;
  }
	
  public float nextFloat(){
		return value;
  }
	
  public float minValue(){
		return value;
  }
	
  public float maxValue(){
		return value;
  }
	
  public long nextInt(float value){
		return longValue;
  }  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy