Towards a Formal Theory of the Need for Competence via Computational Intrinsic Motivation