设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13833|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# i1 A2 Y: L& v3 C! t* `$ V

+ K7 c+ K2 P  |% w# Z9 Q7 a7 D我的问题是,在每个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中的数值,不知道会不会有什么不妥。) Z! q6 L) e% y( t

/ e1 Y' Y1 J$ X6 ybegin P_read arriving  e# h/ v' v% V
    while 1=1 do begin
: M1 u  ~$ T  A. y, ?        read A_tote from "data.txt" with delimiter "\n"
4 h" \* u0 x4 W' b$ n        read A_time from "data.txt" with delimiter "\n"7 b! H* A3 H9 k6 h0 R
        read A_leave from "data.txt" with delimiter "\n"
5 A$ N' J$ Y  T+ P& B5 m0 A        read A_picks from "data.txt" with delimiter "\n"
0 U: a5 K  i& j# {        set load type to A_tote
- T" I( b# \" m4 T1 d        if A_tote="tote 1" then set A_induct to 1- w5 Q1 @( _$ L
        else if A_tote="tote 2" then set A_induct to 2
# Y5 |* D! k* F1 q: l" t/ `            else set A_induct to 3    4 r2 [$ G5 o& d) L
        set A_i to 0  ]; ?: f  d4 u7 F9 ~0 t4 G
        clone 1 load to P_induction' b/ _0 L/ H: n+ C9 k9 X. P
        wait for A_time sec9 D" [% I) L. [$ I1 t  a
    end6 @! K% r+ `  W9 n9 G: k
end; N/ [/ T' H" ~% u+ @1 Z4 R: D
$ d0 }6 B/ ]  H, l) O
begin P_induction arriving% F3 V& }$ ~( s) s  ^, F2 P
    if A_induct=1 then clone 1 load to P_pick1( [+ E% }3 g- E, r; \
    else if A_induct=2 then clone 1 load to P_pick2
7 C( k6 w! x( |) D. ]: A( \        else clone 1 load to P_pick34 e4 ?+ u+ Z) ?, n  _
end) K, M5 |* q& ]: m0 V
1 w& p' V& K  ?, c  M/ l) g
begin P_pick1 arriving
) e5 ?0 I8 F0 b  y    set A_i to 1
1 m" m# o1 R) z' `3 }    move into Q_induct11 b% U$ R/ N2 Z$ W; {) z5 v
    move into pickaisle.induct1! x8 F" N0 O0 O1 |9 w9 T% G+ L
    while A_i<=30 do begin
% N+ \9 F7 Q0 i% n7 X# n$ I        travel to pickaisle.con(A_i)
# d* V! L* G, G" ]3 Y4 \+ O% V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% r& f* ?9 I, R# f; W$ S& n
        else wait for 10 sec
/ L( t& i& B) W4 s6 Y        if A_i=A_leave then send to die
5 C4 f+ I2 w* p0 B8 `% _( }        else inc A_i by 1+ t5 O/ n/ k! }
    end% G" W; Z. z! D3 ~' X0 Y' \* \- z
end
0 w( o9 }7 M& W5 E$ `7 T
1 g6 q- }, {4 I* Ebegin P_pick2 arriving8 O/ ~0 _" O" O: Z% z
    set A_i to 11
, L; {1 ^3 L& |9 S  T    move into Q_induct2; x8 B, F; P! T- d
    move into pickaisle.induct24 q4 q" F  }% }) R6 a! Z  f
    while A_i<=30 do begin
) M/ w" k+ ?/ M7 X) n  j$ @        travel to pickaisle.con(A_i)( L+ w) V! I2 L, F$ v* `! `" @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ e) Y1 e! `+ }* p/ r
        else wait for 10 sec5 c. U" B5 u% p7 L8 y" m% i8 [0 T
        if A_i=A_leave then send to die$ n# W# X' x# u4 B7 B( y9 f$ R
        else inc A_i by 1
  H: N* d! ^/ r; D    end
% M9 ?5 ^# j; Cend4 g9 k- t. u5 G) F. y# V

) ^9 b9 t+ z$ f1 Y- F0 i$ `2 Sbegin P_pick3 arriving
) x# I: _9 ^" U* T& V8 W    set A_i to 217 a/ ~+ ?& v" v5 A2 e
    move into Q_induct3
" ?5 _( K7 d+ B    move into pickaisle.induct3
# |: W2 Z/ R5 d. T2 q* @6 ?. m    while A_i<=30 do begin$ f2 d8 G; y- _% s, ]' k
        travel to pickaisle.con(A_i)
# Z' A  V. s5 K* G2 d( W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 ^% d$ @- O$ Z( L
        else wait for 10 sec( o/ q2 p( k  E* h
        if A_i=A_leave then send to die, a# ]  d4 G0 V' v: b" C* E
        else inc A_i by 1
. m6 w1 I8 b5 `: g* r) z7 s# U    end
+ l- `# B( d1 P# u/ X7 V( u% j4 s" zend

最佳答案

查看完整内容

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是个什么东东?0 A' E9 W# o% a& Q+ O3 C
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. i. U5 I/ s5 A$ H2 E
0 d  y7 J0 w) }AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 j, H* N( P% \) [0 @/ {* c) ?

6 }8 x$ u9 U5 A; N+ i另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, T- _0 B  U" f% o% D2 `* X* L
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% }0 d' t: R( [5 w2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
1 g  h- Z" G  w2 f. Q  K8 Q3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
* n1 s& U! }; X6 |* m5 W" [  j& Bbegin P_induction arriving
4 l" Z( x! Z0 `( x. i6 W    clone 1 load to P_pick(A_induct)
0 }) x  G5 z4 }5 I4 Tend最大的系
8 s! A- `# C, Y( V
; i& F7 I  z% |7 X7 b: F5 w1 @: Fbegin P_pick arriving
7 s9 d- ~% o4 j8 ?6 c5 p    set A_i to procindex * 10 + 1
) A3 {' c# C  K% k( w" L    move into Q_induct(procindex)2 ^8 A; o# g+ p( Z* j) v
    move into pickaisle.induct(procindex)
2 o+ ]9 k; X3 ?7 f$ f* \5 A    /*check the type of pickaisle.induct(i), for your last problem.*/
  S: S+ |# g% n9 n6 ~: `
' d+ i4 [- J6 e( m, t4 n    while A_i<=30 do begin8 P6 ?  w$ A7 t5 \" I1 N& Z' m6 |
        travel to pickaisle.con(A_i)
0 n  w4 s* V( M/ R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% r; ~$ O& G7 \3 Y. ?        else wait for 10 sec& R5 Y: L3 n; I) b
        if A_i=A_leave then send to die  t1 y& \( T# f; e
        else inc A_i by 18 D# x1 s5 v8 S2 N9 m
    end
' W/ J  w3 _- T) R9 t3 ?end
# l6 E. i& ~. o5 ?! @9 L7 T5 N' c) t9 J) ]
其中的procindex为整形,代表当前process的序号。
- I/ C3 g0 {4 E# q' Q) qstation和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-5-10 10:50 , Processed in 0.026055 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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