设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13687|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' I7 q7 X# \/ v/ U; \' m+ A0 n- |$ e4 E# e) M
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" s' f: U& h- h+ G+ i7 a; J# ^% s( b- c( f. m
begin P_read arriving
. S1 F, L. w& R    while 1=1 do begin# o$ v9 a. k- u+ U7 b* J% c
        read A_tote from "data.txt" with delimiter "\n"/ D8 D% Y6 i9 |1 Z
        read A_time from "data.txt" with delimiter "\n"# F# P/ }. y+ Y4 U! s; U$ s4 \5 }
        read A_leave from "data.txt" with delimiter "\n"* P7 a$ Z) }" K( R+ ]2 y
        read A_picks from "data.txt" with delimiter "\n"
1 n5 \* `) |2 i/ F        set load type to A_tote
+ h0 a1 C0 E% z' v        if A_tote="tote 1" then set A_induct to 1+ c" G( I4 O1 s: |4 J
        else if A_tote="tote 2" then set A_induct to 2
3 L* R7 W) I/ ]" t8 F$ e$ U& W7 X. F8 s            else set A_induct to 3   
* L2 \" _- i. t& X1 R* X        set A_i to 0* D* h5 V! [+ R" `* I
        clone 1 load to P_induction6 o; N5 Y$ \0 J4 v/ d2 M4 Q
        wait for A_time sec
" Y9 Q; a9 s, E# Z  B  {    end
' D/ J1 X3 |6 ]end
9 V. D7 g2 K  V5 X# s  H4 _* Z% X$ [- ~9 u+ G
begin P_induction arriving
9 X( W; ^# q. |9 d  X$ {- U    if A_induct=1 then clone 1 load to P_pick1! Z: T7 l7 O2 z, ?
    else if A_induct=2 then clone 1 load to P_pick2' d+ r7 H+ f/ z( k5 v
        else clone 1 load to P_pick3
) K5 z3 B. O5 s- F( w$ e% ?end
; q! ^# z7 m- a. V1 h% g+ l* S, J0 q$ h: k! e0 p
begin P_pick1 arriving
" H6 ~0 g; [/ c1 i4 {    set A_i to 12 E3 i7 @, M  P6 v: \
    move into Q_induct1
0 s3 k5 W# P1 F# l0 ^& }5 X& F3 P- _    move into pickaisle.induct1
) {% r) V9 L6 U5 Z- n8 z- ?0 h% f# Y4 k    while A_i<=30 do begin
6 x& ~. z- h' P! `! {/ r( r        travel to pickaisle.con(A_i)
' h; w! G1 o* O( j9 \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! r( k% x5 E% i5 Z" I: q
        else wait for 10 sec
- x9 J- s, \0 @4 P) X4 ]' N        if A_i=A_leave then send to die
: l/ G3 ^7 a! X9 R; ^5 X        else inc A_i by 1
& x5 K3 C" _3 r4 z# e- `7 o    end9 ]8 S3 N( d( U; ^+ _2 _3 {
end
! i1 h4 L% s' @3 `. |7 W# o4 X. L9 h! I5 h/ J: d1 _: z6 f( p" E
begin P_pick2 arriving9 H7 A" G5 S$ H( Y3 K/ m  r" {4 ^
    set A_i to 11: x. b5 P% L3 `6 o( d% ~. Y% }# ~
    move into Q_induct20 n" B6 v* C8 x
    move into pickaisle.induct2
5 |) S8 k+ e8 B: H- a    while A_i<=30 do begin
; }4 }2 ^2 k+ d  N7 R/ o        travel to pickaisle.con(A_i)
6 H0 I+ C, w; X8 }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; H6 A# W! g- J! g  k+ }
        else wait for 10 sec- }8 M; b' N+ p: W
        if A_i=A_leave then send to die2 |1 _- p7 S9 Z' B/ j
        else inc A_i by 19 L+ g5 q% y6 C- s  ]* I- Y
    end
$ v' {% x5 b" @  Y  G# {+ _( w: Vend
* d, l, M# w6 [8 e3 J8 V7 t+ Q
4 A" _, [% A. k  obegin P_pick3 arriving; b  |6 A" M* q7 M
    set A_i to 214 Y2 k: D, O1 x' b5 G. p
    move into Q_induct3
- o( N: @  c8 U! m9 L% \    move into pickaisle.induct37 U+ ?1 _9 G1 ^( u- ]: k
    while A_i<=30 do begin
: |0 f. \( I# T. ]6 u0 W        travel to pickaisle.con(A_i)
( ?* T# R+ k% A6 W6 j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" h) [! d: V$ J" n% g        else wait for 10 sec# A5 `# j* X! I. \) G5 N
        if A_i=A_leave then send to die3 D2 c# A" \+ Z) ~& ^
        else inc A_i by 1
) r. \& _- X( ^0 ]7 l! x; f2 m    end# g3 x9 @9 W6 F1 P% a9 @* s
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是个什么东东?
4 Y: Q7 p, ~  z4 a* V$ D2 ymove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
# g8 D1 m" d2 d9 G2 H; }7 c! m' e
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 D- e" j0 \- u8 K2 e/ {5 p' K& `& a8 L

7 O1 ~8 p* @6 S' w0 ?# A  j另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:" Y6 Z) E  `9 U: F/ \2 `
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ n: c9 X- D* Y( i- w" A( k
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 t) z7 s7 {! S, f  x; ^( [7 W3 k4 E
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 R' a8 B1 P; v
begin P_induction arriving
) j4 t0 i* O9 m: i( U1 ?    clone 1 load to P_pick(A_induct)9 J+ X" z+ H1 w1 Q! x( [
end最大的系
( p+ |+ H( s* U) s9 i- U. d1 q6 b/ {/ ~) `
begin P_pick arriving. U  V4 @( U) c8 f6 A  ~
    set A_i to procindex * 10 + 18 i/ A" M) L1 a) E" H2 n
    move into Q_induct(procindex)
' {2 J- {: P6 ?( ~1 f! [    move into pickaisle.induct(procindex)
, @; R- z0 U. N    /*check the type of pickaisle.induct(i), for your last problem.*/
) B# V. q6 ^: ?8 {, g  T% z& b" R  q! [- G5 `* D0 W/ q+ ]1 {3 }8 e
    while A_i<=30 do begin
) G2 @$ o. x5 E9 _2 N' T' Z        travel to pickaisle.con(A_i)
2 S9 b# |2 c& Q+ [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 P* W3 g! E- m2 F
        else wait for 10 sec. D4 c. K1 ~- \1 Q
        if A_i=A_leave then send to die+ U' s* u9 }* A6 O$ [$ b1 I
        else inc A_i by 1
6 f: r8 z! }( K& u8 O3 H, ?- Q    end
! G: t' q  n6 W3 N1 z4 b! _+ \end7 v* h5 e2 F* X3 {3 W7 `% r% |
, |6 N8 {( o$ N( M
其中的procindex为整形,代表当前process的序号。7 G( w: ^5 Z" L: I( P  u
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-28 20:33 , Processed in 0.013757 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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