The interaction of intense laser fields with xenon and silver clusters is investigated using the nanoplasma model. An effective tool to control the plasma dynamics is pulse shaping, i.e., a modulation of phase and amplitude of the laser pulse. In particular, the yield of highly charged ions can be controlled. For an understanding of the underlying physical processes in the dynamics of laser-cluster interaction, a theoretical description using a genetic algorithm and basing on the relatively simple nanoplasma model seems to be promising. In the present approach, the time evolution of the laser intensity has been parametrized. The parameters where optimized with a genetic algorithm to get, e.g, a maximal yield of a specific ion species.