Download presentation
Presentation is loading. Please wait.
Published byAmber Bruce Modified over 9 years ago
1
Data Structures Evolution of algorithms for an array-based stack, queue, and linked-list. Evolved data structures used to evolve solutions to problems. GP system performed better than the standard GP system with indexed memory.
2
The Push-Down Stack The push-down stack is an array-based stack. The first element pushed onto the stack stored in the array at the position equal to the maximum size of the stack. As successive elements are added onto the stack the stack pointer is decremented by one.
3
Stack Operations makenull - The stack pointer is assigned the value of the maximum size of the stack plus one so as to indicate that the stack is empty. empty - If the value of the stack pointer is not validthis method returns true otherwise it returns false. top - A copy of the element at the top of the stack is returned. pop - This method returns the element currently pointed to by the stack pointer, and increments the stack pointer by one. push - This method reduces the stack pointer by one and stores the element passed to it at this position.
4
The Genetic Programming System Objective: To simultaneously evolve the five algorithms for an integer, array-based push-down stack. Checks for stack overflow and underflow are not catered for. Each individual in the population is represented using a multi-tree genome. The genome consists of five parse trees representing each of the five stack operations. Primitives Constants: 0, 1 max : The maximum size of the stack. This is given a value of 10. arg1: The value to be pushed onto the stack. Arithmetic operators: +, - read and write aux, inc_aux, dec_aux and write_aux
5
The Genetic Programming System Fitness Cases: Four test sequences were used. Each test sequence consists of 40 calls to each of the five stack operations and requires a value to be returned at the end of each function call. The values pushed onto the stack were randomly selected in the range -1000...999. The number of function calls for which the same value is returned for each function call. The operations makenull and push are indirectly tested as they do not return a value. The score is automatically incremented by one for both these operations. Trees accessing an invalid memory location are penalised by stopping the evaluation and returning the fitness value calculated up until that point.
6
The Genetic Programming System Selection: Tournament selection with a tournament size of 4. Population Size: 1000 Generations: 101 Program Size: <= 250 Success Predicate: Fitness >= 160
7
Evolved Solution
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.