设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 3831|回复: 0

编程语言选择

[复制链接]
发表于 2008-4-15 06:46:33 | 显示全部楼层 |阅读模式
5仿真币
各位好:
      对FLEXSIM编程,使用的多的是什么语言。如下:
PROSEEND
//   I know this code looks confusing for a simple random algorithm.
//  The reason I have to do all of this stuff is because this code is evaluated twice: once when
//  the warehouse picker wants to know his offset, and once when the item actually enters.
//  Thus, if a stochastic variable is used, it needs to be recorded, so that we don't
//   re-evaluate, and thus get a different answer the second time.fsnode* item = parnode(1);
fsnode* curlabel = node("/f_curbaynumber", labels(item));
if(! objectexists(curlabel) )
{
   nodeinsertinto(labels(item));
   curlabel = last(labels(item));
   setname(curlabel, "f_curbaynumber");
   nodeadddata(curlabel, DATATYPE_NUMBER);
   fsnode* initialbay = rank(o(Rack, current).node_v_contenttable, trunc(uniform(1, content(o(Rack, current).node_v_contenttable) + .999)));
   fsnode* currentbay = initialbay;
   while(objectexists(currentbay))
   {
      if(getnodenum(currentbay) < content(currentbay))
      {
        setnodenum(curlabel, getrank(currentbay));
        return getrank(currentbay);
      }
      currentbay = next(currentbay);
   }
   currentbay = prev(initialbay);
   while(getrank(currentbay) >= 1)
   {
     if(getnodenum(currentbay) < content(currentbay))
     {
        setnodenum(curlabel, getrank(currentbay));
        return getrank(currentbay);
     }
     currentbay = prev(currentbay);
   }

  setnodenum(curlabel, 1);
  return 1;
}
else
{
  float returnvalue = getnodenum(curlabel);
  destroyobject(curlabel);
  return returnvalue;
}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2024-11-22 02:17 , Processed in 0.011478 second(s), 11 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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