Implemented I and II gymnasium classes optimization algorithm