|
Register | Sign In |
|
QuickSearch
Thread ▼ Details |
|
Thread Info
|
|
|
Author | Topic: Percy's Alife Project | |||||||||||||||||||||||||||||||||||||||||||||
Percy Member Posts: 22939 From: New Hampshire Joined: Member Rating: 6.9 |
Alife stands for Artificial Life.
I've always wanted to do my own alife program, but I didn't want to simply duplicate what had already been done in programs like Tierra, Cosmos and others. While I don't kid myself that I could make an original contribution, neither am I interested in reinventing the wheel. Recent discussions about genetic algorithms (GA) caused me to take a look at recent developments on the alife frontier, and I came up with some ideas that may be worth exploring. I outline these ideas here in the hope that people can provide a useful check on their quality and sensibilty. C E L L S C A P E The name of the program will be Cellscape. My original choice was Worldscape, but that name is taken. My next choice was Microscape, but a day later I fixed on Cellscape. The name will change again as soon as someone suggests a better one. Obviously, Cellscape will need a logo. TrueCreation did the current EvC logo, we need a similar fine effort for Cellscape. Of course, there are no screenshots yet, but use your imagination. The Cellscape Universe The Cellscape universe will be a 3D grid that wraps at the limits. The universe needn't be a cube but will definitely be rectangular and not some irregular shape. Each grid location is characterized by properties. Examples of properties are temperature, density (like of air or water), direction (like wind), and so forth.
Technical Issue: Since a universe of reasonable size (say, a million by a million by a million grid units) could contain a gazillion grid locations, this represents a serious software design issue. Each grid location of a large universe cannot be explicitly represented and still fit in available memory, so we must use a sparse array for the universe, but how would one represent, for example, varying temperature across the universe using a sparse array? It seems as if you would need explicit representation of the temperature of each grid location, but imagine the amount of memory required if you did this. For example, if the universe has 1018 cells you would need 1018 bytes to represent the temperature uniquely for each grid location. Since this is 9 orders of magnitude larger than the amount of physical memory in most PCs, this wouldn't be possible. And it's probably more than 7 or 8 orders of magnitude larger than the amount of virtual memory in most PCs, so even if going virtual were acceptable it still wouldn't be possible. So we have to use sparse arrays, but the temperature and other properties must be represented using some broad brush approach. For example, one could imagine a function where you pass it the address of the grid location and it returns the requested property value which it derives by some means, probably from an equation or function or approximation of some type. Each grid location of the universe can also contain a single object. Most of the universe must be empty, though, else there would be too many objects to possibly represent in a PC simulation. Cellscape Objects Conceptually, an object is a six sided cube which completely fills a grid location of the universe. I've only identified a few objects so far:
Every object has one or more algorithms associated with it that govern its behavior. Cellscape Algorithms Algorithms are attached to objects. Algorithms control everything that an object does. Every algorithm of an object is executed once per cycle (time slot), and this is how the universe changes over time. While I have a pretty firm idea about what algorithms will do, I don't yet have a clear idea of how they will be represented. I'll probably stay away from PLA-style approaches because even though they're extremely easy to implement and execute, they're very difficult for humans to interpret, and we want people to be able to peek inside and understand what's going on. Hence I'm leaning toward a C-like language that would be interpreted at run-time, but with an efficient non-textual internal representation that the program would use, and which would be de-compiled when users request it. For an example of an algorithm, consider a food object. Food objects drift aimlessly through the universe until they are consumed. The drift algorithm for a food object might be this (this is just C code to get the idea across, not necessarily an implementation proposal): // ChooseRandom returns one it's arguments, chosen randomly One can easily imagine more complex drift algorithms. In this one, the food floats upward if it is warmer than its surroundings, and sinks if it is colder: int gridTemp = GetGridTemp(xpos, ypos, zpos); If there are currents, then these, too, could be taken into account: int xCurrent = GetXCurrent(xpos, ypos, zpos); Objects can sense their surroundings. For example, here's the algorithm for a metabolic element checking for food in the adjacent grid locations (there are 26, and since checking the adjacent grid locations will be an extremely common operation, functions are provided to make this very easy): foreach adjacentLocation (AdjacentLocations(xpos, ypos, zpos)) { There's plenty more, but that's all I have time to type in for now. --Percy
|
|||||||||||||||||||||||||||||||||||||||||||||
roxrkool Member (Idle past 1240 days) Posts: 1497 From: Nevada Joined: |
I think my head just exploded.
Percy, I had no idea. I am in awe. Sorry I can't contribute a single thing to this thread - way out of my league, I'm afraid.
|
|||||||||||||||||||||||||||||||||||||||||||||
Syamsu  Suspended Member (Idle past 5841 days) Posts: 1914 From: amsterdam Joined: |
So are you going to put a comparison between the digital organisms in the program as part of how the world functions? (other then just for providing comparitive information to the user)
regards,Mohammad Nor Syamsu
|
|||||||||||||||||||||||||||||||||||||||||||||
IrishRockhound Member (Idle past 4688 days) Posts: 569 From: Ireland Joined: |
As a friend of mine likes to say, "Holy jumping Jesus on a pogo stick!"
Percy, what language are you using? It looks almost like Java. Are you doing a website to show it off, or are you just keeping people updated on EvC? Do you want help programming? OhboyOhboyOhboyOhboyOhboyOhboyOhboy!!!! The Rock Hound
|
|||||||||||||||||||||||||||||||||||||||||||||
Dr Jack Member (Idle past 126 days) Posts: 3514 From: Immigrant in the land of Deutsch Joined: |
I strongly recommend giving the food particles some kind of 'inertia', purely random walking tends to just produce little squiggly 'knots'.
Looks very cool. How long do you think it'll take?
|
|||||||||||||||||||||||||||||||||||||||||||||
Parasomnium Member Posts: 2228 Joined: |
Percipient,
If I may make a few suggestions: try to keep things simple at first, don't begin with a whole universe full of diverse complicated objects. Instead, prove the concept first, by creating a 'test tube' with a limited number of simple objects, then gradually increasing the number of parameters and the number and complexity of objects. One of the cheapest ways of keeping the memory and processing demand in check is to give up the third dimension. An added bonus of that approach is that you need not worry about 3D representation on screen. You want to concentrate on the principles of A-life after all. Also, I think you should not program too much behaviour; let some, if not most behaviour emerge on its own. First of all, it's much more interesting that way. And secondly, if you try to program all behaviour, you'll probably be tinkering with it endlessly and it'll never work quite the way you expected. Better just give the objects some properties and see how they interact. Let 'nature' run its course. You do need a certain minimum of algorithms of course, or nothing much would happen, but you should try to limit the algorithms to a set of generic 'laws of nature' rather than give specific, detailed descriptions of how things should behave. I once made a graphical simulation of an enzymatic reaction. It had a cell with a cell wall, enzymes, nutrients and waste product. I tried to program the behaviour of the particles only to see that the waste product demolished the cell wall. Quite amusing, but not what I had in mind. Some questions you should also consider:
I hope you don't think me too presumptious in telling you what to do. It's just what I would do in your shoes. Speaking of which: "Before you criticize someone, walk a mile in their shoes. Then when you do criticize them, you'll be a mile away and have their shoes." - Anonymous.
|
|||||||||||||||||||||||||||||||||||||||||||||
Percy Member Posts: 22939 From: New Hampshire Joined: Member Rating: 6.9 |
Syamsu writes: So are you going to put a comparison between the digital organisms in the program as part of how the world functions? (other then just for providing comparitive information to the user) There will be no software function that decides relative fitness of organisms. The comparison will be an emergent function deriving from competition for resources among organisms. Direct competition between organisms is a possibility, but it won't be designed in - if it happens (and I hope it does) it will be an emergent behavior. Providing information about organisms to the user is one thing, making sense of that information is another. If the user notices that one organism is outcompeting another, how will he be able to tell why? Looking at the algorithms (the genetic code) of the organisms is probably a difficult way to figure it out. Watching the behavior of the organisms is probably a better way, and I hope to be able to provide that capability. A replay capability would also be extremely useful. --Percy
|
|||||||||||||||||||||||||||||||||||||||||||||
Percy Member Posts: 22939 From: New Hampshire Joined: Member Rating: 6.9 |
IrishRockhound writes: Percy, what language are you using? It looks almost like Java. I was just writing in C pseudocode. While I'm not up on the details of Java syntax, I know they're pretty similar, so if you know Java then whatever I write should look pretty familiar to you. It's important not to forget I'm writing pseudocode, though. For implementation there has to be a much more efficient internal representation.
Are you doing a website to show it off, or are you just keeping people updated on EvC? I'll probably do whatever makes sense. Right now I could use a healthy exchange of ideas, and so this thread is working fine. In fact I'm extremely gratified at the responses - not having a good gauge of the level of interest in alife software among members, I figured there was a good chance this thread would be ignored.
Do you want help programming? Yes, I'm writing it in C++. I've already designed the base object, and as soon as I've designed the derived objects (like food and metabolic elements) I'll post them all in a new directory here at EvC. That way people will be able to see where I'm coming from from a software standpoint. If you already know Java then I'm guessing you're already familiar with object oriented concepts, and with methods being associated with objects, but I'm not familiar enough with Java to know if it has analogs to the C++ concepts of base classes, derived classes, method flavors, constructors and destructors, inheritance, templates and operator overrides. Let me know how you feel about C++, we'll go from there. --Percy
|
|||||||||||||||||||||||||||||||||||||||||||||
awinkisas Inactive Member |
Hi Percy,
Sounds like an exhausting but fun project. I was thinking about the temperature gradient problem and I think it might be a good idea to use techniques from compression technology. If you only keep track of the location and value of local maximums/minimums then you can infer the temperature of surrounding cells using a formula. I would suspect that the formula would be along the lines of an inverse square. Depending on the area of interest the algorithm would have to find the closest maxs/mins, determine the distance to each and calculate the temperature. The draw back is that there is a certain loss of granularity due to interpolation. One would also have to take into account such things as differences in the density of the medium as well as the heat conductivity and turbulence. It might be a good idea to initially assume that the medium is uniform and then introduce additional factors later. Also, since heat diffuses, there would also need to be a redistribution of the maxs/mins during each cycle. The hotter areas would become cooler and the cooler areas hotter depending on the surrounding values. And have you thought about heat sources? I suppose that cells and other metabolic process could generate heat but there needs to be some incident radiation to keep entropy from running down the system. I hope this helps and if you need any additional help I would be glad to assist. For me programming is a hobby as well as a job. I've done some work in C++ but have stuck with VB for my bread and butter. Lately in my spare time I've been working on a NLP chatterbot (nothing as sophisticated as the Brad McFall version though). Regards
|
|||||||||||||||||||||||||||||||||||||||||||||
NosyNed Member Posts: 9011 From: Canada Joined: |
It's been a few years, I wouldn't mind a chance to brush up on my C++. And, btw, Java is solidly OO and has most of what C++ has. (It is a hell of a lot simpler too)
|
|||||||||||||||||||||||||||||||||||||||||||||
Syamsu  Suspended Member (Idle past 5841 days) Posts: 1914 From: amsterdam Joined: |
If you don't code a comparison, no comparison will be made by the computer. You see a comparitive function where there is none, seems simple.
Other then equation comparisons, there might be real comparisons in the random function of the computer. If it is true that the randomizer in the event could turn out one way or another, then there might be a real comparison between options, as part of the determination between one or the other option. But what those options actually consist of I don't know, and I think the computer randomizer is mostly chaotic working from registers (predetermined) in stead of chancy (indeterminate). So basically only in chance can I see any reality for comparison, and the comparison in Natural Selection has no basis in reality. regards,Mohammad Nor Syamsu
|
|||||||||||||||||||||||||||||||||||||||||||||
Percy Member Posts: 22939 From: New Hampshire Joined: Member Rating: 6.9 |
Parasomnium writes: If I may make a few suggestions: try to keep things simple at first, don't begin with a whole universe full of diverse complicated objects. Instead, prove the concept first, by creating a 'test tube' with a limited number of simple objects, then gradually increasing the number of parameters and the number and complexity of objects. A house was within his means, but he wanted a mansion, and so in the end he had neither. Keep telling me this. I keep telling myself the same thing, but I keep responding that I *am* keeping things simple, and of course I believe myself. This feedback is important. I *think* the objects I've identified so far are a fairly small set, but keep working on me, maybe I'll waver.
One of the cheapest ways of keeping the memory and processing demand in check is to give up the third dimension. An added bonus of that approach is that you need not worry about 3D representation on screen. You want to concentrate on the principles of A-life after all. I share the concern, but I felt 2D was a fairly severe weakness of alife worlds I have read about so far. The primary criticism of the results of alife efforts so far is that the level and kinds of complex interactions and behaviors that characterize real life that they hoped would emerge simply failed to happen. I don't believe this failure can be laid solely at the door of 2D, but I *do* believe it is a factor. That being said, while 3D increases the complexity of some of the underlying algorithms (like just determining adjacent grid locations) and thereby making the programming job much tougher, I believe it astronomically increases the possibility of emergent complexity. I can't prove this, of course...
Also, I think you should not program too much behaviour; let some, if not most behaviour emerge on its own. First of all, it's much more interesting that way. And secondly, if you try to program all behaviour, you'll probably be tinkering with it endlessly and it'll never work quite the way you expected. Better just give the objects some properties and see how they interact. Let 'nature' run its course. You do need a certain minimum of algorithms of course, or nothing much would happen, but you should try to limit the algorithms to a set of generic 'laws of nature' rather than give specific, detailed descriptions of how things should behave. I agree with you so much I could have written that paragraph for you. Some of my ideas started to solidify while reading Emergence: The Connected Lives of Ants, Brains, Cities, and Software by Steven Johnson. I'm actually still in the first couple chapters (I'm ashamed to admit how long ago I began reading this book, but I'll admit that months is not too large a unit), but it got me thinking about how one might use emergent behavior to design digital systems, and I rapidly came to the conclusion that if the final result was preordained then the concepts surrounding emergent behavior were unlikely to be helpful. So I started trying to come up with applications where emergent behavior would be just what you want, even though you don't know in advance what specific behaviors might emerge, and of course evolution was one of the possibilities. Then the GA discussions started in some threads here, I started updating myself about alife, and then it just felt like I had enough ideas to get started.
Some questions you should also consider:
You're anticipating some things I was intending to discuss when I posted my next installment, but jumping ahead is fine. Any object can be food. What defines an object as food is whether another object is able to consume it. I'm hopeful that a food cycle will emerge where one organism's waste is another oranism's food. Naturally this means that organisms can possibly view each other as food. Don't ask me more details of how this will be realized. If you have some ideas I'd love to hear them. But there *does* need to be an initial source of food. Naturally the initial state of the universe will include food just floating around, but is it replenished? I don't see why it can't be. While there's probably many ways this could be accomplished, only one comes to mind just at the moment. Our universe could be "bathed" in energy, analagous to the sun, and energy striking a raw material, say something analogous to debris at the bottom of a tidal pool, breaks it away and turns it into free floating food. I'm hopeful that an emergent behavior will be cells that attach themselves to inanimate raw material objects ("rocks" or "mineral deposits") and turn them into food. There's also the issue of whether there can be different types of food that provide something analogous to different nutrients, forcing organisms to seek out more than one food type.
Yes. Hopefully. Yes. Death and reproduction will be an emergent behavior. Death is easy - it happens when enough of the objects comprising a cell simply cease to have enough available energy to execute their algorithms, turning them into free-floating objects. In my view of things, growth, reproduction and mutation are intertwined, and the manner in which they are intertwined is important. The conceptual framework in which I'm currently thinking has mutation associated with growth. For example, if a cell wall object has enough energy and resources to "grow" (ie, produce another cell wall object), then there is a small but finite possibility that the algorithms inherited by the new cell wall object will be mutated in some way (there will be a large variety of mutation types, but discussion on that can wait). I know this isn't precisely analogous to the way life here on earth mutates, but this is where I think it helps to take another interpretation of the "alife" label and keep in mind that what we're trying to create is "a life", not "the life". Reproduction occurs when one cell becomes two simply because the cell wall objects have become numerous enough to make this happen, and because they move in such a way as to divide the cell into two parts which then move away from each other. The cells would not be exact duplicates of each other, as the algorithms each cell ends up with are those associated with the objects each new cell ended up with. I'm open to ideas that can improve upon this approach by bringing it closer to the way real life actually mutates, but I'm pretty happy to come this close, and I actually like it a lot because it feels like this may be closer to the way pre-life actually operated. And this brings me to perhaps my most ambitious goal. I'll just mention it and end there. I'm hoping to drop bare objects into my universe, just cell wall objects, metabolic objects, food objects, etc, that aren't already gathered together into cells and just let cells happen as an emergent behavior. --Percy
|
|||||||||||||||||||||||||||||||||||||||||||||
Percy Member Posts: 22939 From: New Hampshire Joined: Member Rating: 6.9 |
Mr Jack writes: I strongly recommend giving the food particles some kind of 'inertia', purely random walking tends to just produce little squiggly 'knots'. Good idea. Things like mass and temperature can be properties of objects. I'm still debating what the list of properties should be, and if the system is properly designed then new properties should be easy to add, anyway.
Looks very cool. How long do you think it'll take? Conceptually I think Cellscape is pretty simple so far, but there are some significant programming challenges, and some of the choices about properties and algorithms will be key. When people are discussing how come our universe has just the right physical constants for life to emerge it is often mentioned that if just one physical constant were just a little different (I forget which one) then the universe would just be a big cloud of hydrogen gas. The same applies to the Cellscape universe - poor choices for initial underlying parameters could cause little or nothing to happen. Whether this will prove to be a significant problem or not is too early to tell. --Percy
|
|||||||||||||||||||||||||||||||||||||||||||||
Dr Jack Member (Idle past 126 days) Posts: 3514 From: Immigrant in the land of Deutsch Joined: |
If you need any help with the programming, I egotistically offer my assistance. (What with being a working C++ programmer and all that).
The same applies to the Cellscape universe - poor choices for initial underlying parameters could cause little or nothing to happen I wrote a much simpler A-life thing once, I found it very useful to be able to customise the parameters without changing the code. I'd suggest you do something similar.
|
|||||||||||||||||||||||||||||||||||||||||||||
Quetzal Member (Idle past 6124 days) Posts: 3228 Joined: |
Conceptually I think Cellscape is pretty simple so far, but there are some significant programming challenges, and some of the choices about properties and algorithms will be key. When people are discussing how come our universe has just the right physical constants for life to emerge it is often mentioned that if just one physical constant were just a little different (I forget which one) then the universe would just be a big cloud of hydrogen gas. The same applies to the Cellscape universe - poor choices for initial underlying parameters could cause little or nothing to happen. Whether this will prove to be a significant problem or not is too early to tell. Percy, all I can say is I'm totally impressed. Your entire concept just boggles my mind (easily done, admittedly). I never realized that something even remotely like this could be done without a bazillion lines of esoteric code - and here you are discussing it like "oh, it's 'just' coding once I figure out the parameters." I think it may be time to turn in my stereo microscope, hang up my binoculars, throw away my felt tips and florescent paint, and sit back and let the high tech folks show me how evolution REALLY happened. My only question: Which button do I push to turn it on? [This message has been edited by Quetzal, 10-07-2003]
|
|
|
Do Nothing Button
Copyright 2001-2023 by EvC Forum, All Rights Reserved
Version 4.2
Innovative software from Qwixotic © 2024