Factors affecting resource allocation in the legume-rhizobia symbiosis