An efficient method for simulating uni- and bi- directional spectrum-compatible ground motions using particle swarm optimization