设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14683|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) j8 D1 e$ A9 Y1 H! x
) [+ p+ s2 S: b' m% `6 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中的数值,不知道会不会有什么不妥。% _( U; s9 t5 D- v, n$ }) l

$ l3 h- a/ ^5 J' L: h4 H1 \begin P_read arriving
2 i9 g& ^2 B; d1 L3 Q9 _# p    while 1=1 do begin7 i9 g- h" g2 A) ?  Z, O9 v
        read A_tote from "data.txt" with delimiter "\n"
( O. ?8 {; a+ ^7 X$ ~& C  [2 V9 L% i" t        read A_time from "data.txt" with delimiter "\n"
' h9 _/ G0 V7 T$ w        read A_leave from "data.txt" with delimiter "\n"( S: @7 v# E* P
        read A_picks from "data.txt" with delimiter "\n"
. s$ M, \3 @( ]9 n6 Y3 r& t+ r6 n  [        set load type to A_tote" ~+ O8 X% D+ r5 }* r. e# O8 L
        if A_tote="tote 1" then set A_induct to 1$ M0 Q7 P* f/ m0 p, F
        else if A_tote="tote 2" then set A_induct to 2
% c6 F6 {9 d" E  d% X0 q) Y            else set A_induct to 3    ; W  L4 R- A5 F( E" G1 y3 K
        set A_i to 0, k! x0 d  x- N* g9 y) }9 l
        clone 1 load to P_induction- u& Z4 I- w1 X, Q6 [+ E: u: m' _7 B
        wait for A_time sec8 _" K' d, m, R3 K2 q2 s2 D* u3 W7 ]
    end; b) ?: Z6 ^* V( U3 A+ h
end
5 f2 b+ m$ s+ G& }: `5 f/ W
' P: l6 `+ e0 Y  L$ Vbegin P_induction arriving
) {& Z! z, d' p5 Z    if A_induct=1 then clone 1 load to P_pick1
3 a+ Y# s/ }) w) G) `) p. x: n    else if A_induct=2 then clone 1 load to P_pick28 m( X  x5 ]/ |
        else clone 1 load to P_pick30 k; s3 ^: v1 d0 u" F* q
end/ P( g2 `1 Q5 N1 y% x* }4 i

5 V! O1 L% V0 r. O8 a6 P5 H2 bbegin P_pick1 arriving; t$ Z& Y; Z3 ^/ Z/ m% n
    set A_i to 1
: T+ N7 {8 g& g' [    move into Q_induct1
: w$ N) u0 Z" R! M: ?$ g    move into pickaisle.induct1
$ i" F- E% n# L  p& W# Z    while A_i<=30 do begin$ X6 G4 n6 K  ]5 e  P: C
        travel to pickaisle.con(A_i)& V; T$ D9 u2 `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, q2 s; ^. q; M% c8 |        else wait for 10 sec
4 I' X. }7 D. u( U7 y  c        if A_i=A_leave then send to die
0 S+ V5 \7 n2 k( w1 B4 A: |        else inc A_i by 15 {' \1 F( n! A' L9 r: v! j- ?
    end
+ |$ G' s$ y1 rend
0 K4 m; X' |5 w  e6 D
5 o, T; E3 \- v" q6 ^begin P_pick2 arriving, \# q- B8 ]) q7 H9 g+ l
    set A_i to 11
0 n1 C$ i9 {/ @    move into Q_induct29 e; Y7 u7 t# e' ^4 f6 }& \
    move into pickaisle.induct2
0 Y; D% h7 `% V, k# C( K7 c5 ?. a    while A_i<=30 do begin5 N1 a* x0 @+ j, `$ ~3 P8 }
        travel to pickaisle.con(A_i)
1 D4 v) a; [& N* m+ z& V8 ~4 t; L$ |8 f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 i. q- @1 u* x* w, o  I        else wait for 10 sec' I! ~8 s" _% q, p* [5 D
        if A_i=A_leave then send to die5 U3 @6 `2 [0 b/ _: F
        else inc A_i by 1
) H6 f5 l  a1 |/ A    end
: C' a3 ]) y7 A5 {. \2 N7 dend* A7 D7 d% g9 _1 p
4 j* B! [  \- Z5 @
begin P_pick3 arriving
' i+ v8 _. e% S) m+ g" B    set A_i to 21
% G3 P; u0 T4 ~$ [    move into Q_induct3
9 H2 w5 a8 ?8 }* `7 A    move into pickaisle.induct3. v9 G+ N* X$ Y3 N
    while A_i<=30 do begin
! y/ d* P5 E, a% P4 `  s# z        travel to pickaisle.con(A_i)! }/ ~9 W: U' L8 q. `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. k& }/ B; W5 W0 R% a4 N$ T
        else wait for 10 sec
  H( Y2 ]  L8 S  f        if A_i=A_leave then send to die* n+ U0 \- n' L  Q
        else inc A_i by 1
  `, [1 J: N! Z# ~" X( ~+ T" W    end# w  s# @, S, b+ {' 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是个什么东东?' h, c! u0 ^. u( o5 b
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  ?; i. I; n8 P4 \) {
0 h: M: {  x0 I& F, D5 l# s' aAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。7 R2 l$ \9 \7 v: w+ `) ~
# Q4 U1 s( K) F, g# d" Y- s
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:9 D5 ]! q8 V3 S* t* O: I
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, v& G* f6 r3 }! `, ]
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;* i9 c' ]! A' D
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! X: w. G" N% z+ g. [- y% mbegin P_induction arriving! @0 _$ p# ?2 R4 \. j
    clone 1 load to P_pick(A_induct). P8 u/ L% a5 n2 F
end最大的系6 V, G/ H; s, m0 \! V

2 L1 w$ q4 X0 L$ |! T; ?$ pbegin P_pick arriving
& \8 I! w3 J4 }' ?7 q6 a    set A_i to procindex * 10 + 1* o- ^8 J' l9 Q
    move into Q_induct(procindex), M: K  E3 |' s2 ]5 N+ E4 P0 |
    move into pickaisle.induct(procindex)1 R4 ]' h3 K1 o( T, b! \
    /*check the type of pickaisle.induct(i), for your last problem.*/
3 |6 @' _5 Z) b5 {+ g
- O; ^7 f" h9 X& t    while A_i<=30 do begin9 B% d' O- N+ }0 V- B
        travel to pickaisle.con(A_i)
5 ~  Y2 I% O4 W+ O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( t8 C3 c9 a3 `, D/ s        else wait for 10 sec" z7 b& r' F. \  q; T
        if A_i=A_leave then send to die
9 S# ?% ^' r4 _' Z3 V% @        else inc A_i by 1* A& v: z4 S, o+ K& p: F0 J
    end
. r) b) z6 I  B' c" oend
4 c/ M( a$ U2 A2 j/ ?. X) z* w( `
其中的procindex为整形,代表当前process的序号。  C) J; x* K1 ?* X
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-21 08:49 , Processed in 0.016739 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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