Logo
Distributed Genetic Programming Framework
print print

File org.dgpf.gp.vm.base.VMUtils.java

Here you can find all the information about the file org.dgpf.gp.vm.base.VMUtils.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-03 05:51:52
 * Original Filename: org.dgpf.gp.vm.base.VMUtils.java
 * Version          : 1.0.0
 * Last modification: 2006-07-03
 *                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.base;

import org.dgpf.gp.vm.instructions.arith.AddHandler;
import org.dgpf.gp.vm.instructions.arith.CompareHandler;
import org.dgpf.gp.vm.instructions.arith.DivHandler;
import org.dgpf.gp.vm.instructions.arith.ExchangeHandler;
import org.dgpf.gp.vm.instructions.arith.LoadCHandler;
import org.dgpf.gp.vm.instructions.arith.ModuloHandler;
import org.dgpf.gp.vm.instructions.arith.MulHandler;
import org.dgpf.gp.vm.instructions.arith.SetHandler;
import org.dgpf.gp.vm.instructions.arith.SetZeroFlagHandler;
import org.dgpf.gp.vm.instructions.arith.SubHandler;
import org.dgpf.gp.vm.instructions.ctrl.CallHandler;
import org.dgpf.gp.vm.instructions.ctrl.GotoHandler;
import org.dgpf.gp.vm.instructions.ctrl.PopHandler;
import org.dgpf.gp.vm.instructions.ctrl.PushCHandler;
import org.dgpf.gp.vm.instructions.ctrl.PushHandler;
import org.dgpf.search.api.utils.WeightedSetBuilder;
import org.sfc.utils.Typesafe;

/**
 * This class contains some utilities for the virtual machine simulator.
 *
 * @author Thomas Weise
 */

public final  class VMUtils
  {
/**
 * The default maximum frame count.
 */

  public static final int             DEFAULT_MAX_EXEC_COUNT  = 120;
/**
 * The default maximum memory frame size.
 */

  public static final int             DEFAULT_MAX_MEM_SIZE    = 10;
/**
 * The default minimum procedure count.
 */

  public static final int             DEFAULT_MIN_PROC_COUNT  = 1;
    
/**
 * The default instruction set.
 */

  public static final InstructionSet  DEFAULT_INSTRUCTION_SET ;

  
  static
    {
    WeightedSetBuilder<IInstructionHandler> l_sb;
    
    l_sb = new WeightedSetBuilder<IInstructionHandler>(
                                        IInstructionHandler.class);
    
    l_sb.add(AddHandler.INSTANCE,         1.0d);
    l_sb.add(CompareHandler.INSTANCE,     1.0d);
    l_sb.add(DivHandler.INSTANCE,         0.7d);
    l_sb.add(ExchangeHandler.INSTANCE,    0.7d);
    l_sb.add(SetHandler.INSTANCE,         1.0d);
    l_sb.add(LoadCHandler.INSTANCE,       1.0d);
    l_sb.add(ModuloHandler.INSTANCE,      0.7d);
    l_sb.add(MulHandler.INSTANCE,         0.7d);
    l_sb.add(SetZeroFlagHandler.INSTANCE, 0.5d);
    l_sb.add(SubHandler.INSTANCE,         1.0d);
    
    l_sb.add(CallHandler.INSTANCE,        0.5d);
    l_sb.add(GotoHandler.INSTANCE,        0.5d);
    l_sb.add(PopHandler.INSTANCE,         0.2d);
    l_sb.add(PushHandler.INSTANCE,        0.2d);
    l_sb.add(PushCHandler.INSTANCE,       0.2d);
    
    DEFAULT_INSTRUCTION_SET = new InstructionSet(l_sb);
    }
  
/**
 * No instance of this class is allowed to exist.
 */

  private VMUtils()
    {
    Typesafe.do_not_call();
    }
  }

File Information:

file name:VMUtils.java
package:org.dgpf.gp.vm.base
qualified name:org.dgpf.gp.vm.base.VMUtils.java
file type:Java Source File
download location:download http://dgpf.sourceforge.net/source/org/dgpf/gp/vm/base/VMUtils.java
size:3.764 KB (3855 B)
uploaded: 2015-07-22 04:10:56 GMT+0000
last update: 2006-07-16 06:47:16 GMT+0000
last access: 2017-11-20 19:08:04 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 19:08:04 GMT+0000.
Valid CSS Valid XHTML 1.1
Valid RSS SourceForge.net Logo