GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Algorithm::Evolutionary::Individual::Tree(3) User Contributed Perl Documentation Algorithm::Evolutionary::Individual::Tree(3)

Tree - A Direct Acyclic Graph, or tree, useful for Genetic Programming-Style stuff

    use Algorithm::Evolutionary::Individual::Tree;
    #Hash with primitives, arity, and range for constants that multiply it

    my $primitives = { sum => [2, -1, 1],
                                   multiply => [2, -1, 1],
                                   substract => [2, -1, 1],
                                   divide => [2, -1, 1],
                                   x => [0, -10, 10],
                                   y => [0, -10, 10] };

    my $indi = new Algorithm::Evolutionary::Individual::Tree $primitives, 5 ; # Build random tree with knwo primitives
                                           # and depth up to 5

    my $indi5 = $indi->clone(); #Creates a copy of the individual

    print $indi3->asString(); #Prints the individual
    print $indi3->asXML() #Prints it as XML. See L<XML> for more info on this

Algorithm::Evolutionary::Individual::Base

Tree-like individual for genetic programming. Uses direct acyclic graphs as representation for trees, which is very convenient. This class has not been tested extensively, so it might not work.

Creates a new tree using a primitives hashref, max depth, and a ref-to-fitness

Sets values of an individual; takes a hash as input

Assigns random values to the elements

Probably useless, in this case. To be evolved.

Similar to a copy ctor: creates a new individual from another one

Prints it

Prints a node

Internal subrutine: closes node parenthesis

Returns the tree, which is atomic by itself. Cannot be used as lvalue

Prints it as XML. It prints the tree as String, which does not mean you will be able to get it back from this form. It's done just for compatibity, reading from this format will be available. In the future.

Dummy sub

Print the list of lists that composes the tree, using prefix notation

Grows a random tree, with primitives as indicated, and a certain depth. Depth defaults to 4

Returns 1, since it's got only 1 Atom

  This file is released under the GPL. See the LICENSE file included in this distribution,
  or go to http://www.fsf.org/licenses/gpl.txt

  CVS Info: $Date: 2009/07/28 11:30:56 $ 
  $Header: /media/Backup/Repos/opeal/opeal/Algorithm-Evolutionary/lib/Algorithm/Evolutionary/Individual/Tree.pm,v 3.1 2009/07/28 11:30:56 jmerelo Exp $ 
  $Author: jmerelo $ 
  $Revision: 3.1 $
  $Name $
2014-10-25 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.