Fair electricity transfer price and unit capacity selection for microgrids