| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 768 人关注过本帖
标题:循环迭代程序 数据文件的读写~
只看楼主 加入收藏
泪光缘
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-5-9
收藏
 问题点数:0 回复次数:1 
循环迭代程序 数据文件的读写~
c1:=2.0;
c2:=2.0;
w:=0.5;
v_max=100;

var temp,temp_p,ran:=real;
position:=array[0..dim] of real;
pi_min:=array[0..dim] of real;
pg_min:=array[0..dim] of real;
begin
position[0]:=-50.2;
position[1]:=60.0;
pi_min[0]:=100;
pi_min[1]:=100;
pg_min[0]:=0;
pg_min[1]:=0;
temp:=0;temp_p:=0

randomsize;
ran:=random(50);

for i to dim do
begin
for k to ran do
temp:=w*position[i]+c1*ran*(pi_min[i]-position[i])+c2*ran*(pg_min[i]-position[i]);
if temp>v_max then v_max:=temp;
if temp<-v_max then v_max:=temp;


temp_p:=temp+position;
if temp>v_max then v_max:=temp;
if temp<-v_max then v_max:=temp;

end;
end;

搜索更多相关主题的帖子: 数据文件 ran temp array 
2007-05-09 09:33
泪光缘
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-5-9
收藏
得分:0 
回复:(泪光缘)循环迭代程序 数据文件的读写~
高手帮我看看我编的程序对不对阿~
如果我想把我的每次循环迭代的数据都保存在一个.txt文件中
应该怎样编阿!~
2007-05-09 09:35
快速回复:循环迭代程序 数据文件的读写~
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012311 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved