Simultaneous attainment of energy goals by means of green certificates and emission permits