def ltesession(opt):
    session = Ns3Session(persistent=True, duration=opt.duration)
    lte = session.addobj(cls=Ns3LteNet, name="wlan1")
    lte.setsubchannels(range(25), range(50, 100))
    if opt.verbose:
        ascii = ns.network.AsciiTraceHelper()
        stream = ascii.CreateFileStream('/tmp/ns3lte.tr')
        lte.lte.EnableAsciiAll(stream)
        #ns.core.LogComponentEnable("EnbNetDevice", ns.core.LOG_LEVEL_INFO)
        #ns.core.LogComponentEnable("UeNetDevice", ns.core.LOG_LEVEL_INFO)
        #lte.lte.EnableLogComponents()

    prefix = ipaddr.IPv4Prefix("10.0.0.0/16")
    mobb = None
    nodes = []
    for i in xrange(1, opt.numnodes + 1):
        node = session.addnode(name = "n%d" % i)
        mob = ns.mobility.ConstantPositionMobilityModel()
        mob.SetPosition( ns.core.Vector3D(10.0 * i, 0.0, 0.0) )
        if i == 1:
            lte.setnodeb(node) # first node is nodeb
            mobb = mob
        node.newnetif(lte, ["%s/%s" % (prefix.addr(i), prefix.prefixlen)])
        nodes.append(node)
        if i == 1:
            (tmp, ns3dev) = lte.findns3dev(node)
            lte.lte.AddMobility(ns3dev.GetPhy(), mob)
        if i > 1:
            lte.linknodeb(node, nodes[0], mob, mobb)
            
    session.thread = session.run(vis=opt.visualize)
    return session
A quick and dirty way to view the nested nature of the tree
dataset/ETHPy150Open coreemu/core/daemon/ns3/examples/ns3lte.py/ltesession--crossover with--dataset/ETHPy150Open christabor/MoAL/MOAL/data_structures/trees/trie.py/NaiveTrie.view