本文整理汇总了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)