当前位置: 首页>>代码示例>>Python>>正文


Python Transmitter.process_ack方法代码示例

本文整理汇总了Python中transmitter.Transmitter.process_ack方法的典型用法代码示例。如果您正苦于以下问题:Python Transmitter.process_ack方法的具体用法?Python Transmitter.process_ack怎么用?Python Transmitter.process_ack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在transmitter.Transmitter的用法示例。


在下文中一共展示了Transmitter.process_ack方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from transmitter import Transmitter [as 别名]
# 或者: from transmitter.Transmitter import process_ack [as 别名]
def main():
    nrx=3
    # Create a tx
    ntx=3
    ta = None
    #ta = SampleRate()
    transmitter = Transmitter(ntx,ta)
    # Create a channel
    
    chan = TraceChan()
    num_chans=1
    length = chan.create_chan(transmitter.Ntx,nrx)

    #ta = OracleRA(chan)
    #transmitter.set_transmit_ra(ta)
    #receiver = Receiver(MaxTputRA(),nrx)
    #receiver = Receiver(MinEngRA(),nrx)
    receiver = Receiver(EngTputRA(),nrx)
    #receiver = Receiver(EffSnrRA(),nrx)
    #receiver = Receiver(RxSampleRate(),nrx)
    #receiver = Receiver(RxOracle(),nrx)

    #length =10
    for num in range(0,length):
        pkt = transmitter.transmit_pkt()
        chan.apply_channel(pkt)
        #print chan.curr_chan
        #print pkt
        
        # Create receiver
        receiver.receive_pkt(pkt)
        ack_pkt = receiver.get_feedback_pkt()
        
        transmitter.process_ack(ack_pkt)
开发者ID:yichao0319,项目名称:Energy-Aware-RA-Simulator,代码行数:36,代码来源:trace_simulation.py

示例2: main

# 需要导入模块: from transmitter import Transmitter [as 别名]
# 或者: from transmitter.Transmitter import process_ack [as 别名]
def main():
    if len(sys.argv) == 6:
        filename = sys.argv[1]
        card_type = sys.argv[2]
        energy_constraint = sys.argv[3]
        chan_pred = eval(sys.argv[4])
        increment = eval(sys.argv[5])
        print "filename: " + str(filename)
    else:
        print "Correct usage: python simulate_maxtput.py trace_file card_type tx/rx pred(True/False)"
        sys.exit(1)

    nrx = 3
    # Create a tx
    ntx = 3
    ta = None
    transmitter = Transmitter(ntx, ta)
    # Create a channel

    chan = TraceChan(filename)
    num_chans = 1
    length = chan.create_chan(transmitter.Ntx, nrx)

    extname = (
        filename.split("/")[-1].split(".")[0]
        + "_"
        + card_type
        + "_"
        + energy_constraint
        + "_pred"
        + str(chan_pred)
        + "_inc"
        + str(increment)
    )
    # print extname
    receiver = PPrReceiver(PPrMinEngRA(card_type, energy_constraint, chan_pred), nrx, extname)

    if length > 10000:
        length = 10000
    # length = 2

    for num in range(0, length):
        itr_tic = time.clock()
        pkt = transmitter.transmit_pkt()
        chan.apply_channel(pkt)
        # print chan.curr_chan
        # print pkt

        # Create receiver
        receiver.receive_pkt(pkt)
        ack_pkt = receiver.get_feedback_pkt()

        transmitter.process_ack(ack_pkt)
        itr_toc = time.clock()
开发者ID:yichao0319,项目名称:Energy-Aware-RA-Simulator,代码行数:56,代码来源:simulate_pprmineng.py

示例3: main

# 需要导入模块: from transmitter import Transmitter [as 别名]
# 或者: from transmitter.Transmitter import process_ack [as 别名]
def main():

    if len(sys.argv) == 5:
       filename = sys.argv[1]
       card_type = sys.argv[2]
       energy_constraint = sys.argv[3]
       chan_pred = eval(sys.argv[4])
       increment = 1
       print "filename: "+str(filename)
    elif len(sys.argv) == 6:
       filename = sys.argv[1]
       card_type = sys.argv[2]
       energy_constraint = sys.argv[3]
       chan_pred = False
       increment = eval(sys.argv[5])
       print "filename: "+str(filename)
    else:
        print "Correct usage: python simulate_effsnr.py trace_file card_type tx/rx pred(True/False)"
        sys.exit(1)

    nrx=3
    # Create a tx
    ntx=3
    ta = None
    transmitter = Transmitter(ntx,ta)
    # Create a channel
    
    chan = TraceChan(filename, increment)
    num_chans=1
    length = chan.create_chan(transmitter.Ntx,nrx)
 
    ta = OracleEffSnrRA(card_type,energy_constraint,chan)
    transmitter.set_transmit_ra(ta)
    extname=ta.name+"_"+filename.split('/')[-1].split('.')[0]+"_"+card_type+"_"+energy_constraint+"_pred"+str(chan_pred)+"_inc"+str(increment)
    receiver = Receiver(RxOracle(card_type,energy_constraint),nrx,extname)

    if length > 10000: length = 10000
    #length =10
    for num in range(0,length):
        pkt = transmitter.transmit_pkt()
        chan.apply_channel(pkt)
        #print chan.curr_chan
        #print pkt
        
        # Create receiver
        receiver.receive_pkt(pkt)
        ack_pkt = receiver.get_feedback_pkt()
        
        transmitter.process_ack(ack_pkt)
开发者ID:yichao0319,项目名称:Energy-Aware-RA-Simulator,代码行数:51,代码来源:simulate_oracle_effsnr.py

示例4: main

# 需要导入模块: from transmitter import Transmitter [as 别名]
# 或者: from transmitter.Transmitter import process_ack [as 别名]
def main():
    if len(sys.argv) == 7:
       filename = sys.argv[1]
       card_type = sys.argv[2]
       energy_constraint = sys.argv[3]
       chan_pred = eval(sys.argv[4])
       threshold = eval(sys.argv[5])
       increment = eval(sys.argv[6])
       print "filename: "+str(filename)
    else:
        print "Correct usage: python simulate_engtput.py trace_file card_type tx/rx pred(True/False) threshold chan_increment"
        sys.exit(1) 

    nrx=3
    # Create a tx
    ntx=3
    ta = None
    transmitter = Transmitter(ntx,ta)
    # Create a channel
    
    chan = TraceChan(filename, increment)
    length = chan.create_chan(transmitter.Ntx,nrx)
 
    extname=filename.split('/')[-1].split('.')[0]+"_"+card_type+"_"+energy_constraint+"_pred"+str(chan_pred)+"th"+str(threshold)+"_inc"+str(increment)
    receiver = Receiver(EngTputRA(card_type,energy_constraint,chan_pred,threshold),nrx,extname)

    if length > 10000: length = 10000

    for num in range(0,length):
        pkt = transmitter.transmit_pkt()
        chan.apply_channel(pkt)
        #print chan.curr_chan
        #print pkt
        
        # Create receiver
        receiver.receive_pkt(pkt)
        ack_pkt = receiver.get_feedback_pkt()
        
        transmitter.process_ack(ack_pkt)
开发者ID:yichao0319,项目名称:Energy-Aware-RA-Simulator,代码行数:41,代码来源:simulate_engtput.py


注:本文中的transmitter.Transmitter.process_ack方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。