可以说,在我的系统中,我将种子设置为set.seed(123)。它将从我的数据中选择一些随机行。如果我们在使用相同数据的不同机器上使用相同代码,它将选择与我相同的数据吗?
@RestController
public class NewServiceController
{
@Autowired
EsbcoreServiceRepository serviceRepo;
@Autowired
EsbcoreRuleRepository ruleRepo;
@Autowired
EsbcoreRuleConditionRepository ruleConditionRepo;
@Autowired
EsbcoreRuleDestinationRepository ruleDestinationRepo;
@Autowired
EsbcoreServiceDestinationRepository serviceDestinationRepo;
@GetMapping(value="/api/allservices")
public Map<String, Object> getAllServices()
{
Map<String, Object> servicesMap=new HashMap<String, Object>();
servicesMap.put("services", serviceRepo.findAll());
servicesMap.put("rules", ruleRepo.findAll());
servicesMap.put("ruleConditions", ruleConditionRepo.findAll());
servicesMap.put("ruleDestinations", ruleDestinationRepo.findAll());
servicesMap.put("serviceDestinations", serviceDestinationRepo.findAll());
return servicesMap;
}
我得到的结果如下。
set.seed(123)
sample(1:6, 10, replace=TRUE)
如果我从不同的系统运行相同的代码,那么我会得到相同的结果还是不同的结果?