Is this a correct (psuedo-c code) algorithm for how the AI evaluates what to build when parsing AI_Construction_Vehicles.txt?
Code:
while(we need to add things to build queues) {
  // Case is just saying, go to the state we are currently in.
  case (state) {
    STATENAME:
      // Parse every type in the list for this state.
      for (int # = 1; # <= Num Queue Entries; ++#) {
        PPI = Entry 1 Planet Per Item;
        Num Planets = count up all of our colonies;
        Num Ships of Type = number of the ships we own of type Entry # Type;
        // Build one item based on the PPI condition per iteration of the
        // main loop.
        if (PPI < (Num Planets / Num Ships of Type))
        {
          construct Entry # Type;
        }
        // Build as many as are needed to satisfy Must Have At Least on every
        // iteration of the main loop.
        while (Num Ships of Type < Entry # Must Have At Least)
        {
          construct Entry # Type;
        }
      }
  }
}