*Experts* Merrion Posted April 16, 2003 *Experts* Posted April 16, 2003 An evolutionary computing framework is one that facilitates the principles of evolution for solving problems. The main players are: IEnvironment - The interface that defines the environment of the problem. The environment is responsible for defining the viability of individuals. IPopulation is a type safe collection class with additional methods for querying the population as a whole (such as the average viability and viability spread etc.) and affecting it (culling). IIndividual is a single individual that represents a possible solution in the problem. An individual has a set of genes that define it's solution to the problem space and individuals may breed which will result in offspring with genes selected at random from each parent. IGene represents a parameter that affects a part of the solution. For example, suppose we have a chess board with a game in play and want to select the best next move. Our class that inherits IEnvironment needs to supply a method that returns the viability of an individual - i.e. how sensible a move is. Genes are created that specify which piece to move and which of it's possible end positions to chose. The population is seeded with a random set of individuals with a random mix of these genes. The population is allowed to breed and then the bottom half are culled. This process is repeated a number of times until the population has a zero (or prechosen very low) viability spread. An individual in this population fits our best move. The power of this framework is that it can be mapped to a huge range of problems by setting the environment and genes and the same underlying processes can be used to solve these problems. Anyway - that is where I have got to. Any thoughts? Quote Printer Monitor for .NET? - see Merrion Computing Ltd for details
Leaders quwiltw Posted April 16, 2003 Leaders Posted April 16, 2003 Any thoughts? Yep. You've successfully confused me:) Maybe you could either enhance your example, specifically to show how the IGene is related. If you have an idea of what the methods are on these interfaces, it'd probably give more insight into what you're getting at too. Quote --tim
*Experts* Merrion Posted April 16, 2003 Author *Experts* Posted April 16, 2003 Yep. You've successfully confused me It's a good start. OK - the environment determines the health of the individual. In the real world of evolution for example if the individual is a short-legged zebra then the environment will cause it to be eaten by lions. Interface IEnvironment Sub CalculateIndividualsViability(Individual As IIndividual) Readonly Property Population() As IPopulation End Iterface When an individual is passed to this subroutine it can either be passed as viable or killed off as being unviable. ... *goes off to seek stronger coffee....* Quote Printer Monitor for .NET? - see Merrion Computing Ltd for details
Leaders quwiltw Posted April 16, 2003 Leaders Posted April 16, 2003 So an IIndividual has, say, a collection of attributes (IGenes?) which mean little until they are introduced into the IEnvironment. At which time the attributes can be inspected for those that are considered "weaknesses/strengths" for that particular environment, which will ultimately determine whether it can survive in the environment based on some environmental threshold? Wouldn't there have to be a collection of IPopulations in the IEnvironment? Am I totally missing you? Quote --tim
*Experts* Merrion Posted April 16, 2003 Author *Experts* Posted April 16, 2003 At the moment I only envisage one population which is a collection of like typed individuals, because until I have that sorted there is no way I will be able to work out any predator-prey type interactions between populations. OK - the individual has a collection of genes. Each gene has a value and a name and affects one aspect of the problem space. All individuals have the same set of genes by name, but perhaps different values. When two individuals breed (probably implemented by IPopulation as it doesn't make sense for individuals to be in charge of their own breeding - or does it?) then the offspring has a gene pool that contains genes randomly selected from either parent (plus a random error factor determined by the environment?). Quote Printer Monitor for .NET? - see Merrion Computing Ltd for details
Leaders quwiltw Posted April 16, 2003 Leaders Posted April 16, 2003 Ok, I think I'm tracking with the concept now. Now I'm trying to get a handle on a real-world problem that it could be used to solve (ie. non-gaming). Got an example of that? Quote --tim
*Gurus* Derek Stone Posted April 16, 2003 *Gurus* Posted April 16, 2003 By now we all realize that the Irish ale is getting to Merrion right about now, so if you'd like to see a similar concept without the crazy Irish rambling head on over to the terrarium. ;) Did I mention I'm part Irish? :) Quote Posting Guidelines
*Experts* Merrion Posted April 16, 2003 Author *Experts* Posted April 16, 2003 I'll have you know I haven't had a cont all night drinkstable ;) Now the terrarium is a simulation type thing which is all well and good but what I want to do is use the .NET programming env. to do what these eggheads are doing. Did I mention I'm part Irish? I'm only Irish by marriage...but sure that's close enough ;) Quote Printer Monitor for .NET? - see Merrion Computing Ltd for details
*Experts* Nerseus Posted April 17, 2003 *Experts* Posted April 17, 2003 Ah... finally, all the pieces are coming together (sorta). Take me drunk officer, I'm home, *hic* -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
*Experts* jfackler Posted April 17, 2003 *Experts* Posted April 17, 2003 When two individuals breed (probably implemented by IPopulation as it doesn't make sense for individuals to be in charge of their own breeding - or does it?) then the offspring has a gene pool that contains genes randomly selected from either parent (plus a random error factor determined by the environment?). Breeding (the product of which instantiates my day job) is rarely random, and frequently is affected by the afore mentioned ale (not infrequently with disastrous results). :eek: Allowing a near extinction of some genes would be essential. I say near extinction because over the course of evolution a non expressed gene in the pool may re-imerge to provide an essential component of a solution. Complete extinction would create loss of a method by a class that over iterations may be essential to the survival of the class. On the other hand, other methods may interfere with new methods instantiated from the mixing of types. These would best be relegated to non-expressed genes. And I've been sober 12 years. :p Twisted minds..... Quote
*Experts* Merrion Posted April 17, 2003 Author *Experts* Posted April 17, 2003 I think an intermediary between Individual and Gene is needed because the position of a gene in the set is also an important factor.... IGeneSet A known-layout collection of genes that is constant across all individuals belonging to the same population. Quote Printer Monitor for .NET? - see Merrion Computing Ltd for details
*Experts* jfackler Posted April 17, 2003 *Experts* Posted April 17, 2003 Since the individual is defined by the collection of genes, or as I said before, by the expression of some of those genes, your intermediary would need to describe the method of that expression and since breeding is implemented (otherwise, what's the point, there can be no evolution without it), their heirarchachal dominance in expression. Quote
*Experts* Merrion Posted May 2, 2003 Author *Experts* Posted May 2, 2003 IEnvironment / IGenome / IGene Public MustInherit Class IEnvironment Public MustOverride Function GetPopulation() As IPopulation End Class #Region "IGenome base class" '\\ --[iGenome]---------------------------------------------------------------------------- '\\ The genome defines the number of genes a member of a population has and their explicit '\\ locations. These locations have an explicit meaning in relation to the problem being '\\ tested by the environment and are not interchangeable '\\ ---------------------------------------------------------------------------------------- Public MustInherit Class IGenome Inherits System.Collections.DictionaryBase End Class #End Region #Region "Individuals type safe collection" '\\ --[individuals]------------------------------------------------------------------------- '\\ A collection of IGenome based objects '\\ ---------------------------------------------------------------------------------------- Public Class Individuals Inherits System.Collections.CollectionBase End Class #End Region '\\ --[iPopulation]------------------------------------------------------------------------ '\\ The population represents a set of potential solutions to the problem. It can be '\\ created from a randomly generated, or seeded by a predefined set, of individuals. '\\ ---------------------------------------------------------------------------------------- Public MustInherit Class IPopulation Inherits System.Collections.CollectionBase Public MustOverride Function Breed(ByVal Parents As Individuals) As IGenome #Region "Public constructors" Public Sub New() End Sub Public Sub New(ByVal Seedgroup As Individuals) End Sub #End Region End Class '\\ --[iGene]------------------------------------------------------------------------------- '\\ The gene holds the current value for an individual variable that is used to compute the '\\ gene set's fitness to solve the environment's problem '\\ ---------------------------------------------------------------------------------------- Public MustInherit Class IGene Public MustOverride Property Value() As Integer Public MustOverride Property MinimumValue() As Integer Public MustOverride Property MaximumValue() As Integer End Class Quote Printer Monitor for .NET? - see Merrion Computing Ltd for details
*Experts* Merrion Posted August 3, 2004 Author *Experts* Posted August 3, 2004 I know it seems like gravedigging but this really has been sat at the bottom of my todo list for all this while. Attached is an updated version of the framework and a hello world application of same - a program that tries to solve the "Mastermind" game (coloured pegs thing). Any thoughts?Mastermind.zip Quote Printer Monitor for .NET? - see Merrion Computing Ltd for details
Arch4ngel Posted August 3, 2004 Posted August 3, 2004 Damn... I'm sure you were all in the same party and that you were pretty drunk at that time !!! :p but hey.... it work. Maybe we shall see your problem again. Gravedigging is only to those who try to bring skeleton back... but this is a great living idea that could make more sens to a program than anything I've seen before (I'm tired of those flame war between VB.NET and C# :p) We have a project here I think. What is your goal with this ? I'm interested !! :) Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
AFterlife Posted August 3, 2004 Posted August 3, 2004 Self evolving code sounds really interesting.............. :cool: Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.