An integrated framework for sizing and energy management of hybrid energy systems using finite automata. (15th September 2019)