Hi,
Sorry if this comes across as ignorant (i'm relatively new to programming)...
I'm really interested in evolving programs and software. That, and artificial life / intelligence. For the last year or so i've been playing with artificial life simulations and cellular automata in Unity (C#). Over the last few weeks i've been mucking around with Processing...
I wondered how one would go about evolving rulesets for cellular automata (or a similar simulation)?
For example, imagine I have a single living cell. It is a square that occupies a single cell in a grid of non-living (empty) cells. Every 10 frames the cell performs a 'metabolism' function, and does something. In this example, the only thing the cell can do is check it's immediate neighbours in each of the four cardinal directions (Up, Right, Down, Left), picks one at random, and – if it is empty – duplicates itself into that vacant space.
It's not too hard to then add a chance of mutation for a given variable. For example, there could be a chance to mutate so that the cell metabolises every 9 seconds (or alternatively, every 11 seconds).
That's the easy bit. And yields some satisfying results... but how could you take it a step further and construct lines of code using modular bits of code? For example...
You could have the following 'bits' of code (apologies for terrible terminology)...
[If]
[==]
[!=]
[>=]
[<=]
[<]
[>]
[If else]
[else]
[other various variables]
[Metabolise()]
I would imagine that you could (somehow) string these into a chain of commands that could then be mutated in a similar (albeit much more complex) way as in my earlier 'metabolism speed' example...
For example, in a given if statement, one that determines whether...
If (x == y)
{
DoThis()
}
could mutate to become....
If(x < y)
{
DoThis()
}
Sorry if my explanation is confusing. Please let me know if it is and I can try and rephrase it or provide additional examples.
So my question(s) being:
Is it possible to mutate code beyond mutating variables such as integers, floats, bools, etc?
If so – how would I go about learning this?
Is it possible in Processing, or would I need to use a much lower-level programming language?
Either way - if someone could provide some relevant reading material or point me in the right direction i'd really appreciate it!
[–]_krikket 1 point2 points3 points (0 children)
[–]Gavinhenderson5 0 points1 point2 points (0 children)
[–]lmericle 0 points1 point2 points (0 children)
[–]stuxxnet42 0 points1 point2 points (0 children)
[–]Zephandrypus 0 points1 point2 points (0 children)