Logo
Distributed Genetic Programming Framework
print print

File org.dgpf.search.algorithms.hc.HCParameters.java

Here you can find all the information about the file org.dgpf.search.algorithms.hc.HCParameters.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-05-10 08:18:00
 * Original Filename: org.dgpf.search.algorithms.hc.HCParameters.java
 * Version          : 1.0.1
 * Last modification: 2006-05-28
 *                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.search.algorithms.hc;

import java.io.Serializable;

import org.dgpf.search.api.FitnessFunction;
import org.dgpf.search.api.SearchData;
import org.dgpf.search.api.SearchParameters;
import org.sfc.meta.MetaInformation;
import org.sfc.utils.Typesafe;

/**
 * The parameters of the hill climbing engine.
 * @param <Genotype> The genotype of the elements to be evolved.
 *
 * @author Thomas Weise
 */

public class HCParameters<Genotype extends Serializable>
                                   extends SearchParameters<Genotype>
  {
/**
 * The serial version uid.
 */

  private static final long serialVersionUID = 1;
  

/**
 * The meta information of the hill climbing parameter set.
 */

  public  static  final MetaInformation HC_PARAMETERS_METAINFO ;
  
  static
    {
    HCState.USE_REL_BEST.add_port(HCParameters.class, true, true, null);        
    HC_PARAMETERS_METAINFO = new MetaInformation();
    }
  
/**
 * This parameter is <code>true</code> if we use always the best individual
 * known of this search run, <code>false</code> if we use the best
 * individual of the last update instead.
 */

  private boolean m_use_rel_best  ; 
  
/**
 * Create a new hill climbing parameter set.
 * @param p_data  The search data to assign to.
 */

  public HCParameters (final SearchData p_data)
    {
    super(p_data);
    this.m_use_rel_best = HCUtils.DEFAULT_USE_REL_BEST;
    }

/**
 * Create a new hill climbing parameter set.
 * @param p_functions   The fitness functions to be applied in this
 *                      evolution.
 */

   public HCParameters(final FitnessFunction<Genotype,?>[]  p_functions)
     {
     this(p_functions.length);
     }

/**
 * Create a new hill climbing parameter set.
 * @param p_ff_count  The count of fitness functions evaluated by this
 *                    search.
 */

  public     HCParameters (final int p_ff_count)
    {
    super(p_ff_count);
    this.m_use_rel_best = HCUtils.DEFAULT_USE_REL_BEST;
    }


/**
 * Obtain whether we use always the best individual known of this search
 * runor if we use the best individual of the last update instead.
 * @return This parameter is <code>true</code> if we use always the best
 *         individual known of this search run, <code>false</code> if we
 *         use the best individual of the last update instead.
 */

  public  final boolean get_use_rel_best()
    {
    return this.m_use_rel_best;
    }
  
/**
 * Set whether we use always the best individual known of this search
 * runor if we use the best individual of the last update instead.
 * @param p_use_rel_best  This parameter is <code>true</code> if we use
 *                        always the best individual known of this search
 *                        run, <code>false</code> if we use the best
 *                        individual of the last update instead.
 */

  public  final void  set_use_rel_best(final boolean p_use_rel_best)
    {
    this.m_use_rel_best = p_use_rel_best;
    }
  

  
/**
 * Assign the internal data of this search data to the data of
 * another one.
 * @param p_data  The simulation data  to assign to.
 */

  @Override
  public void  assign  (final Object p_data)
    { 
    HCState<Genotype>  l_hcs;
    
    super.assign(p_data);
    
    if(p_data instanceof HCState)
      {
      l_hcs               = Typesafe.cast(p_data);
      this.m_use_rel_best = l_hcs.get_use_rel_best();
      }
    else
      {
      if(p_data instanceof HCParameters)
        {
        this.m_use_rel_best = ((HCParameters)p_data).m_use_rel_best;
        }
      }
    }
  }

File Information:

file name:HCParameters.java
package:org.dgpf.search.algorithms.hc
qualified name:org.dgpf.search.algorithms.hc.HCParameters.java
file type:Java Source File
download location:download http://dgpf.sourceforge.net/source/org/dgpf/search/algorithms/hc/HCParameters.java
size:4.702 KB (4815 B)
uploaded: 2015-07-22 04:10:59 GMT+0000
last update: 2006-05-28 13:50:13 GMT+0000
last access: 2017-11-22 07:30:53 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-23 07:18:30 GMT+0000.
Valid CSS Valid XHTML 1.1
Valid RSS SourceForge.net Logo