Choosing optimization strategies for automation scripts