|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Util.Utils
Constructor Summary | |
Utils()
|
Method Summary | |
static double[] |
averageVector(double[] x,
double[] y)
This function calculates the average values of 2 vectors(double arrays) |
static void |
beginLatexDocument(java.io.PrintWriter file,
java.lang.String title)
Function used at some point to output to a latex file |
static java.lang.String |
complement(java.lang.String s1,
java.lang.String s2)
Function returns the complement of a string |
static double |
distance(double[] x,
double[] y)
Calculates the Eucledian distance between two arrays. |
static double |
distance1(double[] x,
double[] y)
This function calculates distances between 2 arrays where the arrays can have wild-cards (values <0). |
static java.lang.String |
doubleArrayString(double[] x)
Function writes a double array to a string where each double only gets 5 places, cf. |
static java.lang.String |
doubleString(double x,
int l)
Function forms a string of a double value with a given string length. |
static void |
endLatexDocument(java.io.PrintWriter file)
Function used at some point to output to a latex file |
static void |
error(java.lang.String mess)
Error message. |
static int |
index(double x)
|
static int |
indexOf(java.util.List l,
IntArray a)
|
static int |
indexOfContainingElement(java.util.List l,
IntArray a)
|
static int |
indexOfPart(java.util.List l,
IntArray a)
|
static java.lang.String |
largestSubString(java.lang.String s1,
java.lang.String s2)
Returns the largest substring of two strings if the substring is either at the start or at the end of both strings and if the substring is not equal to either of the two strings. |
static void |
printGlobalLexicon(java.util.List lAgents,
java.io.PrintWriter lexFile,
char type,
int iter)
Function to print the 'global' lexicon |
static void |
printGrammar(java.util.List lAgents,
java.io.PrintWriter lexFile,
char type,
int iter)
Function to print the grammars of the entire population. |
static void |
printLexiconColumns(java.util.List lAgents,
java.io.PrintWriter lexFile,
char type,
int lg)
Function to write the lexicon in some format to the lexFile |
static void |
printLexiconLatexTabel(java.util.List lAgents,
java.io.PrintWriter lexFile,
char type,
int lg)
Function used at some point to output to a latex file |
static java.lang.String |
printStringArray(java.lang.String[] s)
|
static java.lang.String |
removeSubstring(java.lang.String s1,
java.lang.String s2)
Function to remove a string from another string |
static java.lang.String |
substring(java.lang.String s1,
java.lang.String s2)
This function is used to get the largest substring under certain conditions. |
static double |
variance(double[][] x,
int N,
int dim)
Function to calculate the average variance in the columns of a matrix. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Utils()
Method Detail |
public static double distance(double[] x, double[] y)
x
- double array 1y
- double array 2
public static double distance1(double[] x, double[] y)
x
- double array 1y
- double array 2
public static double[] averageVector(double[] x, double[] y)
x
- vector 1y
- vector 2
public static java.lang.String doubleArrayString(double[] x)
x
- the double array
public static java.lang.String doubleString(double x, int l)
x
- the double valuel
- the string length
public static void printGlobalLexicon(java.util.List lAgents, java.io.PrintWriter lexFile, char type, int iter)
public static void printGrammar(java.util.List lAgents, java.io.PrintWriter lexFile, char type, int iter)
public static void beginLatexDocument(java.io.PrintWriter file, java.lang.String title)
public static void endLatexDocument(java.io.PrintWriter file)
public static void printLexiconLatexTabel(java.util.List lAgents, java.io.PrintWriter lexFile, char type, int lg)
public static void printLexiconColumns(java.util.List lAgents, java.io.PrintWriter lexFile, char type, int lg)
public static java.lang.String removeSubstring(java.lang.String s1, java.lang.String s2)
s1
- string 1s2
- string 2
public static java.lang.String substring(java.lang.String s1, java.lang.String s2)
public static java.lang.String complement(java.lang.String s1, java.lang.String s2)
s1
- string 1s2
- string 2
public static java.lang.String largestSubString(java.lang.String s1, java.lang.String s2)
public static int indexOf(java.util.List l, IntArray a)
l
- a list of IntArraysa
- an IntArray
public static int indexOfPart(java.util.List l, IntArray a)
public static int indexOfContainingElement(java.util.List l, IntArray a)
public static void error(java.lang.String mess)
public static double variance(double[][] x, int N, int dim)
x
- the matrixN
- the number of columnsdim
- the number of rows
public static java.lang.String printStringArray(java.lang.String[] s)
public static int index(double x)
x
- a double value (between 0 and 1)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |