Open Source Toolkit for Evolving Virtual Creatures
Animal objects have a physical body, a neural net, and "DNA" represented as an LParser object. Animal::build creates the animal in the simulator world based on its DNA. Animal unbuild removes the animal from the simulator world, preserving the DNA.
one or more animals simultaneously interacting long enough to determine their fitness.
match, needs the animal objects you with to evaluate and an object with a callback functions
"match start" (non-blocking) will do the evaluation and you'll get the fitness in the callback
Full example in SingleThreadEvaluatePopulation.tz
match = new VelocityMatch.
match init-with animal someAnimal.
match set-manager to o.
The object o must implement the method "on-match-end fitness f (double)". the on-match-end method will act as a callback, so it will be called as soon as the evaluation finishes. Match uses a callback rather than waiting for return because blocking would halt the simulation
Script (located in Grow.tz)
The script class high level methods.
- handles starting and stopping the simulation.
- reads command line arguments
You can specify any of the Script methods as a startup method my writing it as a command line argument. The startup will be called automatically when breve starts.
SingleThreadEvaluatePopulaton handles the sequencing of population mutation, evaluation, and rebirth.
- population mutation and rebirth -
The Population class contains members of the population and has methods for saving, loading, and generating a population randomly. Each animal of the population has a GenerativeLParser object that serves as DNA, and the details of mutation are defined in the GenerativeLParser class.
- evaluation -
The Match class handles evaluation. Current experiments involve one animal in each match. Eventually, matches will involve multiple animals interacting simultaneously. Any objects that the animal is to interact with should be created in the Match init method and freed in it's destroy function. You may extend the Match class to use your specific evaluation function. SinglePlayerPusherMatch is one example of a derived class to handle evaluation the block pusher. The match-class entry in the config.txt file specifies which class will be used for evaluation.
Copyright 2004 Richard J. P. Giuly