Hierarchical clustering in particle physics through reinforcement learning