1 10 package org.jgap.impl; 11 12 import java.io.*; 13 import java.util.*; 14 15 import org.jgap.*; 16 import org.jgap.util.*; 17 18 27 public class StockRandomGenerator 28 extends Random 29 implements RandomGenerator, ICloneable, Comparable { 30 31 private final static String CVS_REVISION = "$Revision: 1.7 $"; 32 33 45 private void readObject(ObjectInputStream a_inputStream) 46 throws IOException, ClassNotFoundException { 47 a_inputStream.defaultReadObject(); 49 setSeed(System.currentTimeMillis()); 50 } 51 52 58 public Object clone() { 59 StockRandomGenerator result = new StockRandomGenerator(); 60 result.setSeed(System.currentTimeMillis()); 61 return result; 62 } 63 64 71 public int compareTo(Object a_other) { 72 if (a_other.getClass().equals(getClass())) { 73 return 0; 74 } 75 else { 76 return getClass().getName().compareTo(a_other.getClass().getName()); 77 } 78 } 79 } 80 | Popular Tags |