Logo
Distributed Genetic Programming Framework
print print

File org.dgpf.search.algorithms.sa.p2p.P2PSAParameters.java

Here you can find all the information about the file org.dgpf.search.algorithms.sa.p2p.P2PSAParameters.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-06-05 13:27:42
 * Created by       : Stefan Niemczyk, Marc Kirchhoff
 * Original Filename: org.dgpf.search.algorithms.sa.p2p.P2PSAParameters.java
 * Version          : 1.0.1
 * Last modification: 2006-06-22
 *                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.sa.p2p;

import java.io.Serializable;

import org.dgpf.search.algorithms.sa.SAParameters;
import org.dgpf.search.api.Assigner;
import org.dgpf.search.api.FitnessFunction;
import org.dgpf.search.api.SearchData;
import org.dgpf.search.api.p2p.P2PParameters;
import org.dgpf.search.api.p2p.P2PSearchUtils;
import org.sfc.math.stochastic.Randomizer;
import org.sfc.meta.MetaInformation;
import org.sfc.utils.Typesafe;

/**
 * The parameters of the p2p-extended simulated annealing engine.
 * @param <Genotype> The genotype of the elements to be evolved.
 *
 * @author Stefan Niemczyk, Marc Kirchhoff
 */

public class P2PSAParameters<Genotype extends Serializable>
                                      extends SAParameters<Genotype>
{
/**
 * The serial version uid.
 */

  private static final long serialVersionUID = 1;
  
/**
 * The meta information of the p2p simulated annealing parameters.
 */

  public  static  final MetaInformation P2P_SA_PARAMETERS_METAINFO  ;
  
  static
    {
    P2PSearchUtils.P2P_PARAMETERS.add_port(
            P2PSAParameters.class, true, false, null);    
    P2P_SA_PARAMETERS_METAINFO = new MetaInformation();
    }
  
/**
 * The peer-to-peer-parameter set.
 */

  private final P2PParameters m_p2p_parameters;
  
/**
 * Create a new simulated annealing parameter set.
 * @param p_data  The search data to assign to.
 */

  public P2PSAParameters (final SearchData p_data)
    {
    super(p_data);
    this.m_p2p_parameters = new P2PParameters(this.get_fitness_function_count());
    }

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

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

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

  public     P2PSAParameters (final int p_ff_count)
    {
    super(p_ff_count);
    
    this.m_p2p_parameters = new P2PParameters(p_ff_count);
    }


  
/**
 * 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)
    { 
    P2PSAState<Genotype>  l_hcs;
    
    super.assign(p_data);
    
    if(p_data instanceof P2PSAState)
      {
      l_hcs               = Typesafe.cast(p_data);
      Assigner.assign(this.m_p2p_parameters, l_hcs.get_p2p_state());
      }
    else
      {
      if(p_data instanceof P2PSAParameters)
        {
        Assigner.assign(this.m_p2p_parameters,
                           ((P2PSAParameters)p_data).m_p2p_parameters);
        }
      }
    }
  

/**
 * Obtain the peer-to-peer parameters containing the control data of the
 * peer-to-peer node.
 * @return The peer-to-peer parameters containing the control data of the
 *         peer-to-peer node.
 */

  public  final P2PParameters get_p2p_parameters  ()
    {
    return this.m_p2p_parameters;
    }
  

/**
 * After setting the non-fitness-influencing parameters of this search
 * parameter set to the allowed maximum, call this method to alter the
 * configuration randomly.
 * @param p_r The randomizer to be used.
 */

  @Override
  public  void  configure_randomly  (final Randomizer p_r)
    {  
    this.get_p2p_parameters().configure_randomly(p_r);
    super.configure_randomly(p_r);
    }
  }

File Information:

file name:P2PSAParameters.java
package:org.dgpf.search.algorithms.sa.p2p
qualified name:org.dgpf.search.algorithms.sa.p2p.P2PSAParameters.java
file type:Java Source File
download location:download http://dgpf.sourceforge.net/source/org/dgpf/search/algorithms/sa/p2p/P2PSAParameters.java
size:4.728 KB (4842 B)
uploaded: 2015-07-22 04:10:59 GMT+0000
last update: 2006-08-22 13:26:19 GMT+0000
last access: 2017-11-20 02:16:16 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-20 02:16:16 GMT+0000.
Valid CSS Valid XHTML 1.1
Valid RSS SourceForge.net Logo