'Add host.
name: name of host to add
cls: custom host class/constructor (optional)
params: parameters for host
returns: added host'

def addHost(self, name, cls=None, **params):

    defaults = {'ip': (ipAdd(self.nextIP, ipBaseNum=self.ipBaseNum, prefixLen=self.prefixLen) + ('/%s' % self.prefixLen))}
    if self.autoSetMacs:
        defaults['mac'] = macColonHex(self.nextIP)
    if self.autoPinCpus:
        defaults['cores'] = self.nextCore
        self.nextCore = ((self.nextCore + 1) % self.numCores)
    self.nextIP += 1
    defaults.update(params)
    if (not cls):
        cls = self.host
    h = cls(name, **defaults)
    self.hosts.append(h)
    self.nameToNode[name] = h
    return h
