From cogeneration to trigeneration: energy planning and evaluation in a competitive market framework