GADirectedGraph is a special subclass of GeneticAlgorithmIndividual which maages directed networks of nodes for evolution. The primary use of these networks is to evolve creature morphologies. The networks are based on the the directed graphs used by Karl Sims in "Evolving Virtual Creatures" (1994). Multiple connections may exist between nodes, and nodes may have connections back to themselves.GAGraph makes use of a number of other classes. The GAGraph itself holds a reference to the graph's root node, which is an object of GADirectedGraphNode. This root node may be connected directly or indirectly to any other number of GADirectedGraphNode objects, using the connection class GADirectedGraphConnection.
Because GADirectedGraphNode and GADirectedGraphConnection are intended to be used as general evolutionary objects, it is often neccessary to associate a set of parameters with these objects, above and beyond the information coded in the connected graph. For this reason, both classes are subclasses of an object which can hold a list of parameters, GADirectedGraphParameterObject.
GADirectedGraphParameterObject holds a list of float values between -1.0 and 1.0. These parameters can be interpreted in whatever way the user desires. In the example of directed graphs being used to specify creature morphologies, the parameters hold information about the size and orientation of limbs relative to one another.
Copies the contents of the directed graph other.
Sets this child's genome to be a genetic crossover of p1 and p2.
Deletes the root node and all connected objects. This method "clears" the GADirectedGraph so that it may be reused.
Returns the root node of the directed graph.
Mutates the directed graph.
Prints out a text representation of the network.
Randomizes this genome by creating a directed graph containing up to nMax nodes. Sets the number of node and connection parameters to np and cp, respectively. The optional connection probability, p, specifies the probability that a connection will be made from one node to another.