How Agents Learn to Manage the Speed-Accuracy Tradeoff