找回密码
 注册
Simdroid-非首页
查看: 145|回复: 4

[命令/FISH] 初学请教:怎样把已知的一部分节点流量求和?

[复制链接]
发表于 2007-12-24 12:09:16 | 显示全部楼层 |阅读模式 来自 湖南长沙
请问各位,我要求几十个节点的流量和,我只知道求一个的,把每一个都加起来应该怎么写啊?
def liuliang
   p_gp = find_gp(20710)
   liuliang=0.0
   if gp_flow(p_gp) # null
   liuliang=liuliang+gp_flow(p_gp)
   endif
end
 楼主| 发表于 2007-12-24 12:17:03 | 显示全部楼层 来自 湖南长沙
Simdroid开发平台
能不能这样:
def liuliang
   p_gp1= find_gp(ID1)
   p_gp2= find_gp(ID2)
   p_gp3= find_gp(ID3)
   ....
   p_gpn= find_gp(IDn)
   liuliang=0.0
   loop i (1,n)
   if gp_flow(p_gpi) # null
   liuliang=liuliang+gp_flow(p_gp)
   endif
   endloop
end
回复 不支持

使用道具 举报

 楼主| 发表于 2007-12-26 19:43:03 | 显示全部楼层 来自 湖南长沙
有哪位能高手顶一个吧?不会啊
回复 不支持

使用道具 举报

发表于 2015-12-9 16:49:18 | 显示全部楼层 来自 湖南长沙
兄弟,帮我大忙了啊
回复 不支持

使用道具 举报

发表于 2015-12-10 12:54:43 | 显示全部楼层 来自 北京
你可以试试inrange(string,point)这个函数
回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Simapps系列直播

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-9-23 18:36 , Processed in 0.048602 second(s), 14 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表