@classmethod
def getAffinity(cls):
    """Get AWLSIM_AFFINITY.
		Returns a list of host CPU indices or an empty list,
		if all host CPUs are allowed.
		"""
    affinityStr = cls.__getVar('AFFINITY', '')
    affinity = []
    try:
        for cpuIndex in affinityStr.split(','):
            cpuIndex = int(cpuIndex)
            if cpuIndex < 0:
                cpuIndex = cls.__getCpuCount() + cpuIndex
            if cpuIndex < 0:
                cpuIndex = 0
            affinity.append(cpuIndex)
    except ValueError as e:
        affinity = []
    return sorted(set(affinity))
