设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14733|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ W1 x$ U& `. @/ F3 E& h" e* n
. e  U1 [: g/ }
我的问题是,在每个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中的数值,不知道会不会有什么不妥。: R  X3 E: B4 n1 `, t! j

' z5 M5 w$ ]* u. B- jbegin P_read arriving1 {  N/ ?" o+ o3 @+ F- b
    while 1=1 do begin
/ a+ Q6 X2 u5 d/ S$ Z6 U        read A_tote from "data.txt" with delimiter "\n"( p7 P! N+ V2 [5 k4 k- u
        read A_time from "data.txt" with delimiter "\n"
7 N) N( Y. f! Y& s7 s* Y& ]        read A_leave from "data.txt" with delimiter "\n"
# X9 h) W& C7 F* E  |$ H        read A_picks from "data.txt" with delimiter "\n"
& _2 U) {+ P. R, n- o        set load type to A_tote+ q7 R+ v# R. c4 V4 }8 Z
        if A_tote="tote 1" then set A_induct to 1
- B. R* `0 K6 X        else if A_tote="tote 2" then set A_induct to 2
5 U# h0 n% }5 y3 L+ E            else set A_induct to 3    6 h8 h3 @; b0 k! K% ^- z. y3 A
        set A_i to 0
* X8 \  ^5 C  Q% F0 c        clone 1 load to P_induction/ w. v: U  l, C. a3 S* e+ u
        wait for A_time sec( ?4 S/ y2 e; w1 ]1 n: L. I6 _7 a
    end; V3 P+ G, f8 n$ L! c
end$ G' O% J9 F# w+ A8 V( p

! I* u" X+ Z3 z* vbegin P_induction arriving, |1 [7 m4 d( c, M& c! h' u3 q  }
    if A_induct=1 then clone 1 load to P_pick1
" b. v( O8 Y8 B: J4 h3 T    else if A_induct=2 then clone 1 load to P_pick2
. S1 z* Q  Q5 p$ H& c        else clone 1 load to P_pick3) g6 s, L( t& ^  u/ X% w$ ]  [
end
8 ^1 j; o! r+ G9 O4 [! I+ |0 y7 Y% ~. P, G# z3 W) r
begin P_pick1 arriving
+ J( X" d+ T7 r7 w7 L$ U    set A_i to 1% L  }) W% O2 \! K: t/ x
    move into Q_induct1
- F* t  r! k, t4 f7 K5 }    move into pickaisle.induct1, y! `. t' g, {8 U) n' Y  [9 B
    while A_i<=30 do begin
) T2 l& F7 ^* y2 [( c9 D        travel to pickaisle.con(A_i)2 U  x: Z+ J( N+ w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( n3 k. T7 C7 c$ m5 I; W/ {
        else wait for 10 sec
2 W3 M+ V3 G. A* z, A4 k        if A_i=A_leave then send to die
9 E' F$ d3 D2 _# D% C1 L        else inc A_i by 1
7 X4 J9 Z; ?: C# z    end
% z2 V* X5 Y' {; Yend
/ c/ X4 i% _. Y  `
- H/ K$ b: k8 \0 ibegin P_pick2 arriving8 [: y0 ]: p0 f! J
    set A_i to 11
6 e' ^3 V9 i/ z) s5 j) L    move into Q_induct27 I9 u6 @0 R1 x% _0 G
    move into pickaisle.induct2
& a1 ]% u2 g( q9 D: N6 E  B    while A_i<=30 do begin0 r* k$ F# n; l9 f9 J2 s
        travel to pickaisle.con(A_i)
$ r) C  T( S0 v$ N3 R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' e% T, {) j# K1 |& P
        else wait for 10 sec  {4 f( G" J5 Q6 v9 c3 i
        if A_i=A_leave then send to die3 o" z- y- y! g4 R. R9 F1 [" U
        else inc A_i by 1' Z5 r5 J* w" h! l) `; q
    end* g: F3 b1 Q, x; T0 p9 D
end6 V. c/ n- T1 a. h/ o- v  n+ M

3 I$ L; q0 {: I+ _4 T# }begin P_pick3 arriving
" ^: X: m& {0 d- k2 o. _; C, ~    set A_i to 21) |2 K7 ~) s) Q
    move into Q_induct3
5 Y) F! x8 B  w8 x# o; x    move into pickaisle.induct3
6 B1 d) F$ k1 g# o1 j" H6 }    while A_i<=30 do begin
( Z7 o4 q% P4 R$ n! n; C        travel to pickaisle.con(A_i)0 m5 v8 {* H" \# a9 f+ Z3 |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: [0 q+ y* j; E9 D. s! z) k+ v        else wait for 10 sec# C+ y' M* N& M# r4 Y
        if A_i=A_leave then send to die
* d/ d+ M* g) ^* b( O, Y2 a        else inc A_i by 1) A9 X! z) z, z$ _0 T# n
    end  B: M2 x1 J& b) R; O% L
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是个什么东东?& K3 U1 A6 M, d. a2 |6 ]6 O: j
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ g- u- _9 D: t3 o! E; L! v
0 H0 W( e2 B& _6 `0 S- I5 i0 mAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ m# t' Q6 ]" b( w0 Q% ^. }# Q! B

* n/ {: A1 x; Y/ r; K另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( H8 t  T2 J+ q- a$ J$ x! C$ h1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 P- d, Y! y0 `3 X5 r8 {
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;% E3 g' U8 o+ f1 g2 o
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 k. g, L  U+ n( N* U( W& F2 u$ n
begin P_induction arriving
% p/ g0 j  W  D    clone 1 load to P_pick(A_induct)
$ F" M3 B8 o; ~, w. F9 [end最大的系
5 k# [. A$ z( n: c7 b3 _7 a: H3 ~6 b! f1 N1 w  E
begin P_pick arriving
/ N$ k! T/ z3 x/ A5 l4 V/ J' Z    set A_i to procindex * 10 + 1; `0 i# k5 @3 p) A6 K' Q
    move into Q_induct(procindex)
" o0 L, |1 j: O7 X5 Y0 Y) {    move into pickaisle.induct(procindex), j4 ~% I) e. _! S
    /*check the type of pickaisle.induct(i), for your last problem.*/; h, n/ g  ]$ ^! U+ I0 `/ E3 o
. O: t3 h( |. W
    while A_i<=30 do begin
1 Z& W/ W: M: @: [        travel to pickaisle.con(A_i)
* I* e& V1 X: J# F' p1 d/ u" g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. a, r8 N7 ^$ A/ W# \& }
        else wait for 10 sec9 Y' s: _6 }, x# ~- N" V1 n
        if A_i=A_leave then send to die
; j/ F7 b  y" i, L) v- U0 [        else inc A_i by 1& t' s- g; q/ K) H7 y
    end- x" C- k  d% |& Q$ k
end1 Q; R% Y' z5 d  P! w& y' d6 F9 ?
9 w2 M! Q1 I' m) j" w; c7 q0 L
其中的procindex为整形,代表当前process的序号。: u6 e0 }7 D) X7 i/ x% t  U' l! J, |
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-7-24 07:08 , Processed in 0.015632 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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