Time optimal switching commands by adaptive genetic algorithms