hcrypto.analyzer
Class FreqGaPopulation

java.lang.Object
  |
  +--hcrypto.analyzer.GaPopulation
        |
        +--hcrypto.analyzer.FreqGaPopulation

public class FreqGaPopulation
extends GaPopulation


Field Summary
static int N_SHUFFLES
           
static int NO_CHANGE_LIMIT
           
 
Fields inherited from class hcrypto.analyzer.GaPopulation
ciphertext, cleantext, cross_rate, CROSS_RATE, individual, IS_VERBOSE, MAX_GENERATIONS, maxtrials, mutate_rate, MUTATE_RATE, params, POPULATION_SIZE, size, TWEAK_ON, tweakingOn, verbose
 
Constructor Summary
FreqGaPopulation(java.lang.String text, GaParameters params)
          FreqGaPopulation() constructor
 
Method Summary
 void displayBest()
           
 void displaySummary()
           
 GaIndividual getFittest(int n)
           
 void init()
          This method initializes the analyzer.
 void run()
          This method implements the abstract run() method inherited from GaPopulation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_CHANGE_LIMIT

public static final int NO_CHANGE_LIMIT

N_SHUFFLES

public static final int N_SHUFFLES
Constructor Detail

FreqGaPopulation

public FreqGaPopulation(java.lang.String text,
                        GaParameters params)
FreqGaPopulation() constructor
Parameters:
text - -- the text to be cryptanalyzed
params - -- a collection of parameters to control the run
Method Detail

init

public void init()
This method initializes the analyzer. It sorts the tokens in the cryptogram to give preference to those with the smallest (non empty) pattern sets. It then creates the population, giving each individual an encryption key based on a pairing of a token from the cryptogram and a word from the pattern word dictionary.
Overrides:
init in class GaPopulation

run

public void run()
This method implements the abstract run() method inherited from GaPopulation.
Overrides:
run in class GaPopulation

getFittest

public GaIndividual getFittest(int n)
Overrides:
getFittest in class GaPopulation

displayBest

public void displayBest()

displaySummary

public void displaySummary()