Star Spectral Classes?

Basically I'm trying to code a random solar system generator based on "real principles". I've searched the net and found a bunch of useful information but I'm a bit confused about spectral classes. I know of the O,B,A,F,G,K,M classes (Harvard spec) but theres another specification thats... show more Basically I'm trying to code a random solar system generator based on "real principles". I've searched the net and found a bunch of useful information but I'm a bit confused about spectral classes.
I know of the O,B,A,F,G,K,M classes (Harvard spec) but theres another specification thats confusing me. Some sites refer to it as spectral class, some as size code and others as luminosity class. This is the 0,Ia,Ib,II,III,IV,V classification.
Basically I want to generate a random star given the estimated odds of such a star existing. I found this document but it isn't really clear (http://www.trisen.com/sol/static/wg/i-one1.html) Can there be any combination of the two classes above or only certain combinations? Should I generate the first class type (e.g. Class G like our sun) then randomly choose the "other" class (e.g. V).
I'm finding it hard to explain but any help is much appreciated.

Thanks!
Update: How does the luminosity/size or whatever its called (e.g. Ia, IV, V etc.) relate to the Hertzsprung-Russell diagram
4 answers 4