simuLCS
Class Utils

java.lang.Object
  extended bysimuLCS.Utils

public class Utils
extends java.lang.Object

Utility class. Save the coordinates of the mouse, contains functions for writing the performance files (gnuplot, rules, ...) and several small functions

Author:
Benoit

Field Summary
private  int coord_x
          Coordinates of the Cursor
private  int coord_y
           
 
Constructor Summary
Utils()
           
 
Method Summary
static javax.swing.ImageIcon createImageIcon(java.lang.String imageName)
          Returns an ImageIcon, or null if the path was invalid.
static java.lang.String getBitsFromValue(int val, int nbBits)
          Get the string of bits representing an int value
private static java.lang.String getLateXTable(AgentClassifierLearning a)
          Write the set of rules at the end using the LaTeX syntax to include it in a LaTeX file.
static int getValueFromBits(java.lang.String s)
          Get the int value represented in binary by a String of Bits Example : getValueFromBits("1101") = 13
 int mouseGetX()
           
 int mouseGetY()
           
 void mouseSetX(int x)
           
 void mouseSetY(int y)
           
static void writeFileGnuplot(java.lang.String fileBase, Entity[] en, java.lang.String type)
          Writes the gnuplot command file
static void writeFileWithRules(java.lang.String fileBase, Entity[] en)
          Writes a file with the rules remaining in the population for each agent at the end of the simulation, together with a LaTeX table to include it in a LaTeX file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

coord_x

private int coord_x
Coordinates of the Cursor


coord_y

private int coord_y
Constructor Detail

Utils

public Utils()
Method Detail

mouseSetX

public void mouseSetX(int x)

mouseSetY

public void mouseSetY(int y)

mouseGetX

public int mouseGetX()

mouseGetY

public int mouseGetY()

getValueFromBits

public static int getValueFromBits(java.lang.String s)
Get the int value represented in binary by a String of Bits Example : getValueFromBits("1101") = 13

Returns:
-1 if there is a # symbol, otherwise the int value

getBitsFromValue

public static java.lang.String getBitsFromValue(int val,
                                                int nbBits)
Get the string of bits representing an int value

Parameters:
val -
nbBits -
Returns:

writeFileGnuplot

public static void writeFileGnuplot(java.lang.String fileBase,
                                    Entity[] en,
                                    java.lang.String type)
Writes the gnuplot command file

Parameters:
fileBase -
en -
type -

getLateXTable

private static java.lang.String getLateXTable(AgentClassifierLearning a)
Write the set of rules at the end using the LaTeX syntax to include it in a LaTeX file.

Parameters:
a -
Returns:

writeFileWithRules

public static void writeFileWithRules(java.lang.String fileBase,
                                      Entity[] en)
Writes a file with the rules remaining in the population for each agent at the end of the simulation, together with a LaTeX table to include it in a LaTeX file

Parameters:
fileBase -
en -

createImageIcon

public static javax.swing.ImageIcon createImageIcon(java.lang.String imageName)
Returns an ImageIcon, or null if the path was invalid.