1 10 package org.jgap.impl; 11 12 import org.jgap.*; 13 import org.jgap.util.*; 14 15 22 public class HotBitsRandomGenerator 23 implements RandomGenerator { 24 25 private final static String CVS_REVISION = "$Revision: 1.2 $"; 26 27 private randomX m_randomGenerator; 28 29 public HotBitsRandomGenerator(randomX a_randomGenerator) { 30 m_randomGenerator = a_randomGenerator; 31 } 32 33 public randomX getRandomGenerator() { 34 return m_randomGenerator; 35 } 36 37 public byte nextByte() { 38 return m_randomGenerator.nextByte(); 39 } 40 41 public int nextInt() { 42 return m_randomGenerator.nextInt(); 43 } 44 45 public int nextInt(int ceiling) { 46 return m_randomGenerator.nextInt() % ceiling; 47 } 48 49 public long nextLong() { 50 return m_randomGenerator.nextLong(); 51 } 52 53 public double nextDouble() { 54 return m_randomGenerator.nextDouble(); 55 } 56 57 public float nextFloat() { 58 return m_randomGenerator.nextFloat(); 59 } 60 61 public boolean nextBoolean() { 62 return m_randomGenerator.nextBit(); 63 } 64 } 65 | Popular Tags |