Real-time management solutions for a smart polygeneration microgrid