Clover coverage report - JGAP 3.1
Coverage timestamp: Mo Dez 11 2006 21:16:18 CET
file stats: LOC: 50   Methods: 1
NCLOC: 14   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
StockRandomGenerator.java - 100% 100% 100%
coverage
 1    /*
 2    * This file is part of JGAP.
 3    *
 4    * JGAP offers a dual license model containing the LGPL as well as the MPL.
 5    *
 6    * For licencing information please see the file license.txt included with JGAP
 7    * or have a look at the top of class org.jgap.Chromosome which representatively
 8    * includes the JGAP license policy applicable for any file delivered with JGAP.
 9    */
 10    package org.jgap.impl;
 11   
 12    import java.io.*;
 13    import java.util.*;
 14   
 15    import org.jgap.*;
 16   
 17    /**
 18    * The stock random generator uses the java.util.Random class to
 19    * provide a simple implementation of the RandomGenerator interface.
 20    * No actual code is provided here.
 21    *
 22    * @author Neil Rotstan
 23    * @author Klaus Meffert
 24    * @since 1.0
 25    */
 26    public class StockRandomGenerator
 27    extends Random
 28    implements RandomGenerator {
 29    /** String containing the CVS revision. Read out via reflection!*/
 30    private final static String CVS_REVISION = "$Revision: 1.5 $";
 31   
 32    /**
 33    * When deserializing, initialize the seed because otherwise we could get
 34    * duplicate evolution results when doing distributed computing!
 35    *
 36    * @param a_inputStream the ObjectInputStream provided for deserialzation
 37    *
 38    * @throws IOException
 39    * @throws ClassNotFoundException
 40    *
 41    * @author Klaus Meffert
 42    * @since 3.01
 43    */
 44  13 private void readObject(ObjectInputStream a_inputStream)
 45    throws IOException, ClassNotFoundException {
 46    //always perform the default de-serialization first
 47  13 a_inputStream.defaultReadObject();
 48  13 setSeed(System.currentTimeMillis());
 49    }
 50    }