DEV Community

Garrett Burns
Garrett Burns

Posted on

Is it a good idea to simulate a baby's cognition in Ruby without any planning whatsoever?

No, but I'm trying to anyway, so I've documented my rapidly expanding scope so far.

I started way ahead from the start and had to backtrack to lay down my framework. I made a class called BabyHead and started listing down various properties I wanted it to have. I gave it health and a hunger that would motivate it's actions later, long and short term memory, an emotion variable that I didn't have any ideas for at the time, and then I was really reaching with irrelevant things given the emptiness of the project like a tolerance hash representing a person's ability to cope with various stressors like hunger.

Alt Text

I then saw the need to make an object representing the environment this baby lives in and put together a loose interpretation of an immediate local area, giving it just a color and things array. Then it made sense to create the MaterialCog class to make objects of any type and material, like a "wood" "tree" or a "stone" "rock". I still am torn between going more in depth with outside objects and focusing entirely on forming an independently thinking entity in a very poorly defined space.

Alt Text
Alt Text

To create thoughts in response to outside stimuli with hard coding every possible reaction, I needed some basic universal understandings like the need to eat, and then have the baby have a feeling related to that need and then perform an action that would lead to getting food. To do that, I needed the baby to draw a connection between a sources of food and being fed, and then make its own response out of its abilities. I made an associations key in long term memory to represent things that are relevant to each other to facilitate the drawing of connections pointing to an empty hash. This will without a doubt become bloated with loads of information with time and enough input, but this was inevitable at some point in the architecture of the intelligence given that even young children have an encyclopedia's worth of knowledge on the plants that grow around them, things that are clearly scary or dangerous, as well as their family and friends and all kinds of things about them. They store what things look like, what they do, and how they feel about them.

I made a method with which a baby can observe its immediate surroundings and add knew objects to its knowledge based on its apparent traits. by looking around, the baby sees things that are unfamiliar and starts to take the idea of an object into it's cognition to start taking info on an object as it learns more about it.

Alt Text

To make it draw up associations, the baby needs to think that trees are involved with wood and that wood relates to trees. I figured the object's type would be the most practical key to store relevant associations and added to the look at to making some actual thinking possible.

Alt Text

By about now I also try to make a diagram of what I want to having working, and things quickly looked bigger than I was hoping. Even a proof of concept is going to be messy.

Alt Text

Now this thing still needs to get food to satisfy its hunger. The baby needs to know what it's capable of and have an understanding of why it would perform those actions. What I plan to do is hard code basic action associations that this infant should already know like crawling and eating, and then write a method that determines the baby's goal through weighing on the many desires it may have and prioritizing eating in the case. I would've taken this much further but it's already a bit late and I wouldn't be against taking a look at this over the week.

Top comments (2)

Collapse
 
andrewbrown profile image
Andrew Brown 🇨🇦

I like whatever font you are using in your editor.

Collapse
 
gbmixo profile image
Garrett Burns

It's called the Mozart NBP font if you want to get it yourself.