FIS synthesis by clustering for microgrid energy management systems