Transition model for the hermaphroditism-dioecy continuum in higher plants