本文整理汇总了Python中nepi.execution.ec.ExperimentController.plot方法的典型用法代码示例。如果您正苦于以下问题:Python ExperimentController.plot方法的具体用法?Python ExperimentController.plot怎么用?Python ExperimentController.plot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nepi.execution.ec.ExperimentController
的用法示例。
在下文中一共展示了ExperimentController.plot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_serialize
# 需要导入模块: from nepi.execution.ec import ExperimentController [as 别名]
# 或者: from nepi.execution.ec.ExperimentController import plot [as 别名]
def test_serialize(self):
node_count = 4
app_count = 2
ec = ExperimentController(exp_id = "plotter-test")
# Add simulated nodes and applications
nodes = list()
apps = list()
ifaces = list()
for i in xrange(node_count):
node = ec.register_resource("dummy::Node")
nodes.append(node)
iface = ec.register_resource("dummy::Interface")
ec.register_connection(node, iface)
ifaces.append(iface)
for i in xrange(app_count):
app = ec.register_resource("dummy::Application")
ec.register_connection(node, app)
apps.append(app)
link = ec.register_resource("dummy::Link")
for iface in ifaces:
ec.register_connection(link, iface)
fpath = ec.plot()
statinfo = os.stat(fpath)
size = statinfo.st_size
self.assertTrue(size > 0)
self.assertTrue(fpath.endswith(".png"))
os.remove(fpath)
fpath = ec.plot(format = PFormats.DOT)
statinfo = os.stat(fpath)
size = statinfo.st_size
self.assertTrue(size > 0)
self.assertTrue(fpath.endswith(".dot"))
os.remove(fpath)