Logo
Distributed Genetic Programming Framework
print print

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

Here you can find all the information about the file org.dgpf.gp.vm.base.Conventions.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-08 08:31:19
 * Original Filename: org.dgpf.gp.vm.Conventions.java
 * Version          : 1.0.0
 * Last modification: 2006-06-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.vm.base;

/**
 * This internal class defines the conventions which go for the data types
 * of the virtual machine simulator.
 * Internally, we use java-<code>int</code>s which allow us 32 bits of
 * insanity. How these are handled is defined in this class.
 *
 * @author Thomas Weise
 */

public class Conventions
  {
/**
 * The integer representation of true. The automaton regards all non-zero
 * valued integers as being true, however, if you need to return a value
 * being specified as true, use this one.
 */

  public    static  final int     TRUE          = -1;
/**
 * The integer representation of false.
 */

  public    static  final int     FALSE         =  0;

/**
 * The prefix to procedures.
 */

  public    static  final char[]  PROC_PREFIX   = "procedure_".toCharArray();
  
/**
 * Create a conventions object.
 */

  protected Conventions ()
    {
    super();
    }


/**
 * Checks wether an integer argument evaluates to a positive (true) value.
 * @param p_arg   The integer argument to check.
 * @return  <code>true</code> if the arguments evaluates to a non-negative
 *          value.
 */

  public  static  final boolean is_true (final int p_arg)
    {
    return (p_arg != 0);
    }

/**
 * Checks wether an integer argument evaluates to a negative (false) value.
 * @param p_arg   The integer argument to check.
 * @return  <code>true</code> if the arguments evaluates to a negative
 *          value.
 */

  public  static  final boolean is_false (final int p_arg)
    {
    return (p_arg == 0);
    }
  
/**
 * Obtain a string representation of a memory access.
 * @param p_address   The address to be used.
 * @param p_relative  <code>true</code> if and only if the memory access
 *                    is relative, <code>false</code> if it is direct.
 * @param p_dest      The destination string builder.
 */

  public static final void mem_to_string(final int           p_address,
                                         final boolean       p_relative,
                                         final StringBuilder p_dest)
    {
    p_dest.append("mem[");
    if(p_relative) p_dest.append('[');
    p_dest.append(p_address);
    if(p_relative) p_dest.append(']');
    p_dest.append(']');
    }
  }

File Information:

file name:Conventions.java
package:org.dgpf.gp.vm.base
qualified name:org.dgpf.gp.vm.base.Conventions.java
file type:Java Source File
download location:download http://dgpf.sourceforge.net/source/org/dgpf/gp/vm/base/Conventions.java
size:3.350 KB (3431 B)
uploaded: 2015-07-22 04:10:56 GMT+0000
last update: 2006-07-24 11:31:19 GMT+0000
last access: 2017-11-23 05:19:00 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-23 05:19:00 GMT+0000.
Valid CSS Valid XHTML 1.1
Valid RSS SourceForge.net Logo