本文整理汇总了Python中Model.Model.withPackets方法的典型用法代码示例。如果您正苦于以下问题:Python Model.withPackets方法的具体用法?Python Model.withPackets怎么用?Python Model.withPackets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model.Model
的用法示例。
在下文中一共展示了Model.withPackets方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_experiment1length
# 需要导入模块: from Model import Model [as 别名]
# 或者: from Model.Model import withPackets [as 别名]
def test_experiment1length(self):
model = Model.withPackets(3, 5)
self.assertEqual(len(list(PacketGenerator.sirocco_thm9(6, model))), 6)
self.assertEqual(len(list(PacketGenerator.sirocco_thm9(5, model))), 5)
示例2: test_sirocco_thm9_iteration
# 需要导入模块: from Model import Model [as 别名]
# 或者: from Model.Model import withPackets [as 别名]
def test_sirocco_thm9_iteration(self):
model = Model.withPackets(3, 5)
expected = [(0, 3), (0, 5), (8, 3), (8, 5), (16, 3), (16, 5)]
generator = PacketGenerator.sirocco_thm9(6, model)
for ie, eic in zip(generator, expected):
self.assertEqual(ie, eic)
示例3: test_createModelWithPackets
# 需要导入模块: from Model import Model [as 别名]
# 或者: from Model.Model import withPackets [as 别名]
def test_createModelWithPackets(self):
packets = [1, 2]
model = Model.withPackets(*packets)
self.assertModelEqual(model, 0.0, {1.0: 0.5, 2.0: 0.5}, 1.0)
示例4: setUp
# 需要导入模块: from Model import Model [as 别名]
# 或者: from Model.Model import withPackets [as 别名]
def setUp(self):
model = Model.withPackets(1, 2, 8)
self.algorithm = Greedy(model)