next up previous contents
Next: Class: Individual Up: Class: Algorithm Previous: Methods   Contents

Subsections

Attributes & Variables

Attributes marked with * must be defined in Algorithm::_init() for each new application/experiment.


TrainingSet*

Data type: STRING
Default: none
Defined in: Algorithm.pm
Mainly used in: loadData()
See also: TestingSet

This is the name of the file which contains the training data and is eventually passed to loadSet().


TestingSet*

Data type: STRING
Default: none
Defined in: Algorithm.pm
Mainly used in: loadData()
See also: TrainingSet

This is the name of the file which contains the testing data and is eventually passed to loadSet().


FitnessDirection*

Data type: STRING
Default: none
Defined in: Algorithm.pm
Mainly used in: tournament()
See also: WorstPossibleFitness

May take the values `up' or `down' depending how your fitness measure works. Set it to `up' if a big number means good fitness, and `down' otherwise.


WorstPossibleFitness

Data type: NUMBER
Default: 0 or 1e99
Defined in: TournamentGP.pm
Mainly used in: tournament(), calcFitnessFor()
See also: FitnessDirection

This is set automatically in TournamentGP::_init() if you don't provide a value for it. See Section 3.1.2.


Population

Data type: OBJECT
Default: none
Defined in: perlgp-run.pl
Mainly used in: tournament()
See also:

Each Algorithm object has a Population object, and this is where it is stored.


Tournament

Data type: NUMBER
Default: 1
Defined in: TournamentGP.pm
Mainly used in: run(), tournament()
See also: Tournaments

This variable contains the current tournament number. In the case of restarted runs, it is initialised to the value in the last line of `results/tournament.log' (see Table 1), otherwise it defaults to 1. It is incremented in run().


Tournaments

Data type: NUMBER
Default: 1000
Defined in: TournamentGP.pm
Mainly used in: run()
See also: Tournament

This is the number of tournaments that run() tries to run, regardless of the initial value of Tournament (in the case of a restart).


TournamentsSinceBest

Data type: NUMBER
Default: 0
Defined in: TournamentGP.pm
Mainly used in: tournament()
See also: BestFitness

This is a counter, like Tournament which is incremented every tournament, however this is reset to zero when a new best-of-run (fitness better than BestFitness) Individual is found.


BestFitness

Data type: NUMBER
Default: value of WorstPossibleFitness
Defined in: TournamentGP.pm
Mainly used in: tournament()
See also: WorstPossibleFitness

This variable holds the fitness of the best-of-run Individual and is used for checking to see when a new best-of-run Individual is found. On restarts it is reinitialised from `results/tournament.log'. The term ``best-of-run'' may not always mean exactly that; if for example the refresh() routine is used to dynamically change the training data.


TournamentSize

Data type: NUMBER
Default: 50
Defined in: TournamentGP.pm
Mainly used in: tournament()
See also: TournamentParents

The number of Individuals chosen for each tournament.


TournamentParents

Data type: NUMBER
Default: 20
Defined in: TournamentGP.pm
Mainly used in: makeFamilies()
See also: TournamentSize

The number of parents given the chance to reproduce during a tournament. It's a good idea if this is an even number, and is less than or equal to half of TournamentSize.


TournamentKillAge

Data type: NUMBER
Default: 2
Defined in: TournamentGP.pm
Mainly used in: tournament()
See also:

Individuals in a tournament which have taken part in TournamentKillAge or more tournaments are not sorted on fitness, but are automatically placed at the bottom of the list. This ensures constant turnover and is the opposite of elitism. If you find that your population is never ``getting off the ground'', consider raising this to 4 or maybe more. You can think of TournamentKillAge as the number of attempts allowed for each Individual to produce viable offspring.


AlwaysEvalFitness

Data type: BOOLEAN
Default: 0
Defined in: TournamentGP.pm
Mainly used in: tournament()
See also:

When true, forces re-evaluation of fitnesses every tournament (and does not take the value from memory to save time).


MateChoiceRandom

Data type: BOOLEAN
Default: 0
Defined in: TournamentGP.pm
Mainly used in: makeFamilies()
See also:

When true, the second parent (the first is always taken from the top of the fitness-sorted list of Individuals) is taken from a random position in the list, but this position is biased towards the top.


TournamentLogFile

Data type: STRING
Default: `results/tournament.log'
Defined in: TournamentGP.pm
Mainly used in: tournament()
See also: LogInterval

The name of the main log file.


LogInterval

Data type: NUMBER
Default: 10
Defined in: TournamentGP.pm
Mainly used in: tournament()
See also: TournamentLogFile, FitnessesFile, RecentTrainingOutputFile, RecentTestingOutputFile, RecentCodeFile

How often TournamentLogFile, FitnessesFile and some other log files are written.


FitnessesFile

