Venice 0.751beta

nz.org.venice.analyser.gp
Class GeneticProgramme

java.lang.Object
  extended bynz.org.venice.analyser.gp.GeneticProgramme

public class GeneticProgramme
extends java.lang.Object

The Genetic Programme creates and breeds random paper trading individuals. This class runs the GP.

Author:
Andrew Leppard
See Also:
Individual, Mutator

Constructor Summary
GeneticProgramme(GPQuoteBundle quoteBundle, GPGondolaSelection GPGondolaSelection, OrderCache orderCache, TradingDate startDate, TradingDate endDate, Money initialCapital, Money stockValue, int numberStocks, Money tradeCost, int breedingPopulationSize, java.lang.String tradeValueBuy, java.lang.String tradeValueSell)
          Get ready to run the GP.
 
Method Summary
 Individual getBreedingIndividual(int index)
          Get one of the current generation's breeding individual.
 int getBreedingPopulationSize()
          Get the size of the current breeding population.
 int getNextBreedingPopulationSize()
          Get the size of the next generation's breeding population.
 int nextGeneration()
          Enter the next generation.
 void nextIndividual(Expression buyRule, Expression sellRule, int mutations)
          Run one iteration of the GP.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneticProgramme

public GeneticProgramme(GPQuoteBundle quoteBundle,
                        GPGondolaSelection GPGondolaSelection,
                        OrderCache orderCache,
                        TradingDate startDate,
                        TradingDate endDate,
                        Money initialCapital,
                        Money stockValue,
                        int numberStocks,
                        Money tradeCost,
                        int breedingPopulationSize,
                        java.lang.String tradeValueBuy,
                        java.lang.String tradeValueSell)
Get ready to run the GP.

Parameters:
quoteBundle - the historical quote data
GPGondolaSelection - UI containing user's desired expression probabilities
orderCache - cache of ordered symbols
startDate - start date of trading
endDate - last date of trading
initialCapital - initial capital in the portfolio
stockValue - the rough value of each stock holding
numberStocks - number of stocks in the portfolio
tradeCost - the cost of a trade
breedingPopulationSize - number of individuals that can breed
tradeValueBuy - value for buying a stock
tradeValueSell - value for selling a stock
Method Detail

nextIndividual

public void nextIndividual(Expression buyRule,
                           Expression sellRule,
                           int mutations)
Run one iteration of the GP. This will create a single valid individual.


nextGeneration

public int nextGeneration()
Enter the next generation.


getBreedingIndividual

public Individual getBreedingIndividual(int index)
Get one of the current generation's breeding individual.

Parameters:
index - of the breeding individual
Returns:
the breeding individual

getBreedingPopulationSize

public int getBreedingPopulationSize()
Get the size of the current breeding population.

Returns:
current breeding population size

getNextBreedingPopulationSize

public int getNextBreedingPopulationSize()
Get the size of the next generation's breeding population.

Returns:
future breeding population size

Venice 0.751beta