An optimal-resource allocation model is developed for ramets (daughter plants), rhizomes (or other horizontal stems, such as stolons) and seeds for plants growing in a spatially varying environment. It is assumed that a parent may elongate rhizomes, and that if a rhizome encounters a patch with high resource availability, it stops growing and forms a ramet on the terminal of the rhizome in that patch, whereas the rhizome forms a ramet outside patches if it cannot encounter a favorable patch. It is shown that, with a moderate probability of seed establishment, the optimal resource allocation patterns change, largely depending on the favorability and the number of patches. That is, if patches are more favorable, parents elongate rhizomes to place their ramets in favorable patches selectively, rather than disperse seeds randomly without patch selection, because increasing favorability of patches substantially favors rhizome production over seed production. In addition, parents also emphasize rhizome elongation if there are more patches per unit area because parents need not elongate longer rhizomes. However, parents produce seeds and ramets without rhizomes or only seeds if the degree of the favorability of patches is low or the number of patches is small. On the other hand, parents produce ramets with or without rhizomes but no seeds with a smaller probability of seed establishment, whereas they emphasize seed production rather than rhizome elongation with a larger probability of seed establishment.