Using Reinforcement Learning To Improve Network Reliability Through Optimal Resource Allocation