Text this: New development of analysis tool for optimizing generation cost with gas emission via an electromagnetism like algorithm