设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13654|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. w' h, O# A0 i8 U% p
$ k" C% Y& r9 Q- Q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ B  e2 u. c/ G" V( d5 r6 ?
% ^  a# T2 I# t5 j( C1 C  ^
begin P_read arriving) O) i) b2 |6 M
    while 1=1 do begin# i& z& z7 ?! B4 p6 k, G
        read A_tote from "data.txt" with delimiter "\n"
! G$ }6 |7 L; c% ^1 C; L        read A_time from "data.txt" with delimiter "\n"+ s8 c/ M$ T) K$ a6 C( I: p
        read A_leave from "data.txt" with delimiter "\n"# T% y. T$ B! r7 k2 H" N, c
        read A_picks from "data.txt" with delimiter "\n"
* E$ S( H$ @6 J; b0 _: }        set load type to A_tote
6 K4 Y5 P9 y. M1 r3 A' k( U        if A_tote="tote 1" then set A_induct to 19 l1 s+ n( j/ m
        else if A_tote="tote 2" then set A_induct to 2! d3 X, x1 q4 r6 Z1 `: }2 d, I+ l
            else set A_induct to 3   
8 S, s( H2 }6 d1 I/ P. J        set A_i to 0
6 D* q2 S6 ~, H. y/ S        clone 1 load to P_induction5 ~" W2 ]2 x' g7 s6 R1 \
        wait for A_time sec
: e2 P% Y1 t- W5 ]" C" V! l9 c    end
/ }) Q) J6 }0 F4 a& d. dend& K0 B; c8 d$ ?6 z6 o( o& D$ ^

! H8 o# h$ p$ m# J4 c; s. K' Hbegin P_induction arriving2 P( L" p! B! u
    if A_induct=1 then clone 1 load to P_pick16 \+ L& K$ T! ?: W3 Z' H1 }  L0 C
    else if A_induct=2 then clone 1 load to P_pick2
) A3 g& l: l6 J4 i7 |  @+ _6 N; ~        else clone 1 load to P_pick3
/ u- ?3 E9 Z) D! I# x, a( F. ^end
0 o& U4 v( k4 Y8 H
4 J& ]- @) A! t& Q. J2 U: Zbegin P_pick1 arriving2 U$ Y% o  n0 ~# u8 n9 e
    set A_i to 16 z3 t/ Y, i$ O4 K$ v. C
    move into Q_induct1
: M$ ~1 k. s5 w2 d+ U+ O    move into pickaisle.induct1
1 Q& V% ^" N7 l6 U% ?- N" b# v    while A_i<=30 do begin
( Z- S( f* h( L1 C2 G        travel to pickaisle.con(A_i)+ c* m. Y/ S" ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- r" D5 l& e: z: t' E7 b7 s: E) H        else wait for 10 sec* V$ C' f8 q3 y8 Z8 n! `
        if A_i=A_leave then send to die5 K3 `. `8 o9 C4 V" ~
        else inc A_i by 10 S1 j1 f9 Y; y) v+ S) X# a
    end' R0 q- [$ V! U0 b
end* N; S  d, N' U8 G# ^
& N2 {' ~% v4 S! l  s2 I9 a& b6 M4 k
begin P_pick2 arriving  W0 I6 q* c, f4 J; L' I( E; [
    set A_i to 11
, p" }" F9 G, ^1 g  [1 F. @    move into Q_induct2
1 q2 U8 W0 r5 Z: Q& y    move into pickaisle.induct2
* W1 U9 ]/ q4 w. B1 `) C5 W    while A_i<=30 do begin6 @: X9 F5 o. k  N1 [  Q
        travel to pickaisle.con(A_i)! j3 E* e$ [' o  e3 H$ D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; L- c& |+ E( s8 {* d4 L( g9 w0 A
        else wait for 10 sec
7 v- @# E2 [& D, Y        if A_i=A_leave then send to die
# k! o  Z) L" h        else inc A_i by 1
$ A$ E) e- B4 ~2 Z" a    end
0 b+ X, p" Z; G5 G0 J& O6 Uend' n; B3 R1 q0 M

" f' h' m3 b( l6 r3 R% T$ T* ?/ H; bbegin P_pick3 arriving1 A/ u" A8 P6 t! F7 f8 b& u) k
    set A_i to 21
, I  ~' K4 X2 ^    move into Q_induct39 K. x. D# T) \* |2 w
    move into pickaisle.induct3, v$ U5 b/ M& \
    while A_i<=30 do begin
: \' Y' }. }6 L( w0 b5 T        travel to pickaisle.con(A_i)0 p: \) B1 k* c7 p+ ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 @0 m7 ]4 [. o# V7 e2 @
        else wait for 10 sec
) g0 \" u+ D; ^. I, G- U        if A_i=A_leave then send to die
6 B8 ^7 L: K" z% C' z8 O1 z        else inc A_i by 1
+ d! d3 J% u( M8 o  r    end
; Z% p, r' D7 I6 _6 b7 Nend

最佳答案

查看完整内容

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是个什么东东?
3 p4 T) E+ }% Z( qmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, ^3 l" p  _" `7 J% |, C9 N6 p
- U4 k2 Q( C9 K8 m* \* dAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 T) ]9 \; h4 f) |: o

+ l% d# Y$ I7 }8 A  O9 A  W$ l' b另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ m1 X2 d' r# d; Q$ u% t  o1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;4 K. W, E' E9 [! l: _2 u+ B0 f
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ S. F  t5 N2 I& [; }
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
$ F( w( G2 o8 w9 W5 }) _' H  ]9 ^begin P_induction arriving+ e7 Q: ]: w5 L1 @/ Y
    clone 1 load to P_pick(A_induct)
' \+ Y/ n7 x  e6 G3 A9 }% yend最大的系
. ^" e# B  t# {6 J! {0 \
: f2 d9 E! P7 V( _+ R& s' N! zbegin P_pick arriving+ j8 Z2 v3 {0 M) i* F* ~
    set A_i to procindex * 10 + 1
# f2 D2 V* m' M2 j: n    move into Q_induct(procindex)4 }7 a- x. s3 q! \& q" k; v
    move into pickaisle.induct(procindex)& q- j% v/ V! [' v
    /*check the type of pickaisle.induct(i), for your last problem.*/
9 q2 F7 B( }+ a& E! Y
& _  b6 h% A; h    while A_i<=30 do begin
2 {3 G, h. x& u4 u9 R        travel to pickaisle.con(A_i)! V& }1 `# i" x4 N/ |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 Z+ |7 N) E" F/ M& ~        else wait for 10 sec
& Y% i% f2 @% Z! T        if A_i=A_leave then send to die
+ j( o: V, A& I% |/ k        else inc A_i by 1
: j: E; e+ v- L. r1 P8 ~# ?# t& e    end
0 X1 @! l. C% E9 N. Y  Cend
! X, l: _# s5 k. U5 G" t( s1 K
" j: r2 E- A# q' k& L' Q其中的procindex为整形,代表当前process的序号。3 }+ q" D& U* v' A+ P8 Y
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-4-26 15:50 , Processed in 0.016906 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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