A fresh new version can be found at www.ripplingloop.com. Spore it ain't, but I think the scientific underpinnings are better. ;)
So what are all these shapes and lines about?
First off, VatLife is a platform that separates the "environment" that creatures inhabit (which includes their physical form) from their "controllers", which contains logic for how each creature interacts with its environment. The thinking here is that any a-life can use any controller in any environment, and thus could migrate from one environment to another.
Because the environments and controllers are separate from VatLife and are loaded dynamically, what you're seeing isn't VatLife itself, but VatLife running a simulated environment with simulated controllers. The reason this is exciting to me is that someone out there could write a better evolvable controller, upload it, and it would just work in this environment (or any VatLife environment).
Enough preamble. The way this particular environment works is that each a-life has the physical form of a polygon, and will gain energy when "sunlight" (the vertical yellow lines) hits a face. Note that polygons can shade other polygons. Every a-life also loses energy each turn. The energy is shown by the polygon's color. Brighter colors mean higher energy, gray means low energy.
The simulation starts by generating twenty a-lifes using randomly generated genomes and randomly selected controllers. I've supplied two different controllers, neither of which are particularly good. The green polygons use one controller and the red polygons use another. The VatLife produces a polygon for an a-life by interpreting its genome. Complex polygons are allowed, but since they shade themselves, they're quickly selected against.
Periodically, the lowest-energy 50% are killed, and the top 50% are reproduced (with random mutations) to maintain a constant population. When this happens, you'll see a new "Generation #x" appear in the message box. I also give the existing a-life a good shake, so the new ones don't just settle on top of the old ones and shade them out.
So, what do the controllers get to do? Same as any VatLife controller - it can read and write pin values. In fact, I basically reused the controllers I'd used in the VatLife demo from two month ago. The environment handles pin I/O this way:
1) For an a-life, there are as many pins as there are polygon faces, with no child pins.
2) Each pin returns a value from 0 to 1 based on the amount of sunlight that polygon face is receiving.
3) Writing a value to a pin applies force to the polygon in the opposite direction that the face is pointing.
In other words, if a polygon has 4 faces, and it's rotated so that face #2 is on the bottom, reading pin #2 will return 0 (no sunlight) and writing to pin #2 will propel the a-life upwards.
If it's not obvious by now, that's what those magenta lines are about - they indicate the force that was applied from writing to a pin. If you see a line going on and off, that means the controller is using logic to control its propulsion.
Incidentally, the physics here isn't quite accurate on many levels. The force is applied to the center of the mass, not the center of the face as is shown. It's also a reactionless jet, which I'm very excited to have invented. ;) There's no fluid dynamics in play, although the top area above the blue background is a high gravity zone, which gives it some properties of being "above the water line".
Unfortunately, there's no data persistence - the simulation starts when you bring up the page and ends when you close it. With data persistence, you could have multiple environment in the central repository. Different users could sign in and simulate an environment for a number of turns, and evolved a-lifes could migrate from one to the other.
Unfortunately, all of that will have to wait, as I'm needing to turn my focus away from my hobby - and I'm curious to see if other people see value in this platform before investing more time in it.
I'll try to make the source code and some basic documentation available soon. Gerald de Jong has graciously offered to give it a code review, which is like having Leonardo da Vinci for your first year art teacher, so I will be polishing it first. This will be entirely open source.
Feedback, comments, questions are appreciated.
Wednesday, October 1, 2008
Tuesday, September 30, 2008
VatLife online
In advance of tomorrow's GT meeting, I have my my first online version of VatLife up at www.ripplingloop.com. Comments are welcome.
Right now I have a single environment and two different single controllers (which are almost identical), both dynamically loaded from JAR files. In this environment, each a-life is a simple 2D polygon of up to five vertices, and gains energy by having an upward facing face that isn't shadowed by another a-life. The energy of each a-life is gray when low and more saturated when high.
Also, just to keep it interesting, the critters don't get energy if the "sunlight" hits them on the very top of the screen.
I decided to give each critter two different genotypes: one used by the environment to determine the initial form, and one used by the controller to determine the mind. My original thought was to use the same for both, but decided this would prevent the possibility of critter migration between environments.
In this environment, each "critter" has the same number of pins as it has faces, with the pin value returning the amount of energy that face received. Writing to a pin adds force in a particular direction.
Periodically the worst performers (the lowest energy a-lifes) are killed off and the best performers are reproduced with occasional mutations.
And incidentally, this could run way faster. I profiled it and found that the collision detection (from the Phys2D library I'm using) is taking about 90% of the time. I'm sure this could be cut down significantly. But of course, the environment is really just another proof of concept.
Right now I have a single environment and two different single controllers (which are almost identical), both dynamically loaded from JAR files. In this environment, each a-life is a simple 2D polygon of up to five vertices, and gains energy by having an upward facing face that isn't shadowed by another a-life. The energy of each a-life is gray when low and more saturated when high.
Also, just to keep it interesting, the critters don't get energy if the "sunlight" hits them on the very top of the screen.
I decided to give each critter two different genotypes: one used by the environment to determine the initial form, and one used by the controller to determine the mind. My original thought was to use the same for both, but decided this would prevent the possibility of critter migration between environments.
In this environment, each "critter" has the same number of pins as it has faces, with the pin value returning the amount of energy that face received. Writing to a pin adds force in a particular direction.
Periodically the worst performers (the lowest energy a-lifes) are killed off and the best performers are reproduced with occasional mutations.
And incidentally, this could run way faster. I profiled it and found that the collision detection (from the Phys2D library I'm using) is taking about 90% of the time. I'm sure this could be cut down significantly. But of course, the environment is really just another proof of concept.
Tuesday, September 9, 2008
insomnia + NetBeans = VatLife?
At least that's what I'm hoping.
So I've switched from using Eclipse to using NetBeans IDE 1.6. Originally I was considering using JavaBeans as a component model, but that seemed like overkill. I looked into OSGi and Knopplerfish but found myself getting lost in documentation...and it again seemed like overkill.
At the moment, I have controllers and environments dynamically loaded as JAR files. Nothing mindblowing there, but it's a good start.
I really love the NetBeans IDE, even if I am using just a small fraction of it. Although it does have a few quirks I'm learning about, it's remarkably intuitive and just a GREAT tool for someone like me who's learning the language. The warnings are clear and helpful, the interface is intuitive and flexible, and it's just extremely well polished. I love the refactoring (just drag code from one package to another - or even one project to another - and it fixes all the references), the automatic code formatting, the list goes on.
Excellent job, Sun engineers.
So I've switched from using Eclipse to using NetBeans IDE 1.6. Originally I was considering using JavaBeans as a component model, but that seemed like overkill. I looked into OSGi and Knopplerfish but found myself getting lost in documentation...and it again seemed like overkill.
At the moment, I have controllers and environments dynamically loaded as JAR files. Nothing mindblowing there, but it's a good start.
I really love the NetBeans IDE, even if I am using just a small fraction of it. Although it does have a few quirks I'm learning about, it's remarkably intuitive and just a GREAT tool for someone like me who's learning the language. The warnings are clear and helpful, the interface is intuitive and flexible, and it's just extremely well polished. I love the refactoring (just drag code from one package to another - or even one project to another - and it fixes all the references), the automatic code formatting, the list goes on.
Excellent job, Sun engineers.
Monday, August 18, 2008
No news...
...is, well, no news.
VatLife is on hold for now. I've gotten busy with work, remodeling the houseboat and family visits. However, my wife is going to a five day conference in early September, and I'm planning to spend some time cranking on it while she's gone.
VatLife is on hold for now. I've gotten busy with work, remodeling the houseboat and family visits. However, my wife is going to a five day conference in early September, and I'm planning to spend some time cranking on it while she's gone.
Sunday, August 3, 2008
It don't mean a thing if it ain't got that swing
Would jazz make any sense if you'd never walked through a city, heard a train whistle, knew speech patterns? Would blues make any sense if you never felt blue? Actually, would music make any sense at all if you'd never heard (or possessed) a heartbeat?
This, oddly, is an inspiration for VatLife.
Let's say the fitness function in a evolving environment is that a-lifes are rewarded if they can predict the next number in a sequence. So, let's say the sequence is 1, 2, 3, 4. It world not be difficult for most evolvable machines to predict the next number. 1, 2, 4, 8 would also be a fairly easy sequence to predict.
Now, let's say the sequence is 3, 1, 4, 1, 5, 9. Clearly, these are the base 10 digits of pi, but since it's not a smooth problem space to go from the first two sequences to that one, I don't think there's any way for a-lifes to make that evolutionary jump. Not without some outside experience. And even then, it seems necessary for the a-life to learn the digits of pi, rather than to figure that sequence out. It seems pretty safe to say that there's never been a human being born on this planet who could predict the digits of pi without some kind of mathematical training.
Could an a-life evolve in a different environment and gain the knowledge to be able to solve that problem? It's hard for me to picture that happening with that specific problem. But just as life experience in extra-musical domains is necessary to truly understand music, a-life experience from many different simulated environments may be necessary to solve the problem at hand.
Incidentally, this may sound like AI training, but I'm talking specifically about breeding ALs that are capable problem solvers. Although...this does argue for individual VatLife creatures with life experience crossing from one environment to another, not just their genotypes and controller IDs. And perhaps a VM that is designed with the goal of allowing VatLife's to pass knowledge between individuals.
This, oddly, is an inspiration for VatLife.
Let's say the fitness function in a evolving environment is that a-lifes are rewarded if they can predict the next number in a sequence. So, let's say the sequence is 1, 2, 3, 4. It world not be difficult for most evolvable machines to predict the next number. 1, 2, 4, 8 would also be a fairly easy sequence to predict.
Now, let's say the sequence is 3, 1, 4, 1, 5, 9. Clearly, these are the base 10 digits of pi, but since it's not a smooth problem space to go from the first two sequences to that one, I don't think there's any way for a-lifes to make that evolutionary jump. Not without some outside experience. And even then, it seems necessary for the a-life to learn the digits of pi, rather than to figure that sequence out. It seems pretty safe to say that there's never been a human being born on this planet who could predict the digits of pi without some kind of mathematical training.
Could an a-life evolve in a different environment and gain the knowledge to be able to solve that problem? It's hard for me to picture that happening with that specific problem. But just as life experience in extra-musical domains is necessary to truly understand music, a-life experience from many different simulated environments may be necessary to solve the problem at hand.
Incidentally, this may sound like AI training, but I'm talking specifically about breeding ALs that are capable problem solvers. Although...this does argue for individual VatLife creatures with life experience crossing from one environment to another, not just their genotypes and controller IDs. And perhaps a VM that is designed with the goal of allowing VatLife's to pass knowledge between individuals.
Friday, August 1, 2008
Better (artificial) living through chemistry?
Just got caught up with my Biota podcasts and GT presentations. I particularly enjoyed Bruce's presentation at Greythumb London.
I believe it was in the London GT meeting that Bruce quoted a simulation author who said that there's always an IOU you have to write. In other words, there's always going to be a part of the simulation where you wave your hands a bit. This makes some sense...if you are trying to simulate the spread of a virus in a human population, it makes sense to simulate the mobility of the population, but why waste the effort simulating the internal combustion engines that are getting people from point A to point B?
Actually, that's not such a great example, because no one would expect you to repay that IOU. We all know in abstract terms how cars allow people to move from here to there, and so it would be unreasonable to expect your poor CDC epidemiologist to have to model reality beyond the minimum needed to solve the problem.
So, do we write an IOU that we have to repay when we create simulated organisms that use genetic information to control their form and behavior without actually modeling the underlying chemistry?
I think it all depends on your perspective. If you're a biologist, or if you want to evolve something in your simulation that might exist in the real world, then you'll need a high adherence to reality in your simulation. But since all simulations fall short of reality, I think requiring accuracy is something of a losing game.
Case in point: the three body problem. If you just have three objects that interact with each other - for example, a planet, moon and sun - there's no way of exactly determining what effect each body has on the others. You can only approach a solution. So what if you have a billion bodies in interaction? And how far down do we take this...do we model subatomic particles, and then do we store their location OR their velocity?
But let's say that we model atoms and molecules, and we have good approximations of their interactions. We ignore relativity and just use Newtonian physics. How large a world can we model? As fast as computers get, and even writing our IOUs, I'm skeptical that we could model a very large volume of space in real-time. Since it took something like two billion years for multi-cellular life to evolve in the vast oceans of Earth, I don't hold out too much hope we'd see this in a computer simulation.
But if we did, what of it? Creationists would say that the simulation was flawed and created by proponents of evolution, and both charges would be true. It might be confirming evidence of evolution, but do we need more confirmation?
So while I see this as a very interesting enterprise, I'm skeptical of this approach as yielding useful results. Interesting perhaps, but I'm not sure about useful.
My personal preference at this point is to say: hey, evolution works, and it's given us these great design patterns - such as DNA and a central nervous system. What can else can we do with those design patterns? And then, like the CDC epidemiologist, we can make a simplified simulation that yields useful results without worrying about the tire pressure of the virus' host's car.
All JMO.
I believe it was in the London GT meeting that Bruce quoted a simulation author who said that there's always an IOU you have to write. In other words, there's always going to be a part of the simulation where you wave your hands a bit. This makes some sense...if you are trying to simulate the spread of a virus in a human population, it makes sense to simulate the mobility of the population, but why waste the effort simulating the internal combustion engines that are getting people from point A to point B?
Actually, that's not such a great example, because no one would expect you to repay that IOU. We all know in abstract terms how cars allow people to move from here to there, and so it would be unreasonable to expect your poor CDC epidemiologist to have to model reality beyond the minimum needed to solve the problem.
So, do we write an IOU that we have to repay when we create simulated organisms that use genetic information to control their form and behavior without actually modeling the underlying chemistry?
I think it all depends on your perspective. If you're a biologist, or if you want to evolve something in your simulation that might exist in the real world, then you'll need a high adherence to reality in your simulation. But since all simulations fall short of reality, I think requiring accuracy is something of a losing game.
Case in point: the three body problem. If you just have three objects that interact with each other - for example, a planet, moon and sun - there's no way of exactly determining what effect each body has on the others. You can only approach a solution. So what if you have a billion bodies in interaction? And how far down do we take this...do we model subatomic particles, and then do we store their location OR their velocity?
But let's say that we model atoms and molecules, and we have good approximations of their interactions. We ignore relativity and just use Newtonian physics. How large a world can we model? As fast as computers get, and even writing our IOUs, I'm skeptical that we could model a very large volume of space in real-time. Since it took something like two billion years for multi-cellular life to evolve in the vast oceans of Earth, I don't hold out too much hope we'd see this in a computer simulation.
But if we did, what of it? Creationists would say that the simulation was flawed and created by proponents of evolution, and both charges would be true. It might be confirming evidence of evolution, but do we need more confirmation?
So while I see this as a very interesting enterprise, I'm skeptical of this approach as yielding useful results. Interesting perhaps, but I'm not sure about useful.
My personal preference at this point is to say: hey, evolution works, and it's given us these great design patterns - such as DNA and a central nervous system. What can else can we do with those design patterns? And then, like the CDC epidemiologist, we can make a simplified simulation that yields useful results without worrying about the tire pressure of the virus' host's car.
All JMO.
Thursday, July 31, 2008
Open-sourcing VatLife
I just set up an SourceForge location for VatLife.
However, I don't plan to upload it just yet. While I just don't have the time, resources or knowledge to develop the "perfect" framework, and my plan was always to release a rough cut that might inspire others or be picked up by better developers than I, for VatLife to get any traction at all I think it will need some documentation and better examples. I'd rather have this make a splash later than a thud now.
Given that this is a side project of mine and I don't have that much spare time to work on it, let's figure it will be at least a few weeks before this goes on-line.
I consider that the GreyThumb SV presentation was a launch of a concept more than a launch of the technology itself - and again, I'd welcome feedback of all sorts. Well, most sorts anyway. ;)
However, I don't plan to upload it just yet. While I just don't have the time, resources or knowledge to develop the "perfect" framework, and my plan was always to release a rough cut that might inspire others or be picked up by better developers than I, for VatLife to get any traction at all I think it will need some documentation and better examples. I'd rather have this make a splash later than a thud now.
Given that this is a side project of mine and I don't have that much spare time to work on it, let's figure it will be at least a few weeks before this goes on-line.
I consider that the GreyThumb SV presentation was a launch of a concept more than a launch of the technology itself - and again, I'd welcome feedback of all sorts. Well, most sorts anyway. ;)
Subscribe to:
Posts (Atom)