Presentation on theme: "Bioinspired Computing BEAST & Bacteria Overview David Gordon"— Presentation transcript:
Bioinspired Computing BEAST & Bacteria Overview David Gordon firstname.lastname@example.org
Excuses first Work in progress – loose ends, e.g. easy to crash the interface Some features are untested (none of them necessary for coursework) Documentation is a first draft (Almost) never been used by students (other than me)
Technologies, concepts & paradigms C++ Object-Oriented Programming (OOP) –Encapsulation –Multiple inheritance –Polymorphism Event-driven architectures Templates (generic programming) Standard Template Library (STL) Ironically, the aim of all this is to make it easy… You dont need to know about the above (except C++) but if you do itll help
How beast is organised World 2D arena where assessments go on Simulation Population As Group, but uses a GA on its contents Group Puts WorldObjects and Animats into Simulation GeneticAlgorithm MiceSimulation, ShrewSimulation WorldObject Animat Cheeses, Dots, Targets… Shrews, Mice… (Evo)FFNAnimat, (Evo)DNNAnimat Braitenbergs Evolver FeedForwardNet, DynamicalNet Built-in classes Custom classes Built-in classes you may never see A B A is used by B A B A inherits from B
The Simulation class Simulations are set up by inheriting from Simulation, adding Group s of WorldObject s (i.e. Cheese s), Population s of Animat s (i.e. Mice), and one or more GAs. Initialisation – persistent objects are set up, parameters for the GA, the number of Animat s, the objects in the World etc. Simulation is responsible for –Putting objects (Mice, Cheese s) into World –Letting them buzz around (e.g. collecting cheese) for a number of timesteps –Taking them out again and putting them through the GA –Repeating for a number of generations The Simulation object is like a lab technician, who sets up the simulation, then sits up all night repositioning robots and rerunning assessments until the simulation is complete.
Developing with beast Documentation at http://www.comp.leeds.ac.uk/ar23/BEAST/doc/ http://www.comp.leeds.ac.uk/ar23/BEAST/doc/ Tutorials, example code Ask in newsgroups C++ problems – use http://groups.google.comhttp://groups.google.com Problems: executables large, compile times slow –AR23 students now have extra space –Remove –O3 from Makefile until youre ready to run –Compile on cslin-gps (dont run on it though!) CPU limit –limit cputime unlimited – add to.cshrc
The bacteria model The bacteria are based on a complex mathematical model The BEAST implementation is a faithful reproduction of the mathematical model (sort of…) To use it, you dont need to know the details of either
Getting started New stuff is now available – download BEAST_project.tar.gz as before baccyexamples – demonstrate how bacteria move, swarm, use repellents, reproduce and use attractants bacteria – source code for Q3 of coursework
Two new classes Distribution –2D grid which covers the World –Models nutrients, chemoattractants and chemorepellents in a solution –Implements diffusion, so distribution dissolves over time Bacterium –Models groups of bacteria –Direction of movement depends on gradients detected in nutrient, attractant and repellent distributions –Can reproduce, swarm, sporulate and die –Properties are controlled by a big list of variables –Full description in bacteria.h or look in documentation Distribution EvoBacterium Animat WorldObject Bacterium
What Bacterium does 1 Eact timestep, each Bacterium absorbs some nutrient (if available) from its surroundings, and converts it into energy Then takes a look around: –Looks at the nutrient distribution and the repellent/attractant distributions (if available) –Looks at the other bacteria around it (depending on its swarmRadius )
What Bacterium does 2 Moves a little in a direction determined by the above information and a bunch of variables set within Bacterium When bacteria move or die, they leave a dot on another distribution object, called trail If the Bacterium is in a place with plenty of nutrient, it might release attractant If there is not enough nutrient, it might release repellent
What Distribution does Every frame, everything becomes a little more blurred/diffuse Diffusion speed can be changed in two ways – see code for details
Working with EvoBacterium Same as Bacterium, but with additional GetGenotype, SetGenotype and GetFitness functions for the GA Most stuff is commented out, so it basically doesnt work
How to do the coursework Disable/enable features (detailed in comments) Muck about with variables (speed, amount of nutrient, reproduction rate) Use a Genetic Algorithm…
How to create a fitness function GetFitness() Examples are in the code Possible metrics: –Number of offspring –Area covered –Distance from start –Amount of food eaten –Fractal dimension? Fitness function does not have to match real bacteria –Could an artificial fitness function produce better results than a realistic one?
Note: two sorts of reproduction Bacteria reproduce during the assessment –Offspring are identical, no mutation goes on A Genetic Algorithm will work on a population of bacteria between assessments –Reproduction and evolution quite different to actual bacterial evolution – e.g. crossover not present in asexual species –Fitness function can be anything you like
Pretty pictures Nutrient, attractant, repellent and trail distributions can be any colour (in comments) World can be any colour (also in comments) Save using import
Later this week… Demonstration session Wednesday 1pm Instructions for batch (coming up in newsgroup) Arrangements for computer availability over Easter (also coming up in newsgroup)
Your consent to our cookies if you continue to use this website.