Greenhouse gases (Gags) are one of the main reasons behind the Earth warming. In Iran, the majority of power plants utilize fossil fuels for generating electricity. And also, the production of Gags from the fossil fuels is very high. Gas production system (GPS) is found to be a good candidate for lowering the amount of Gags produced. Therefore, in this study, the optimal size and operation of different GPSs used in a combined cool, heat, and power system are investigated. Particle swarm optimization algorithm is used for optimization. The results show that the sewage sludge GPS with reciprocating engine (RE) has the lowest payback period. In addition, the RE has the highest pollution cost under the condition of selling electricity to the electrical network.