241 likes | 915 Views
Blocks World Problem. The CS Terminal. Specifies the block at the top of the stack. Example. CS evaluates to E. Note: Evaluates to nil if the stack is empty. The TB Terminal. Indicates which block on the stack is at the top of a number of correctly ordered blocks. Example:.
E N D
The CS Terminal • Specifies the block at the top of the stack. • Example CS evaluates to E Note: Evaluates to nil if the stack is empty.
The TB Terminal • Indicates which block on the stack is at the top of a number of correctly ordered blocks. • Example: Note: Evaluates to nil if the stack is empty or there are no correctly ordered blocks on the stack. TB evaluates to R
The NN Terminal • Indicates the next block from the table that must be placed on TB on the stack. • Example Note: Evaluates to nil if the table is empty or TB is nil and the stack is not empty. NN evaluates to E
The MB Operator • Takes a block label, X, as input. • If the block is on the table the block is moved to the top of the stack and a value of true is returned else a value of false is returned. • A value false is returned if: • The table is empty • X is already on the stack • X is nil
MB Example MB N
The MT Operator • Takes a block label, X, as an argument. • If X is on the stack the first element of the stack is moved to the table and a value of true is returned else a value of false is returned. • A value of false is returned if • The stack is empty. • If X is already on the table. • If X is nil.
MT Example MT S
The DU Operator • This function takes two arguments. • The first represents the code that must be executed for a number of iterations. • The second is a condition specifying when the iteration must stop. • Maximum number of iterations per individual: 100 • Maximum number of iterations per DU instance: 25 • This function returns a value of true if the entire loop is performed and is not terminated due to either of the limits being exceeded otherwise it returns a value of false.
Other Operators • NOT • Takes a single argument and performs the function of the logical not. • If its argument is a block label returns a value of true if the label is nil. • EQ • Takes two arguments and performs the function of the logical equal.
Fitness cases • Ten cases consisting of 0 to nine blocks already in the correct order. • Eight fitness cases where there is exactly one block in the wrong order on top of the remaining correctly ordered blocks on the stack. • A hundred and forty eight cases where 0 - 8 blocks are correctly ordered in the stack and the a random number in the interval 2-8 blocks out-of-order on the stack.
Summary of GP Parameters • Function to generate:Induce program that implements a plan to add blocks to a stack so that it spells UNIVERSAL. • Terminal set: T = {CS, TB, NN } • Function set: F = {MS, MT, DU, NOT, EQ} • Number of generations:51 • Population size:500 • Raw fitness:The number of fitness cases for which the stack is correctly constructed.
Summary of GP Parameters • Hits criterion: Same as raw fitness • Method of selection:Fitness proportionate selection. • Initial population generator:The ramped half-and-half method with an initial tree depth of six and a depth limit of seventeen on the size of trees created by the genetic operators. • Genetic Operators • Crossover - 90% • Reproduction - 10%