Smart Polygeneration Microgrid in real time