I am currently building a neural network with genetic algorithms that learns to fly a 2D drone to a target. My goal is that it achieves all tasks as fast as possible, but I want the drone to also fly stable and upright. The way I tried to calculate the fitness was to create a function that has the greatest value when the drone does everything I want right.
fitness += 1/distToTarget + cos(drone_angle)
My current inputs are:
difference_target_X
difference_target_Y
velocity_X
velocity_Y
angular_velocity (degree per second)
drone_angle | = 0; |_ = 90 _| = -90
The output (I don't think it is important but)
left_thruster_angle
left_thruster_boost
right_thruster_angle
right_thruster_boost
The NN is programmed in unity and the drone uses a 2D rigid body and the NN adds a force to the thruster at the right angle.
How do I get the drone to set the best weights to fulfill all tasks: fly stable, fly fast, fly to the target?