davidrmiller / biosim4

Biological evolution simulator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Confusing behavior. Are move actions correct?

artofimagination opened this issue · comments

I was trying to run through the individual actions, to understand their effect on the network. While doing so I stumbled upon something confusing.
Let's take the MOVE_FORWARD action. Based on the name and on the fact that there is a MOVE_REVERSE this neurons sole task is to either move the individual forward or not move at all. First question: Is this assumption correct?
If yes, there is a logical issue in calculating the move. If the answer is no, this ticket is obsolete and can be closed.

The explanation for "yes" answer. When the actionLevel is calculated, there is weight that can be negative as well, resulting in a negative action level. In case of MOVE_FORWARD, this would mean a change of direction, so reversing.
I couldn't come up yet with a solution to this, yet. But I guess normalizing with tanh and offsetting to [0.0..1.0] would be the solution, except that, normalization happens once all the movement neurons are processed.

Edit: The reason I was checking move actions, is because I am experiencing that after a while all the individuals get really fast, like slow ones never have a chance for survival. Which, realistically, shouldn't be the case. I am wondering if just over time, the chance of any action resulting in no move is just dramatically reducing because of this logical confusion.
I imagine, if for example MOVE_FORWARD can be only move forward or not move, statistically not move would happen more often, than in the current case. This is just me trying to understand the system and maybe this assumption is incorrect.

Any thoughts? By the way, great simulation tool!

I applied a test change and it confirms that the individuals appreciate it. The movement development is more smooth and I actually see like flock of birds, big pile of agents going together changing direction and speed together. Also, I experience, that even after many generations the speed of agents is still within reason, which was not visible before. I will create a PR about the change. It is not complete, but maybe you have ideas how to make it better.

From memory, I believe the code in the repository captures the following approach: the movement direction of an output neuron can be represented by a unit vector which is multiplied by the output value of the neuron. That means the urge to move can be in the direction that the neuron is labeled or in the opposite direction. E.g., if the direction of forward movement during a sim step is (xf, yf), and if the output value of the "move-forward" neuron is A, then the urge to move is A(xf, yf), which might be forward or reverse. That gets summed with all the other urges from the other movement neurons and converted to a final unit movement vector. I think the intent was to make a symmetric opportunity to evolve movement in the positive or negative direction of each movement neuron.

I don't think it's surprising that many individuals evolve a way to move quickly to the survival area leaving the slow ones to die.

I'm sure there are ways to modify this approach that will result in different and interesting behavior.

Thank you for the feedback. I get the philosophy of creative freedom behind this simulator. I will close the task.

ezoic increase your site revenue