Adaptive opponent modelling for the iterated prisoner's dilemma