设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15348|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 @0 y, u6 }6 Y9 l, @& }# \

1 H  q, H$ X+ l! ?8 t8 M% j我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ h0 s# n: Y- q, a- `

: q" V' W0 ~4 d( pbegin P_read arriving
' Z6 q9 H; e  M, ?+ k. F    while 1=1 do begin6 ]; _4 j: U: x5 l5 S& U
        read A_tote from "data.txt" with delimiter "\n"
$ q5 j; r& D" D6 m        read A_time from "data.txt" with delimiter "\n"& e  Y6 g4 u$ Y) G0 F
        read A_leave from "data.txt" with delimiter "\n"5 \  o3 E$ N2 b, R5 S5 S
        read A_picks from "data.txt" with delimiter "\n"
' q8 f# }- K; w0 i. N+ K- b        set load type to A_tote2 Y3 m$ }& G- z+ j  z9 P( c
        if A_tote="tote 1" then set A_induct to 1
" A/ R1 X) S: z: u, Y! Q0 i" `. H        else if A_tote="tote 2" then set A_induct to 2
3 ~6 }* B! ~" ~, G9 a9 I% T            else set A_induct to 3   
+ {3 e7 }: I2 V" Q: c7 s# w, B        set A_i to 0
" W' O) w* F0 E, `6 g. O        clone 1 load to P_induction# D+ W  ?0 K9 e5 u7 Z9 d
        wait for A_time sec
/ ~. `- Q; R+ T. o8 s1 p    end% y! \9 O. l. l. k( R- @
end
2 {% \1 N6 ]9 _. P( _* m0 e
! ?( h4 h8 O5 Abegin P_induction arriving$ z$ C6 |0 ?, e* M3 y0 y
    if A_induct=1 then clone 1 load to P_pick1
( {1 u. @8 l6 Y* c; b- P- s8 g    else if A_induct=2 then clone 1 load to P_pick2
$ g7 c6 e& w2 j) @4 P" U        else clone 1 load to P_pick3
& i+ E( e6 c7 Y7 i) e9 W& Y, pend) ~6 B  W: b3 b4 F" b& {1 h; R( u

, ^* F9 P  h0 p9 |! D- J" Tbegin P_pick1 arriving1 \* b% J! m" e* @# n
    set A_i to 14 ?  I2 S) ^2 Y, w* g9 y+ p8 q
    move into Q_induct15 c8 j# T7 h2 I3 {5 c
    move into pickaisle.induct1
; g& a" S: W. l' u( O    while A_i<=30 do begin
$ p) M# K( ?7 K7 N  ]5 f; u        travel to pickaisle.con(A_i)
7 N. r  d& i2 e. p, v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 B1 x, X4 z9 D  e
        else wait for 10 sec
6 p) Q" l1 ~. G        if A_i=A_leave then send to die
& V$ n0 E) t% F9 L1 I* z0 ]' n        else inc A_i by 1
  E' ]0 f3 I8 }% e  P7 [7 w7 e    end
& |6 @; `* ~* c5 S' J% ]) pend
8 x! f4 C) B; h! x7 b* S! {5 a9 f6 V5 X/ T% {4 A' v. W) v
begin P_pick2 arriving  Z1 P1 f5 L4 h
    set A_i to 11# Z+ B4 E2 I: z
    move into Q_induct2, [) t5 n8 \  j) q5 ?$ {
    move into pickaisle.induct2
- ]% p* t5 j5 D  O4 A' n/ I    while A_i<=30 do begin
3 G3 x. x+ E) U0 |' i2 q' i        travel to pickaisle.con(A_i)
: I; I/ g* C$ {2 S3 b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, T8 _8 x! }  I  j9 I& g/ e; [/ B
        else wait for 10 sec
& {( g# t: w1 q/ Z: H8 g9 F6 `        if A_i=A_leave then send to die4 G6 ]9 X4 R( K( o8 u$ d. U
        else inc A_i by 18 W. t8 V& h! ]9 L+ R
    end
3 j+ e/ p4 w5 ]0 qend3 A/ S: t- \* d
2 y8 ]0 a. R  r, P( K7 A
begin P_pick3 arriving0 j8 \5 {0 V, R
    set A_i to 21! q; E! A# e# ~+ a1 u9 x+ F+ E
    move into Q_induct3* C% m8 I5 Z: N
    move into pickaisle.induct3
# l2 ?* s! V. O$ j/ Z    while A_i<=30 do begin+ q7 z! Z4 i1 K' k$ o& d: v
        travel to pickaisle.con(A_i)
' z/ q! l: D, ?6 `# ^4 x. ~% e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 w% `: ?8 `; Y5 r/ g4 U' v# J
        else wait for 10 sec
7 |( M0 \9 F' D2 n9 d        if A_i=A_leave then send to die
7 G% u% J% _7 [2 H7 M        else inc A_i by 1# ~, f) H( _/ x" M, M
    end; b1 V( `3 S# R
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是个什么东东?; [" I) ]" v& ]- c) y
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& K% G, }9 G/ w5 t' M+ f2 j

1 ~+ {3 \7 @5 q6 \$ d' iAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。# f$ j4 x- X: U0 `3 t# B
1 ~9 i! {* N2 v7 [$ a
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
6 m5 n2 e8 Y; [: C% U. M- ~+ ~# \# n1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;- T: U% H- D( @
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
2 v, Y2 r2 d$ A3 T3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 o" _- K/ W0 X! j( ]" C* V
begin P_induction arriving
2 O, b% R0 M# W: g/ V    clone 1 load to P_pick(A_induct)
8 o/ g' d! F; ~  z8 x$ nend最大的系: t! k! D4 g- z& m1 k2 m" _6 P

5 v0 ?8 Y; j% ^/ a2 N! `/ P7 xbegin P_pick arriving
1 U) i  A# P% w5 x: d    set A_i to procindex * 10 + 1
( }' [9 e9 e9 z# V, @    move into Q_induct(procindex)- ]; y; |5 X0 m9 i* r5 q, B: e
    move into pickaisle.induct(procindex), N; v) G; H, y% }9 v& i7 s
    /*check the type of pickaisle.induct(i), for your last problem.*/
  b; m% B0 W- m* I  q- s' O' h3 m- [# l# z
    while A_i<=30 do begin
2 _" Q/ \+ M  _2 a) a3 u" g7 }: a        travel to pickaisle.con(A_i)* y' @; `; D( z1 L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 ~- b# g% @5 s, @, I& Z        else wait for 10 sec! r/ f* j1 z0 c% G
        if A_i=A_leave then send to die
% u; e3 D' f8 K5 Z! ]# D        else inc A_i by 1
6 q5 k. \; u  _    end
, Z. N* S/ Z9 u& b: ?# `end2 u8 k4 @! a! A) C8 V8 J" ~" W
( T) H& y  E  h  s
其中的procindex为整形,代表当前process的序号。
) D' E+ R: n4 Z7 Z9 Q7 M  C" Astation和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-9-4 03:36 , Processed in 0.016983 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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