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


Python Market.reset方法代码示例

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


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

示例1: test_market

# 需要导入模块: from market import Market [as 别名]
# 或者: from market.Market import reset [as 别名]
def test_market(n, m, t, partial, writer):
    market = Market(n, m, t, partial)
    serialDictatorship.serial_dictatorship(market)
    serial_happy = evaluation.happy(market)
    serial_percent_served = evaluation.percent_served(market)
    serial_avg_time = evaluation.average_time(market)

    market.reset()
    serialDictatorship.modified_serial_dictatorship(market)
    mod_happy = evaluation.happy(market)
    mod_percent_served = evaluation.percent_served(market)
    mod_avg_time = evaluation.average_time(market)

    market.reset()
    minLocations.minimize_locations(market)
    min_loc_happy = evaluation.happy(market)
    min_loc_percent_served = evaluation.percent_served(market)
    min_loc_avg_time = evaluation.average_time(market)

    row = [n, m, t, partial, serial_happy, serial_percent_served,
           serial_avg_time, mod_happy, mod_percent_served, mod_avg_time,
           min_loc_happy, min_loc_percent_served, min_loc_avg_time]
    writer.writerow(row)
开发者ID:R4chel,项目名称:CornellDiningMatchingMarkets,代码行数:25,代码来源:results.py


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