Learning to delegate: duopolistic competition among adaptive principals and agents