Logo
Distributed Genetic Programming Framework
print print

File org.dgpf.gp.vm.instructions.BasicCosts.java

Here you can find all the information about the file org.dgpf.gp.vm.instructions.BasicCosts.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-26 08:58:13
 * Original Filename: org.dgpf.gp.vm.instructions.BasicCosts.java
 * Version          : 1.0.0
 * Last modification: 2006-06-26
 *                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.vm.instructions;


/**
 * The default costs for operations.
 *
 * @author Thomas Weise
 */

public class BasicCosts
  {
/**
 * The default cost unit.
 */

  public    static  final double  DEFAULT_COSTS = 1.0d;
  
/**
 * The costs of loading a constant.
 */

  public    static  final double  LOAD_C_COSTS  = DEFAULT_COSTS;
  
/**
 * The costs of setting, clearing or toggling a flag.
 */

  public    static  final double  SET_FLAG_COSTS  = DEFAULT_COSTS;
/**
 * The costs for setting one variable to the value of another one.
 */

  public    static  final double  SET_COSTS     = (DEFAULT_COSTS * 1.1d);
  
/**
 * The costs for exchanging two numbers.
 */

  public    static  final double  XCHG_COSTS    = (2d * SET_COSTS);  
/**
 * The costs for adding two numbers.
 */

  public    static  final double  ADD_COSTS     = (1.1d * XCHG_COSTS);
  
/**
 * The costs for subtracting two numbers.
 */

  public    static  final double  SUB_COSTS     = ADD_COSTS;
  
/**
 * The costs for comparing two numbers.
 */

  public    static  final double  CMP_COSTS     = SUB_COSTS;
  
/**
 * The costs for multiplying two numbers.
 */

  public    static  final double  MUL_COSTS     = (ADD_COSTS * 3.0d);
  
/**
 * The costs for dividing two numbers.
 */

  public    static  final double  DIV_COSTS     = (MUL_COSTS * 1.5d);
  
/**
 * The costs for computing the modulo of two numbers.
 */

  public    static  final double  MOD_COSTS     = (DIV_COSTS + SUB_COSTS);
  
/**
 * The costs for pushing a constant onto the stack.
 */

  public    static  final double  PUSH_C_COSTS  = (LOAD_C_COSTS * 1.01);
    
/**
 * The costs for pushing the value stored in a memory cell onto the stack.
 */

  public    static  final double  PUSH_COSTS    = (PUSH_C_COSTS * 1.3);
  
/**
 * The costs popping from the stack into a memory cell.
 */

  public    static  final double  POP_COSTS     = PUSH_COSTS;
/**
 * The costs for an unconditional jump.
 */

  public    static  final double  JUMP_COSTS    = (LOAD_C_COSTS + ADD_COSTS);
/**
 * The costs for a conditional jump.
 */

  public    static  final double  COND_JUMP_COSTS = (JUMP_COSTS + ADD_COSTS);
/**
 * The costs for calling a procedure.
 */

  public    static  final double  CALL_COSTS    = ((7.0d*PUSH_COSTS) +
                                                         JUMP_COSTS);
  }

File Information:

file name:BasicCosts.java
package:org.dgpf.gp.vm.instructions
qualified name:org.dgpf.gp.vm.instructions.BasicCosts.java
file type:Java Source File
download location:download http://dgpf.sourceforge.net/source/org/dgpf/gp/vm/instructions/BasicCosts.java
size:3.464 KB (3548 B)
uploaded: 2015-07-22 04:10:56 GMT+0000
last update: 2006-07-16 06:40:30 GMT+0000
last access: 2017-11-20 18:53:03 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 18:53:03 GMT+0000.
Valid CSS Valid XHTML 1.1
Valid RSS SourceForge.net Logo