Self-learning demand forecasting and swarm-based inventory optimization with uncertainty quantification