Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/project-web/dgpf/htdocs/scripts/datetime.php on line 7

Warning: Cannot modify header information - headers already sent by (output started at /home/project-web/dgpf/htdocs/scripts/datetime.php:7) in /home/project-web/dgpf/htdocs/scripts/init.php on line 28

Warning: Cannot modify header information - headers already sent by (output started at /home/project-web/dgpf/htdocs/scripts/datetime.php:7) in /home/project-web/dgpf/htdocs/scripts/init.php on line 29
Distributed Genetic Programming Framework
Logo
Distributed Genetic Programming Framework
print print


Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/project-web/dgpf/htdocs/scripts/datetime.php on line 16

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/project-web/dgpf/htdocs/scripts/datetime.php on line 16

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/project-web/dgpf/htdocs/scripts/datetime.php on line 16

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/project-web/dgpf/htdocs/scripts/datetime.php on line 16

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/project-web/dgpf/htdocs/scripts/datetime.php on line 16

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/project-web/dgpf/htdocs/scripts/datetime.php on line 16

File org.dgpf.gp.netvm.fitness.EnforceTransmissionPressure.java

Here you can find all the information about the file org.dgpf.gp.netvm.fitness.EnforceTransmissionPressure.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-08 11:53:00
 * Original Filename: org.dgpf.netvm.fitness.EnforceTransmissionPressure.java
 * Version          : 1.0.0
 * Last modification: 2006-07-08
 *                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.netvm.fitness;

import org.dgpf.gp.netvm.base.NetVM;
import org.dgpf.gp.netvm.base.NetVMContext;
import org.dgpf.gp.netvm.instructions.Send;
import org.dgpf.gp.vm.base.Program;
import org.dgpf.gp.vm.instructions.ctrl.Push;
import org.dgpf.search.api.FitnessData;
import org.dgpf.search.api.FitnessFunction;
import org.dgpf.search.api.SearchContext;


/**
 * The enforce transmission pressure fitness function is used to prevent programs
 * from using too much memory.
 *
 * @author Thomas Weise
 */

public class EnforceTransmissionPressure extends FitnessFunction<Program,
                                                 FitnessData<Program>>
  {
/**
 * The globally shared instance of the enforce transmission pressure fitness
 * function.
 */

  public  static  final FitnessFunction<Program, FitnessData<Program>>
    DEFAULT_INSTANCE = new EnforceTransmissionPressure(-1);

/**
 * Create a new enforce transmission pressure fitness function. 
 * @param p_precision   The precision of this fitness function. This is the
 *                      count of levels to be used for the calculation.
 *                      If this parameter is <= 0.0d, the full precision
 *                      available will be used.
 */

  public  EnforceTransmissionPressure(final double p_precision)
    {
    super(-1, p_precision);
    }

/**
 * This method is called when a simulation has come to an end.
 * You must use this method to store a fitness value into the fitness
 * record <code>p_fitness</code>. Use <code>set_fitness</code> for this.
 * @param p_fitness       The fitness data record that was used in this
 *                        simulation.
 * @param p_context       The context that has driven the simulation.
 * @see FitnessData#set_fitness(double)
 */

  @Override
  protected  final  void end_simulation(
                            final FitnessData<Program>    p_fitness,
                            final SearchContext<Program>  p_context)
    {
    NetVMContext l_c;
    int          l_i, l_j, l_k, l_cnt;
    double       l_d;
    NetVM        l_v;
    
    l_c   = ((NetVMContext)p_context);
    l_cnt = l_c.get_vm_count();
    l_j   = 0;    
    l_k   = 0;
    for(l_i = (l_cnt-1); l_i >= 0; l_i--)
      {
      l_v = l_c.get_vm(l_i);
      if(l_v.get_delivered() > 0L)        l_j++;
      if(l_v.get_successful_sends() > 0L) l_k++;
      }
    
    l_d = l_j;
    if(l_j >= l_cnt)
      {
      if(l_k >= l_cnt)
        {
        l_d += l_cnt;
        }
      else
        {
        if(l_k > 0) l_d += (1.0d / l_k); 
        }
      }
    
    p_fitness.set_fitness(l_d) ; 
    }

/**
 * Perform a sanity check if there is any use in simulating this individual.
 * @param p_individual  The individual to be sanity-checked.
 * @return  <code>true</code> if and only if the individual shall be
 *          evaluated, <code>false</code> to abort evaluation of the
 *          individual because it is wack for some reason.
 */

  @Override
  protected  final  boolean should_simulate (final Program p_individual)
    {
    int l_i;
    
    if(p_individual.get_count(Push.class) < 1) return false;
    l_i = p_individual.get_count(Send.class);    
    return ((l_i >= 1) && super.should_simulate(p_individual));
    }
  
/**
 * Returns a human readable name of this fitness function.
 * @return A human readable name of this fitness function.
 */

  @Override
  public  final  String  toString  ()
    {
    return "enforce transmissions";
    }
  }

File Information:

file name:EnforceTransmissionPressure.java
package:org.dgpf.gp.netvm.fitness
qualified name:org.dgpf.gp.netvm.fitness.EnforceTransmissionPressure.java
file type:Java Source File
download location:download http://dgpf.sourceforge.net/source/org/dgpf/gp/netvm/fitness/EnforceTransmissionPressure.java
size:4.595 KB (4706 B)
uploaded: 2018-01-07 12:03:34 GMT+0000
last update: 2006-08-22 11:00:10 GMT+0000
last access: 2018-01-07 12:03:34 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
Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/project-web/dgpf/htdocs/scripts/datetime.php on line 16

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/project-web/dgpf/htdocs/scripts/datetime.php on line 16
last modified at 2018-01-07 12:03:34 GMT+0000
Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/project-web/dgpf/htdocs/scripts/datetime.php on line 19

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/project-web/dgpf/htdocs/scripts/datetime.php on line 19
served at 2018-02-21 07:08:48 GMT+0000.
Valid CSS Valid XHTML 1.1
Valid RSS SourceForge.net Logo