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


Python Model.withPackets方法代码示例

本文整理汇总了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)
开发者ID:rslawik,项目名称:mgr-simulation,代码行数:6,代码来源:test_PacketGenerator.py

示例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)
开发者ID:rslawik,项目名称:mgr-simulation,代码行数:8,代码来源:test_PacketGenerator.py

示例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)
开发者ID:rslawik,项目名称:mgr-simulation,代码行数:6,代码来源:test_Model.py

示例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)
开发者ID:rslawik,项目名称:mgr-simulation,代码行数:5,代码来源:test_Algorithm.py


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