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


Python Simulator.server方法代码示例

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


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

示例1: simulationLoop

# 需要导入模块: from Simulator import Simulator [as 别名]
# 或者: from Simulator.Simulator import server [as 别名]
def simulationLoop(server, capacity, period, scaled, ex_time, int_time):
        name = server + ".csv"
        s = Simulator(stats = name)

        # Set the server
        if server == 'polling':
            s.server = PollingServer(capacity, period)
        elif server == 'deferrable':
            s.server = DeferrableServer(capacity, period)
        else:
            s.server = BackgroundServer()


        # Load the taskset
        for t in scaled:
            s.tasks.append(t)

        # Create the aperiodic task
        ap = AperiodicTask("Soft", ex_time, int_time)
        s.tasks.append(ap)


        # RUUUUUUUUN !!!
        s.init(until)
        s.run()


        return computeAverage(name)
开发者ID:markusian,项目名称:hybrid-scheduling,代码行数:30,代码来源:ToButtazzo2.py

示例2: list

# 需要导入模块: from Simulator import Simulator [as 别名]
# 或者: from Simulator.Simulator import server [as 别名]
# Building tasks set
taskset = list()
for i in range(0,10):
    t = PeriodicTask("H" + str(i), wcet[i], periods[i])
    taskset.append(t)

#for load in [0.05, 0.10, 0.15, 0.20, 0.25, 0.30]:
for load in [0.05]:
    # Try the simulator
    s = Simulator(render = "results.svg")

    server_period = min([t.period for t in taskset])
    server_period = 18  
    #server_period = max([t.period for t in taskset]) + 1
    server_capacity = server_period * 0.248
    s.server = PollingServer(server_capacity, server_period)
    server_capacity = server_period * 0.239
    s.server = DeferrableServer(server_capacity, server_period)
    #s.server = DeferrableServer(server_period, server_period)
    #s.server = BackgroundServer()

    for t in taskset:
        s.tasks.append(t)

    # Building the aperiodic task
    interrarival = 18
    computation = load * interrarival
    t = AperiodicTask("S", computation, interrarival)
    
    s.tasks.append(t)
开发者ID:markusian,项目名称:hybrid-scheduling,代码行数:32,代码来源:Buzzato.py


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