Battery Management in a Green Fog-Computing Node: a Reinforcement-Learning Approach