Class Utilities

java.lang.Object
  |
  +--Utilities

public class Utilities
extends java.lang.Object

Utilities is here for helpful stuff, like a random variable, and a random vector generator. All of the ideologies, tags, and positions are created randomly here.


Field Summary
static long[][] Pascal
          Pascal's triangle up to row 41 for use in tag visualization
static java.util.Random rand
          Gives us an random number generator to work with
 
Constructor Summary
Utilities()
           
 
Method Summary
static long[][] buildPascal(int N)
          Computes Pascal's triangle up to the number N
static double Sigmoid(double x)
          Computes the sigmoid function on a given input.
static int[] vectorConsist(int size, int modparam)
          Creates a vector with values within the bounds of the modparam that has consistent values around the value c.
static int[] vectorConsist(int size, int modparam, int c)
          Creates a vector with values within the bounds of the modparam that has consistent values around the value c.
static double[] vectorRand(int size)
          Creates a randomized double array
static int[] vectorRand(int size, int modparam)
          Creates a positive randomized int array
static int[] vectorRand(int size, int modparam, int c)
          Creates a positive randomized int array around a center int
static void waitHere(java.lang.String msg)
          Pauses the program until the user hits a key
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rand

public static java.util.Random rand
Gives us an random number generator to work with

Pascal

public static long[][] Pascal
Pascal's triangle up to row 41 for use in tag visualization
Constructor Detail

Utilities

public Utilities()
Method Detail

vectorRand

public static int[] vectorRand(int size,
                               int modparam)
Creates a positive randomized int array
Parameters:
size - the size of the array needed
modparam - the number of possible values
Returns:
returns the randomized int array

vectorRand

public static int[] vectorRand(int size,
                               int modparam,
                               int c)
Creates a positive randomized int array around a center int
Parameters:
size - the size of the array needed
modparam - the number of possible values
c - the center of the array
Returns:
returns the randomized int array

vectorRand

public static double[] vectorRand(int size)
Creates a randomized double array
Parameters:
size - the size of the array needed
Returns:
returns the randomized double array

vectorConsist

public static int[] vectorConsist(int size,
                                  int modparam)
Creates a vector with values within the bounds of the modparam that has consistent values around the value c. c is generated randomly on each calling
Parameters:
size - the size of the array needed
modparam - the number of possible values
Returns:
returns the consistent randomized int array

vectorConsist

public static int[] vectorConsist(int size,
                                  int modparam,
                                  int c)
Creates a vector with values within the bounds of the modparam that has consistent values around the value c. c comes from an outside paramater rather than within the method
Parameters:
size - the size of the array needed
modparam - the number of possible values
c - the center of the array
Returns:
returns the consistent randomized int array

Sigmoid

public static double Sigmoid(double x)
Computes the sigmoid function on a given input. Useful for laziness
Parameters:
x - the number for sigmoid calculation

buildPascal

public static long[][] buildPascal(int N)
Computes Pascal's triangle up to the number N
Parameters:
N - the depth of the triangle

waitHere

public static void waitHere(java.lang.String msg)
Pauses the program until the user hits a key
Parameters:
msg - a meaningless String for the keystroke