设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13095|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ G! h6 X) u5 d+ L) c5 S3 e" L+ `& |
6 e- k7 p1 Q8 I+ z# J& e, f我的问题是,在每个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 |/ [* f- y$ l2 U) K6 `

) l1 n" Y9 s! u4 w# B" ^begin P_read arriving
. c7 j5 G; h$ M1 z+ [! B0 g( A3 V    while 1=1 do begin
% A# I  W4 U4 V$ C. \5 F4 e* M( }        read A_tote from "data.txt" with delimiter "\n") E4 n& e, J, F# J9 r
        read A_time from "data.txt" with delimiter "\n"
# X3 e' Z& v7 k, S% q  I        read A_leave from "data.txt" with delimiter "\n"% ]: T( P1 A; q' t- G
        read A_picks from "data.txt" with delimiter "\n"! h! J* i& F- F8 J
        set load type to A_tote
% ]" L0 z) d8 B) _        if A_tote="tote 1" then set A_induct to 1, u; u. e! ?% ?
        else if A_tote="tote 2" then set A_induct to 2" B$ K; p4 y. }1 u8 ^
            else set A_induct to 3    ! M2 S' d5 t5 _) J3 z
        set A_i to 0
8 w8 Y5 e; R5 c1 D; ^7 c. I        clone 1 load to P_induction3 y0 ^! y" q# ]$ l9 Y: j3 I
        wait for A_time sec, m# o/ s$ b, L; s) D3 Q! D% i# o
    end3 I7 K% k( x* d0 H1 g  K
end8 T, ]8 l6 D+ W6 c7 F" c1 {$ O, A

) U" k0 n" H- w: `: I: U4 |begin P_induction arriving; _3 M; `. H. \" k: e* L! y" _
    if A_induct=1 then clone 1 load to P_pick1- d5 k; t4 I8 M6 }* }3 K
    else if A_induct=2 then clone 1 load to P_pick2
! ?" H/ y( _% s) ]        else clone 1 load to P_pick3  D) D( h& \  e5 e; o* @0 {7 r
end5 ?# t! B- J& m' t3 q. t
7 V0 A9 o) i. b2 ~1 p  H
begin P_pick1 arriving
1 n4 L$ a1 K$ z, g/ c1 p    set A_i to 1+ H( k" x4 m$ _, P1 D. a
    move into Q_induct10 a) `# \; r% \0 s0 X/ S" Q
    move into pickaisle.induct1
3 I# s- P) ~; V    while A_i<=30 do begin
/ W3 `! P2 t% A& P" [" t6 `; w4 a        travel to pickaisle.con(A_i)" [; j/ n% g' }! U' ^  E, x2 {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( N7 x6 j, \8 _        else wait for 10 sec
+ S  C& L1 y- c' F% x        if A_i=A_leave then send to die
7 t6 y) c8 m) `4 \        else inc A_i by 1
( G6 b0 a! r1 i2 ^    end# ?4 P0 Z" c; _
end
$ N5 e+ |# ?5 ]. ?. K
7 U+ x6 z& Y7 L6 `: xbegin P_pick2 arriving
2 n7 z5 @, g2 V) d6 \& }- Z    set A_i to 11, S/ _8 m% V* I, K( }% C' O$ m! W
    move into Q_induct2
8 h6 k/ x/ f0 l    move into pickaisle.induct2
# P+ B5 g# k8 v( |3 r+ k) `+ t7 H    while A_i<=30 do begin
1 I& l$ v% T  r6 z( U, T        travel to pickaisle.con(A_i)
" A$ l1 a$ w& Y7 F4 e: k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# Y. V" z2 T" n: y' k' [
        else wait for 10 sec- e7 X3 t* B9 I
        if A_i=A_leave then send to die
' c1 O& G3 R( C/ [, [% I        else inc A_i by 1/ i; l4 B; y3 Q
    end  m; y* F  b, d5 o+ ?. j
end
/ I- F' r, c4 Y. R) S
$ ^! F5 p8 C7 v  t5 K/ W- `7 Ibegin P_pick3 arriving
: n, ^4 e1 U7 O, W$ R8 L    set A_i to 21
) V: p: G% s4 S) k' K& ~( |% s    move into Q_induct3
3 U; N5 B2 ?( s' w2 ~    move into pickaisle.induct3* `3 }4 i' `  N7 a
    while A_i<=30 do begin
6 S0 u; Z, q6 q, ]        travel to pickaisle.con(A_i)7 |. b& j3 s( X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( P% t; {1 `4 U: W- l        else wait for 10 sec% C4 N! y9 M3 {2 U; A
        if A_i=A_leave then send to die
  |: l4 b* {& z# t% l( H0 F        else inc A_i by 19 q$ i9 I# F/ R! g
    end
+ b7 O/ O1 p- \! D+ Q- |9 Rend

最佳答案

查看完整内容

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是个什么东东?2 ?9 q6 \: w! O) J' t9 ~
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?+ [3 H4 X' m. E% F! b
+ Y* n- A9 g9 H8 ^
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
8 ~7 J$ a4 b9 i0 Q
) o7 @2 n4 M6 s0 G& J另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
. ]! \) J  @3 Y, g' u1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
! n  C- @, Z: e0 J! x' E2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 ]) `; P. F0 b) A6 l; p3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
* O# }# O2 A2 L2 kbegin P_induction arriving0 {; \& G( A3 ?8 C
    clone 1 load to P_pick(A_induct)
& B5 R8 i/ P" r3 c! P9 ^end最大的系' w1 M# ^7 Z. T( U0 ]
( n; \8 n) `/ x6 U- F9 h
begin P_pick arriving
* g% y: `6 C) \4 J! z' c    set A_i to procindex * 10 + 1
9 I: o" d4 `6 h. m, H    move into Q_induct(procindex)
# W( r* q2 B3 i+ @    move into pickaisle.induct(procindex)
9 P. p* S3 O3 Q) S( L3 `/ j    /*check the type of pickaisle.induct(i), for your last problem.*/2 Q1 e/ ?# U' ?  A0 I# C
  X$ }) E( V  [& U" a0 a: I7 |
    while A_i<=30 do begin! L. O) ~4 Z1 ~# b
        travel to pickaisle.con(A_i). W. T" _2 n6 Q0 f2 d5 |2 Z% C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 Z* S% F' B8 V$ a$ V0 F: S        else wait for 10 sec
! }, [' ~: X! A2 X1 {        if A_i=A_leave then send to die
5 A* h, A: Q1 F( s- o5 [        else inc A_i by 1
" b2 {" {" X. @9 Z    end
* ?' f  \; l9 v% V% {  ~% ?end
& _) f6 b" F( E7 ?3 {1 h
/ ~: t9 m! t" B! L: S: {+ l0 }其中的procindex为整形,代表当前process的序号。
8 Y3 h/ l, P) _! e* Q- L% fstation和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-18 02:11 , Processed in 0.016345 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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