设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12962|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& M+ {+ K* w5 c6 v* K. Q/ J, h# {
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。9 c/ ~7 Q. b6 t! O

. f# G3 c% u/ I/ a: ^: cbegin P_read arriving. Z- j6 K! L1 z. [0 g
    while 1=1 do begin
) Y2 o' O& J5 M0 C        read A_tote from "data.txt" with delimiter "\n"
8 B/ I* ?* x% ^/ w0 ]        read A_time from "data.txt" with delimiter "\n"
: r6 O3 v# T) G: ?7 }        read A_leave from "data.txt" with delimiter "\n". k2 z* O& c$ i1 L" o3 q
        read A_picks from "data.txt" with delimiter "\n"3 k. L& k+ ]! `; D$ d' W7 L
        set load type to A_tote
2 x/ L8 X3 A) a. `' c% h        if A_tote="tote 1" then set A_induct to 1
  e8 d" K9 ^3 I- x7 Z2 ?        else if A_tote="tote 2" then set A_induct to 2; c) J7 s% E9 x; F
            else set A_induct to 3   
7 d% n3 R8 D$ Q1 I        set A_i to 02 c; h! ?, t' ]% H& x2 E* n
        clone 1 load to P_induction' D- j6 i+ K$ \' T7 a1 }, x/ p
        wait for A_time sec# M% t' z1 d5 }% D" f! G& u
    end0 Z: b0 L# [( h
end
) z7 N( K5 Q+ g6 K  \
5 d5 f- L. T$ r6 i: fbegin P_induction arriving8 A  u/ q/ t# C  v% I: m- l5 p, B
    if A_induct=1 then clone 1 load to P_pick1* D+ c$ ~4 q- g; A( p/ |
    else if A_induct=2 then clone 1 load to P_pick2
* W) G( j0 B4 K; o        else clone 1 load to P_pick36 @: W& C( v7 W2 T
end/ r% J8 }  e0 P" i4 u' ^
% ~. W$ v* k0 Y$ M; K+ J
begin P_pick1 arriving
' P  J, I# }7 c: }    set A_i to 1; P7 E+ N, i8 P# G. J, }. M9 w
    move into Q_induct1
1 ?9 ^8 F5 I; s5 }8 O& K" K    move into pickaisle.induct1
" u* V8 {3 e8 @% N0 ~% j    while A_i<=30 do begin/ v* [" z6 v" z, J! m
        travel to pickaisle.con(A_i)
8 [# X* u+ I5 R* b8 l, d9 G( Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. ?! F! w2 E# a1 T$ ]$ r
        else wait for 10 sec- L: j3 m1 A9 \/ E
        if A_i=A_leave then send to die
& w1 R9 c5 w; t# [; H  w/ ]- J        else inc A_i by 1
. V% T- \7 H+ e. ~    end
& o7 ]& O! `4 G: fend
, @) m4 Z0 x3 K& L1 R3 D% }7 h
1 I% B  a0 E, Bbegin P_pick2 arriving
1 U0 U8 c/ l) P! c    set A_i to 112 \0 j" p. [5 J" R* W2 d+ `
    move into Q_induct28 C3 M8 ?/ l2 F
    move into pickaisle.induct2
  B, y1 C* V/ E    while A_i<=30 do begin
6 p$ o5 [( X9 v6 @) v        travel to pickaisle.con(A_i)4 z- l; G& Q/ Z. ]( \. ~9 i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" D$ V1 t: o( i4 K
        else wait for 10 sec
- ^" G* X  z4 A1 N; D        if A_i=A_leave then send to die
7 B! @, i% g3 U8 G3 L        else inc A_i by 1
) f2 {/ G9 o* `/ T/ m. P& z    end
/ W. ]- g! g, y  \end
$ @. n- w! q: `5 e
5 i. V! b* d2 _# M) j" pbegin P_pick3 arriving% b  w0 f8 {  |  a5 _
    set A_i to 21
1 J% `/ c( t- n+ P, E( S+ W    move into Q_induct3
/ ~( h9 O+ ], w) J7 r2 G    move into pickaisle.induct31 P$ a3 X! ]2 }; [* C
    while A_i<=30 do begin
+ `# w7 B' w8 F8 ~: h        travel to pickaisle.con(A_i)2 j! f% @' H/ s  ?. t6 [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% Q, `# o$ n8 q  g& R' P- Y
        else wait for 10 sec
3 W+ }- k% L% o% P1 P/ {' x8 @        if A_i=A_leave then send to die# o! j9 M$ z' G; `
        else inc A_i by 15 h4 o" w; |0 e7 k  n* \5 _
    end
9 A) f" v# n6 t5 ^end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?
. m% q8 Z) s) t  s) F3 Nmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?, H% d2 p4 A$ C5 ?( @. b. g

  O, v) x& x9 z0 H' SAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 i* p- o( A' Q/ N9 k$ p  H8 |3 _. S; G
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 `- M! y& ~2 H( n9 w% u& B
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% m* w9 M5 V  _1 C
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;2 t+ R  x3 S0 P2 x& I" k
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 d$ I5 d8 W; U$ Y2 W
begin P_induction arriving
2 p; S2 }% c2 h# w! r, U    clone 1 load to P_pick(A_induct)1 o% Y& W; w" u$ Z
end最大的系
% H$ b& _$ E5 @2 y5 q0 N, Z) w2 A5 S* n8 y  K2 r# A0 X" N
begin P_pick arriving, G9 |2 b; T0 P. O( R
    set A_i to procindex * 10 + 1
( A7 a+ p& X! L3 L" G4 I, b) p    move into Q_induct(procindex)
+ P. T1 E/ g7 P4 Q) ^8 a    move into pickaisle.induct(procindex), ~; j- f4 [: g. r4 m
    /*check the type of pickaisle.induct(i), for your last problem.*/: W% D* W# L9 D1 q$ V! ]
  {5 n3 Q, {3 {; C/ c
    while A_i<=30 do begin/ f; Z& v& Z( h& r4 a7 a
        travel to pickaisle.con(A_i)
; P3 n% t5 ]. Y6 U. y1 H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- A1 M5 n1 i6 v( c: J1 e+ w2 l        else wait for 10 sec
0 E& s* F" R0 O: _+ y2 g* J! J6 m        if A_i=A_leave then send to die8 |& n" M) i& Y# P# p0 o
        else inc A_i by 1: j0 j2 G) c- s% h6 _3 _% n
    end6 g6 X* U: x* o6 z6 M1 S- |5 ]
end
& S3 ]! x. M8 }  R0 P! ^- d; I0 i# P7 @/ z( Q
其中的procindex为整形,代表当前process的序号。+ ^! w3 B& L2 S2 y9 V; g
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-3-5 23:19 , Processed in 0.028610 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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