Logo
Distributed Genetic Programming Framework
print print

File org.dgpf.search.api.p2p.P2PStateBag.java

Here you can find all the information about the file org.dgpf.search.api.p2p.P2PStateBag.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-04-26 05:11:02
 * Original Filename: org.dgpf.search.api.p2p.P2PStateBag.java
 * Version          : 2.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.api.p2p;

import java.io.Serializable;

import org.sfc.math.stochastic.statistics.StatisticInfoBag;

/**
 * This class represents an extension to all search state bags that use the
 * searches p2p node. It is the only way to create a p2p search state, 
 *
 * @author Thomas Weise
 */

public class P2PStateBag  implements  Serializable
  {
/**
 * The serial version uid.
 */

  private static final long serialVersionUID = 1;

/**
 * The p2p state object internally hosted.
 */

  final P2PState            m_state ;
  
/**
 * The internal immigrant statistic bags which need to be updated whenever
 * an update is completed.
 */

  final StatisticInfoBag[]  m_immigrant_stat  ;  
  
/**
 * Create a new p2p state bag.
 * @param p_ff_count  The count of fitness functions to be applied.
 */

  public  P2PStateBag(final int p_ff_count)
    {
    super();
    
    StatisticInfoBag[]  l_i;
    int                 l_j;

    this.m_immigrant_stat = l_i = new StatisticInfoBag[p_ff_count];

    for(l_j = (p_ff_count-1); l_j >= 0; l_j--)
      {
      l_i[l_j] = new StatisticInfoBag();
      }
    
    this.init(p_ff_count);
    this.m_state = this.create_state(p_ff_count);
    }
  
/**
 * Obtain the p2p state internally hosted.
 * @return The p2p state internally hosted.
 */

  public  final P2PState  unpack()
    {
    return this.m_state;
    }
  
/**
 * Obtain a statistic info bag for the immigrant statistics.
 * @return  The statistic info bag for the 
 *          fitness functions of the immigrant statistics. 
 */

  public  final StatisticInfoBag[]  get_immigrant_stat  ()
    {
    return this.m_immigrant_stat;
    }
  
/**
 * Update the count of killed immigrants.
 * @param p_int The count of immigrants killed in this update.
 */

  public  final void update_killed(final int p_int)
    {
    this.m_state.update_killed(p_int);
    }
  
/**
 * This method allows you to perform additional initialization before
 * the hosted search state will be created.
 * @param p_ff_count  The count of fitness functions evaluated by this
 *                    search.
 */

  protected void  init  (int  p_ff_count)
    {
    //
    }
  
/**
 * Create the p2p-state internally hosted. You may override this method to
 * provide an extended version of the p2p state.
 * @param p_ff_count  The count of fitness functions to be applied.
 * @return  An instance of <code>P2PState</code>.
 */

  protected P2PState  create_state(final int p_ff_count)
    {
    return new P2PState(p_ff_count, this);
    }
  }

File Information:

file name:P2PStateBag.java
package:org.dgpf.search.api.p2p
qualified name:org.dgpf.search.api.p2p.P2PStateBag.java
file type:Java Source File
download location:download http://dgpf.sourceforge.net/source/org/dgpf/search/api/p2p/P2PStateBag.java
size:3.659 KB (3747 B)
uploaded: 2015-07-22 04:11:00 GMT+0000
last update: 2006-05-28 13:52:06 GMT+0000
last access: 2017-11-18 04:42:09 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-19 02:52:59 GMT+0000.
Valid CSS Valid XHTML 1.1
Valid RSS SourceForge.net Logo