设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11256|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( C  b% ^" @; z5 ]# Y; B
. }8 ~7 U% E( w" T
我的问题是,在每个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中的数值,不知道会不会有什么不妥。( t6 O  A, x- E4 B$ P( R6 Q

0 x% K1 T9 b' S6 ]7 ?  Mbegin P_read arriving0 v' c9 Z2 F3 l) L/ ^6 Q% `# k
    while 1=1 do begin
1 v& e& C/ C$ H1 L- K! O" K        read A_tote from "data.txt" with delimiter "\n"
2 R( @/ H7 _' y- Q+ b1 u2 n/ I        read A_time from "data.txt" with delimiter "\n"0 P" g6 s& k% F) ~& N
        read A_leave from "data.txt" with delimiter "\n"
0 @7 Q' ]5 U/ M5 m2 ~        read A_picks from "data.txt" with delimiter "\n"
1 Z+ W3 f: Q2 _, A8 O; F4 D7 a        set load type to A_tote* g. b9 x7 g4 s( w. t5 t/ D
        if A_tote="tote 1" then set A_induct to 1
0 }1 ~4 F; I, F, b  x- n: |$ n        else if A_tote="tote 2" then set A_induct to 2% u+ ]9 b# l# l# A
            else set A_induct to 3   
. w. m/ K, ?) n3 T3 U+ f        set A_i to 06 K! @8 d( I# Q7 \
        clone 1 load to P_induction
; y: L, z0 m( a* m9 b6 [* |$ y7 H        wait for A_time sec6 E' }" P! Z, c9 ]5 T& r. Y; z
    end
/ X& V2 L% L$ U+ Mend' j4 {1 v* H  b8 F1 H
  r4 ^. [) p5 V" v1 C& `" Y" n& r
begin P_induction arriving0 R" k- Q4 L  \2 L
    if A_induct=1 then clone 1 load to P_pick1
- w) y; d5 ~+ n6 ^4 x7 B    else if A_induct=2 then clone 1 load to P_pick2
7 q* B( N0 {0 s- K        else clone 1 load to P_pick38 Q8 o' {9 [1 Q" J% G7 K, U
end
$ l' y: B0 j* E6 d& w2 |4 N- y- y4 G8 v1 J$ U/ ~2 C; @$ E
begin P_pick1 arriving
0 l4 \# d0 L. _/ n- E/ N' j    set A_i to 16 [+ w" @1 ]- j
    move into Q_induct1
4 ^; S  V/ i! B( a6 x" J& r4 j    move into pickaisle.induct1
3 q9 c/ `5 M6 \  S    while A_i<=30 do begin
& O9 [. }2 s3 B        travel to pickaisle.con(A_i)
: |  h& Y! |  B; D& Y# E/ n! q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, a* |0 ^( q% C) w+ p9 b8 S: f6 U! [
        else wait for 10 sec
* u1 B- V" T* D! \" U3 `( z  k        if A_i=A_leave then send to die
! a7 M- q( x3 M0 P9 `! j( j        else inc A_i by 1
$ `4 P% o) Y2 V+ o- `    end" D% Q& ~' m4 a$ }" a& u# A
end  N" Z( f: p) Q6 c$ |- a/ d; X

! h; l! m9 y: N' b3 o, Bbegin P_pick2 arriving" h5 n  z0 g9 E" p) g4 n
    set A_i to 11
! X" h* C, o- l1 Y' j6 w    move into Q_induct2* B' M2 h0 ~% {, f: T
    move into pickaisle.induct2. [' p. C# P( i
    while A_i<=30 do begin5 \3 o7 Q! H/ t* Q! \; }/ m" b
        travel to pickaisle.con(A_i), T/ K% J9 f% d: Z' b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. p2 s  e: M* |* j9 U( j; [9 Z" W
        else wait for 10 sec
! @" m& D' [( y: E3 A8 m, G1 Q        if A_i=A_leave then send to die
0 A0 d, n5 k3 J" x        else inc A_i by 16 k. K' t  Q7 N) [6 {" v% ^
    end- |6 P2 ^2 h+ J  u3 g
end
4 \* Q0 U( {6 Q5 R7 }5 v5 ~1 t
! A0 S- v7 k3 C) [: V) V$ E# D, cbegin P_pick3 arriving
) @: h5 m/ a" B    set A_i to 21
; C# ^7 E( r6 T6 ]0 f    move into Q_induct3
) w- A+ y7 O# ~( P; T) Z: S    move into pickaisle.induct3
% t0 a# h" Q& j' S, j' N/ @4 u. ~    while A_i<=30 do begin
% b$ n1 _2 y9 o. d5 ~0 q        travel to pickaisle.con(A_i)
. Q3 @( S6 ~+ i8 t" C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ v6 K$ |9 a! F& a1 i6 l        else wait for 10 sec
4 r! q8 a( t' j; _        if A_i=A_leave then send to die
, v3 i' E. k8 R5 d8 o& O# H; q        else inc A_i by 1' h- M0 c/ {! C, n. T) [
    end* p5 S  }4 q! m/ ^
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是个什么东东?" \) x4 L0 l, j. y7 ^$ c, v
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?3 O" Y( j" c5 G; g" Z3 M  N

( p$ @5 Q  ~* \+ M1 T# P* ]AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 p, b  \) z4 H; @1 z4 J) C( @  S
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:3 u: k5 y! l/ w) C) A8 o. z+ w# G
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;( ~% t5 ]+ j2 I
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 h  c5 ^, _8 y
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% }& O9 X) A) m
begin P_induction arriving
( x' h) a# ?- L! }9 @  U0 a% C    clone 1 load to P_pick(A_induct)
0 T. Y- I3 t0 G& Uend最大的系
+ l3 @5 q7 s. u! ~; T
" T% b* P2 b5 D; |begin P_pick arriving
. L/ a2 C; m& d2 _: E4 Q6 w    set A_i to procindex * 10 + 17 Q0 m" C5 t4 }# c" H) x+ u
    move into Q_induct(procindex)& b+ I7 S- r( |1 y
    move into pickaisle.induct(procindex)3 n3 a" ?7 W$ g6 {4 o/ s) }5 m
    /*check the type of pickaisle.induct(i), for your last problem.*/6 x$ e) C! J% b( C0 m: O0 d6 k% ^
5 X6 ^1 o1 ~1 V2 {1 J) U4 F
    while A_i<=30 do begin* b# n+ n5 O- t# U1 F: O
        travel to pickaisle.con(A_i)0 b4 p" |( @4 y0 y3 O. M; a" U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 v! J+ {# E$ ]
        else wait for 10 sec& `; Q7 @& B' ]  q
        if A_i=A_leave then send to die% X* |0 ~1 M% |( `# ]- R5 S
        else inc A_i by 1% f; U0 T$ I" e# A
    end
5 g* q/ c8 B& uend
; v3 O* Q% Q' ^; f
# Z0 u# j3 Z# m7 E其中的procindex为整形,代表当前process的序号。
+ N: z7 Z" k) A- nstation和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, 2025-11-2 23:30 , Processed in 0.019439 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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