#### Archived

This topic is now archived and is closed to further replies.

# Fitness Function

This topic is 5449 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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

##### Share on other sites
You need distance to goal, and you need to make larger distances be more painful.

##### Share on other sites
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

##### Share on other sites
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?

##### Share on other sites
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.

1. 1
Rutin
19
2. 2
3. 3
JoeJ
16
4. 4
5. 5

• 27
• 20
• 13
• 13
• 17
• ### Forum Statistics

• Total Topics
631700
• Total Posts
3001791
×