當前位置: 首頁>>代碼示例>>Python>>正文


Python System.channels[channel]['src']方法代碼示例

本文整理匯總了Python中system.System.channels[channel]['src']方法的典型用法代碼示例。如果您正苦於以下問題:Python System.channels[channel]['src']方法的具體用法?Python System.channels[channel]['src']怎麽用?Python System.channels[channel]['src']使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在system.System的用法示例。


在下文中一共展示了System.channels[channel]['src']方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: remove_users

# 需要導入模塊: from system import System [as 別名]
# 或者: from system.System import channels[channel]['src'] [as 別名]
            for channel in system.access_point[pos].iterkeys():
                for ap, prob in system.access_point[pos][channel].iteritems():
                    server_access_numbers[ap][channel] += system.viewers[pos][channel] * prob
        for leaving_user in trace.events[round_no][3]:
            position, channel_id, access_id = trace.viewers[leaving_user]
            del trace.viewers[leaving_user]
            leaving_users[position][access_id] += 1
            system.viewers[position][channel_id] -= 1
            server_access_numbers[access_id][channel_id] -= 1
        remove_users(leaving_users, topology, system)
        shrink_delivery_tree(server_access_numbers, trace.events[round_no][1], topology, system)
        print "Leaving user removed!"

        # Add new channels
        for channel in trace.events[round_no][0]:
            system.channels[channel]['src'] = topology.get_nearest_server(trace.channels[channel])
            system.channels[channel]['sites'] = []
        print "New channels prepared!"

        algo = Multicast(topology, trace, system, round_no)
        # Compute deliver tree and access points for current trace. The results should be stored in system
        channels_with_new_delivery_tree, new_delivery_tree = algo.compute(incremental=True)
        print "Algorithm computation complete!"
        # Update network status based on updated system
        failed_access, failed_deliver = update_network_status(topology, trace, system, round_no,
                                                              channels_with_new_delivery_tree,
                                                              new_delivery_tree, incremental=True)
        print failed_access, failed_deliver, len(channels_with_new_delivery_tree)

        # Remove expiring events
        trace.events[round_no] = [[], [], [], []]
開發者ID:cabeggar,項目名稱:simlive,代碼行數:33,代碼來源:main.py


注:本文中的system.System.channels[channel]['src']方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。