Class FitnessLandscape

java.lang.Object
  |
  +--FitnessLandscape

public class FitnessLandscape
extends java.lang.Object

This class is a program used to give an impression of the fitness landscape for sequential similarity measures. It reads a midi or MuseData file into a graph, constructs a number of sequential subgraphs, and slides them to the right, registering after each slide the fitness of a similarity statement with the sliding sequential subgraph in question as one half and another fixed, randomly chosen sequential subgraph as the other half. The registered fitness values are written to an output file in a format ready to use in GnuPlot.


Field Summary
static SeqSimMeasure simMeasure
          The sequential similarity measure used to evaluate the sequential similarity statements in writeNeighbourFitnessToFile().
 
Constructor Summary
FitnessLandscape()
           
 
Method Summary
static double euclideanDistance(int[] v1, int[] v2)
          Returns the Euclidean distance between two integer arrays.
static void main(java.lang.String[] args)
          Effects the main call to writeNeighbourFitnessToFile().
static int numOfFalse(boolean[] done)
          Counts and returns the number of false entries in the input boolean array.
static void writeAllDistancesToFile(java.util.Vector subs, java.lang.String outfilename, int size)
          Deprecated. This method isn't used any more. Use writeNeighbourFitnessToFile instead.
static void writeNeighbourFitnessToFile(MotherGraph piece, java.lang.String outfilename, int size)
          Creates sequential subgraphs of size "size", slides them through the graph representing the piece and writes the registered fitness values to an output file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

simMeasure

public static SeqSimMeasure simMeasure
The sequential similarity measure used to evaluate the sequential similarity statements in writeNeighbourFitnessToFile(). You should change the value of simMeasure if you want to use another similarity measure.

Constructor Detail

FitnessLandscape

public FitnessLandscape()
Method Detail

main

public static void main(java.lang.String[] args)
Effects the main call to writeNeighbourFitnessToFile(). Accepts command line parameters input file, output file, subgraphs size, and number of subgraphs.


writeNeighbourFitnessToFile

public static void writeNeighbourFitnessToFile(MotherGraph piece,
                                               java.lang.String outfilename,
                                               int size)
Creates sequential subgraphs of size "size", slides them through the graph representing the piece and writes the registered fitness values to an output file. This is where the main action in class FitnessLandscape happens.


numOfFalse

public static int numOfFalse(boolean[] done)
Counts and returns the number of false entries in the input boolean array.


writeAllDistancesToFile

public static void writeAllDistancesToFile(java.util.Vector subs,
                                           java.lang.String outfilename,
                                           int size)
Deprecated. This method isn't used any more. Use writeNeighbourFitnessToFile instead.


euclideanDistance

public static double euclideanDistance(int[] v1,
                                       int[] v2)
Returns the Euclidean distance between two integer arrays.