Data type: STRING
Default: `results/fitnesses'
Defined in: TournamentGP.pm
Mainly used in: tournament()
See also: LogInterval

The log file where the sorted fitnesses of the Individuals in the last tournament are saved. The file does not contain the fitnesses of the Individuals older than TournamentKillAge.


ComplexityLogFile

Data type: STRING
Default: `results/complexity.log'
Defined in: TournamentGP.pm
Mainly used in: run()
See also: ComplexityInterval

The log file where population complexity information is saved.


ComplexityInterval

Data type: NUMBER
Default: 50
Defined in: TournamentGP.pm
Mainly used in: run()
See also: ComplexityLogFile

How often ComplexityLogFile is written.


RefreshInterval

Data type: NUMBER
Default: 0
Defined in: TournamentGP.pm
Mainly used in: run()
See also: refresh()

If non-zero, how often the refresh() method is called.


RecentTrainingOutputFile

Data type: STRING
Default: `results/recent.training.output'
Defined in: TournamentGP.pm
Mainly used in: tournament()
See also: LogInterval

The file where the training data output from the recent best-of-tournament Individual is written (using the saveOutput() method).


RecentTestingOutputFile

Data type: STRING
Default: `results/recent.testing.output'
Defined in: TournamentGP.pm
Mainly used in: tournament()
See also: LogInterval

The file where the testing data output from the recent best-of-tournament Individual is written (using the saveOutput() method).


RecentCodeFile

Data type: STRING
Default: `results/recent.pl'
Defined in: TournamentGP.pm
Mainly used in: tournament()
See also: LogInterval

The file where the Perl code of the recent best-of-tournament Individual is written.


BestTrainingOutputFile

Data type: STRING
Default: `results/best.training.output'
Defined in: TournamentGP.pm
Mainly used in: tournament()
See also:

The file where the training data output from the best-of-run Individual is written (using the saveOutput() method).


BestTestingOutputFile

Data type: STRING
Default: `results/best.testing.output'
Defined in: TournamentGP.pm
Mainly used in: tournament()
See also:

The file where the testing data output from the best-of-run Individual is written (using the saveOutput() method).


BestCodeFile

Data type: STRING
Default: `results/best.pl'
Defined in: TournamentGP.pm
Mainly used in: tournament()
See also:

The file where the Perl code of the best-of-run Individual is written.


KeepBest

Data type: BOOLEAN
Default: 1
Defined in: TournamentGP.pm
Mainly used in: tournament()
See also: KeepBestDir, KeepMax

If non-zero, all the best-of-run Individuals are saved in KeepBestDir.


KeepBestDir

Data type: STRING
Default: `results/keptbest'
Defined in: TournamentGP.pm
Mainly used in: tournament()
See also: KeepBest, KeepMax

The directory in which the complete history of best-of-run Individuals may be saved.


KeepMax

Data type: NUMBER
Default: 100
Defined in: TournamentGP.pm
Mainly used in: to0urnament()
See also: KeepBest, KeepBestDir

If non-zero, the maximum number of best-of-run Individuals saved in KeepBestDir. Older Individuals are removed when the limit is reached (to save disk space).


PopulationBackupInterval

Data type: NUMBER
Default: 0
Defined in: TournamentGP.pm
Mainly used in: run()
See also: environment variable PERLGP_POPS

If non-zero, how often is a tar.gz file of the complete population saved to the directory PERLGP_POPS.


EmigrateInterval

Data type: NUMBER
Default: 0
Defined in: TournamentGP.pm
Mainly used in: run()
See also:

If non-zero, how often Population::emigrate() is called on Population.


ImmigrateInterval

Data type: NUMBER
Default: 0
Defined in: TournamentGP.pm
Mainly used in: run()
See also:

If non-zero, how often Population::immigrate() is called on Population.


AlarmTime

Data type: NUMBER
Default: 0
Defined in: TournamentGP.pm
Mainly used in: calcFitnessFor()
See also: ForkForEval

If non-zero, the number of seconds that the system alarm() call is set for, before calling evaluateOutput(). This is a one-size-fits-all alarm time. If you want the alarm time to be proportional to the amount of training data you have, you can put alarm calls directly inside the loop (over data-points) in the evolved evaluateOutput() method. For example, in the sine demo in Section 9.2 you could put an alarm(1) just before ``begin evolved bit'' comment and an alarm(0) just after the ``end evolved bit'' comment.


ForkForEval

Data type: BOOLEAN
Default: 0
Defined in: TournamentGP.pm
Mainly used in: tournament()
See also: AlarmTime

When non-zero, forks the main process before calling evaluateOutput(). This can prevent nasty crashes with ``panic: leave scope inconsistency'' messages when you are using non-zero AlarmTime or other alarm() calls. Don't use it unless you get these errors.


next up previous contents
Next: Class: Individual Up: Class: Algorithm Previous: Methods   Contents
Bob MacCallum 2003-02-03