Optimization of channel allocation in wireless body area networks by means of reinforcement learning