Learning of behavior trees for autonomous agents