Logo
Distributed Genetic Programming Framework
print print

File org.dgpf.gp.regression.search.MutationInfo.java

Here you can find all the information about the file org.dgpf.gp.regression.search.MutationInfo.java. You may explore it here or download it onto your local disk.
/*
 * Copyright (c) 2006 Thomas Weise
 * 
 * E-Mail           : tweise@gmx.de
 * Creation Date    : 2006-07-25 10:41:43
 * Original Filename: org.dgpf.gp.regression.search.MutationInfo.java
 * Version          : 1.0.0
 * Last modification: 2006-07-25
 *                by: Thomas Weise
 * 
 * License          : GNU LESSER GENERAL PUBLIC LICENSE
 *                    Version 2.1, February 1999
 *                    You should have received a copy of this license along
 *                    with this library; if not, write to the Free Software
 *                    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *                    MA 02111-1307, USA or download the license under
 *                    http://www.gnu.org/copyleft/lesser.html.
 *                    
 * Warranty         : This software is provided "as is" without any
 *                    warranty; without even the implied warranty of
 *                    merchantability or fitness for a particular purpose.
 *                    See the Gnu Lesser General Public License for more
 *                    details.
 */

 
package org.dgpf.gp.regression.search;

import org.sfc.math.stochastic.Randomizer;


/**
 * This class holds information that might be needed during mutation.
 *
 * @author Thomas Weise
 */

public class MutationInfo
  {
/**
 * This integer denotes the current depth.
 */

  private       int               m_depth ;
/**
 * The depth value.
 */

  private       double            m_depth_d;
  
/**
 * The variable count.
 */

                int               m_vc;
  
/**
 * Create a new mutation info record.
 */

  public  MutationInfo  ()
    {
    super();
    }
  
  
/**
 * Check whether a non-terminal expression may be created.
 * @param p_r The randomizer to be used.
 * @return  <code>true</code> if and only if a non-terminal expression may
 *          be created.
 */

  public  final boolean can_non_terminal (final Randomizer p_r)
    {
    return (p_r.nextDouble() < this.m_depth_d);
    }
  
/**
 * Begin a new expression.
 */

  public  final void  begin_expression()
    {
    this.m_depth   = 1;
    this.m_depth_d = 2.0d;
    }
  
/**
 * Increase the current depth.
 */

  public  final void  down()
    {
    this.m_depth--;
    this.m_depth_d = Math.pow(1.7d, this.m_depth);
    }
  
/**
 * Decrease the current depth.
 */

  public  final void  up()
    {
    this.m_depth++;
    this.m_depth_d = Math.pow(1.7d, this.m_depth);
    } 
  
/**
 * Obtain the variable count.
 * @return The variable count.
 */

  public  final int get_variable_count()
    {
    return this.m_vc;
    }
  }

File Information:

file name:MutationInfo.java
package:org.dgpf.gp.regression.search
qualified name:org.dgpf.gp.regression.search.MutationInfo.java
file type:Java Source File
download location:download http://dgpf.sourceforge.net/source/org/dgpf/gp/regression/search/MutationInfo.java
size:2.645 KB (2709 B)
uploaded: 2015-07-22 04:10:56 GMT+0000
last update: 2006-08-07 11:49:38 GMT+0000
last access: 2017-11-17 21:14:36 GMT+0000

statistics online since 2006-01-02.   RSS Feed
Contact us by sending an email to tweise@gmx.de to receive further information, to report errors, or to join our project.
All content on this site (http://dgpf.sourceforge.net/) is LGPL-licensed.
http://dgpf.sourceforge.net/scripts/source/source.php last modified at 2015-07-22 04:10:53 GMT+0000 served at 2017-11-17 21:14:36 GMT+0000.
Valid CSS Valid XHTML 1.1
Valid RSS SourceForge.net Logo