The optimal management of the prosumer's resources via stochastic programming