Model of Long-Term and Short-Term Planning and Optimization of the Operation of Hydroelectric Power Stations in the Basins