001 package org.jaga.definitions;
002
003
004 /**
005 * Basis for all Random Number Generators to be used in JAGA.
006 * JAGA uses an RNG specified in parameters rather the a system RNG. This
007 * allowes to reproduce results by specifying a predictable RNG (e.g. by
008 * using the same seed for the Java-RNG).
009 *
010 * <p><u>Project:</u> JAGA - Java API for Genetic Algorithms.</p>
011 *
012 * <p><u>Company:</u> University College London and JAGA.Org
013 * (<a href="http://www.jaga.org" target="_blank">http://www.jaga.org</a>).
014 * </p>
015 *
016 * <p><u>Copyright:</u> (c) 2004 by G. Paperin.<br/>
017 * This program is free software; you can redistribute it and/or modify
018 * it under the terms of the GNU General Public License as published by
019 * the Free Software Foundation, ONLY if you include a note of the original
020 * author(s) in any redistributed/modified copy.<br/>
021 * This program is distributed in the hope that it will be useful,
022 * but WITHOUT ANY WARRANTY; without even the implied warranty of
023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
024 * GNU General Public License for more details.<br/>
025 * You should have received a copy of the GNU General Public License
026 * along with this program; if not, write to the Free Software
027 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
028 * or see http://www.gnu.org/licenses/gpl.html</p>
029 *
030 * @author Greg Paperin (greg@jaga.org)
031 *
032 * @version JAGA public release 1.0 beta
033 */
034
035 public interface RandomGenerator {
036
037 public void setSeed(long seed);
038
039 public boolean nextBoolean();
040
041 public byte nextByte();
042 public byte nextByte(byte minInclusive, byte maxExclusive);
043
044 public int nextInt();
045 public int nextInt(int minInclusive, int maxExclusive);
046
047 public long nextLong();
048 public long nextLong(long minInclusive, long maxExclusive);
049
050 public float nextFloat();
051 public float nextFloat(float minInclusive, float maxExclusive);
052
053 public double nextDouble();
054 public double nextDouble(double minInclusive, double maxExclusive);
055
056 public double nextGaussian();
057 public double nextGaussian(double mean, double stdDev);
058 }