Дата публикации: 2017-10-11 19:35
It might be fun to do something ridiculous and actually program a simulation of a spinning wheel as depicted above. But this is quite unnecessary.
One of the innovations in Sims’s work is a node-based genotype. In other words, the creature’s DNA is not a linear list of PVector s or numbers, but a map of nodes. (For an example of this, take a look at Exercise , toxiclibs'' Force Directed Graph.) The phenotype is the creature’s design itself, a network of limbs connected with muscles.
Of course, the functions crossover() and mutate() don’t magically exist in our DNA class we have to write them. The way we called crossover() above indicates that the function receives an instance of DNA as an argument and returns a new instance of DNA, the child.
Finally, we’re ready for setup() and draw(). Here in the main tab, our primary responsibility is to implement the steps of the genetic algorithm in the appropriate order by calling the functions in the Population class.
The problem with this approach is that it will make ALL classes in that Namespace visible without their Namespace tag. So if you have a local class with the same name, the compiler will get confused. I prefer to only select the classes that I want by doing the following:
Machine learning is still a complex beast. Away from simplified playgrounds , there’s not much you can do with neural networks yourself unless you have a strong background in coding. But I wanted to put Conrado’s claims to the test: if machine learning will be something “everybody can do a little of” in the future, how close is it to that today?
Let’s assume we have an ArrayList of PVector locations for food, named “food.” We could test each bloop’s proximity to each food location. If the bloop is close enough, it eats the food (which is then removed from the world) and increases its health.
He says that same kind of transformation is going to happen with machine learning. “It ends up being something that everybody can do a little of. They don’t have to do the detailed things, but they need to understand ‘well, wait a minute, maybe we could do this if we had data to learn from.’”
Now that we have all the pieces in place for selection and reproduction, we can finalize the World class that manages the list of all Bloop objects (as well as a Food object, which itself is a list of PVector locations for food).