Viruses are not alive, and are incapable of having any kind of strategy. However, the factors that enable them to propagate can almost make them seem to think. The reality is that there are many viruses that reach dead ends and do not propagate, but we never see those. We only see the mutants that do propagate. So the illusion is that they analyze intelligently and adapt themselves to their environment.
You made my original point better than I did. Then, I got off the rails.