Advertisement

Fitness Function

Started by August 13, 2003 01:40 PM
4 comments, last by sam_sam83 21 years, 3 months ago
For fun, I''ve implemented a feed forward neural net, and set up a little scenario to try and evolve a better one. Its just a little open area, where the little guys, each controlled by a net, can move around. I wanted to try and get them to do obstacle avoidance (each other, other stuff in the way) while going towards a goal. So far I haven''t really been able to choose a good fitness function though, they evolve more and more to stay still. Anyways, heres my inputs, feel free to change/del/add to them 6 inputs: 1) angle change needed to go towards goal (0 - -180 left, 0 - 180 right) 2) Collision sensory, extends 10 units out straight forward 3) Collision sensory, extends 10 units out at 45 angle 4) -45 angle 5) 90 6) -90 Output is 0-1, mapped to -180 - 180, each timestep they move 0.25 units
You need distance to goal, and you need to make larger distances be more painful.
Advertisement
I would suggest that instead of using a collision sensor, just compute the relative velocity of an agent to all other agents in a given radius. Then compute the component of these velocities that acts along the line between the agent and the other agents. Give a payoff for an action that decreases this velocity component over a single time step, or changes the sign, such that it makes the agents move apart.

Now, combine this with two more payoffs: 1) for decreasing the angle between the agents heading and the goal; and, 2) for decreasing the distance to the goal.

These payoff rules should preference avoiding other agents while heading toward the goal.

Just one point: since you''re using an ANN, you wont be able to have an indefinite number of inputs and thus you wont be able to consider an indefinite number of agents within a given sensory radius. That''s okay! Most animals (and humans too) are limited in the number of things they can concentrate on at any one time. Just choose a number, say 5, and consider the closest 5 agents to the current agent, for the above computations.

Cheers,

Timkin
Bot Navigation: Neural Networks for Obstacle Avoidance
Bot Navigation: Advanced Obstacle Avoidance

Join us in Vienna for the nucl.ai Conference 2015, on July 20-22... Don't miss it!

Would you just want the 5 closest, or would you want to "focus" on AI that is close to the goal and try to emulate his behavior or strive towards it?
quote: Original post by Stonicus
Would you just want the 5 closest, or would you want to "focus" on AI that is close to the goal and try to emulate his behavior or strive towards it?


What if one of the agents happened to spawn in a state close to the goal, but had rather useless AI?

Presumably your evolution strategy would perfer fitter individuals, which will be those that have gotten closer to the goal and avoided more obstacles, in the alloted time. The scheme I suggested above should enable this.

This topic is closed to new replies.

Advertisement