def get_investments(self, diversity=0): """get a list of investments offering the required level of diversity @param diversity: """ ans = get_diverse_sample(self.investments, diversity) return ans
def get_other_investments(self, diversity=0): """get a list of investments from other economies offering the required level of diversity @param diversity: """ otherInv = [] for econ in [e for e in self.simInfo.economyDirectory.values() if e != self]: otherInv.extend(econ.investments) return get_diverse_sample(otherInv, diversity)