This code is a set of notes to allow me to work out the algorithm to fill a lineup for youth soccer.
Maybe it will become a tool that I can share with other parents that (like me) don't know anything about soccer, but find themselves coaching.
Manually, I look at all the periods before I can complete the first period - I sometimes pencil in names just to see where it will go.
If I don't know much about the players, I can draft the first period without much thought. The more I know, the more options I have; the slower it goes overall.
As I learn more about the players, the decisions become easier. When the decisions become too easy, it's time to shake it up to challenge the players.
I often try scenarios with all periods full and then (if filling lineup to win- which is secondary to player pref/skill needs) change names based on ability/endurance
Need to know open positions- or at some point we will. perhaps not right now.
To loop the periods or not to loop the periods...For the first try, I'll loop them. When the decisions are programmed, perhaps we can fill across the game.
Find preferred position and work our way to least preferred.
Can you give a player their first pick?
Can you give a player their second pick?
So on,so forth
If no players prefer this position but the position is empty, pick a random player, until we can look at history of who got their top picks and who didn't. And who has the most play time.
Add the ability to pick a player for a position based on who last got what they wanted.
If player is not already starting this period, we can pick one randomly
Introduce best fit as this tool gains wisdom
Determine if player started in this position in the game yet.
When positions are full, fill the bench.
Check that a player hasn't been on the bench yet
Add ability for player to can get a history from games it has played in
Game keeps track of periods, periods keep track of positions.
Add Coach's rank for player ability in a position
Add configurable selection - maximize rotation, equal play time, by player pref, to win
Add ability to enter substitutions- How does a sub effect future selection of player that needed to come out?
After looking at the positions inside of a period and the periods inside of a game, I realize that I might make a better decision just by looking at the player preferences. In my professional work, I have come to the thought (thoughts that I can have only due to the work of my colleagues building a model and the opportunity to hear our users talk about their specific domain) that we must identify the rarest resource and place all other resources in flux around those immovable points in time at which the resource is available. The rarest resource in the first scenario is a player's preference.