A Multimodal Optimization Algorithm Inspired by the States of Matter