in reply to Baseball line up (best rotation)

I wish you well in finding a reasonable solution.

I may be off-base (no pun intended), but my thinking is that this might be related to the knapsack problem, and that you might want to take a look at code solving that problem as a starting point. The knapsack problem involves the idea of a number of objects, each with a weight/value, in which the goal is to find as good a possible arrangement of objects as can be stored in the container (the container having a maximum capacity). In your case, this is finding a better arrangement of players in a lineup, where the value is the number of bases they reach per hit (or something similar). The knapsack problem is also one of a set of possibly NP-complete problems (so finding references to it is not difficult).

Hope that helps, and good luck on your search.