设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15471|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! z' }& g, G" x# P9 D
: h8 u* O- O- z7 r4 o我的问题是,在每个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中的数值,不知道会不会有什么不妥。& `/ x2 e9 ]% v! W5 N

1 R1 k' w$ I& Sbegin P_read arriving
$ d* ]: {/ |* X: r( B% ^' p, @% \    while 1=1 do begin& V# F) ^3 a% z, ~9 F* j2 l! ]
        read A_tote from "data.txt" with delimiter "\n"
6 D& o  [/ H6 P! E+ t        read A_time from "data.txt" with delimiter "\n"
2 X! |, q7 S0 l        read A_leave from "data.txt" with delimiter "\n"
3 ?! ]: Q) v+ N0 u0 U2 @        read A_picks from "data.txt" with delimiter "\n". ^7 L8 Q* {. q- Z4 p* x
        set load type to A_tote
+ ]" E- C* u" \2 N6 S) n        if A_tote="tote 1" then set A_induct to 1* B. J- [" \7 l! f2 X
        else if A_tote="tote 2" then set A_induct to 2
; Z) k1 l* P; a            else set A_induct to 3   
; K. R, N! N- Y) l* l) O        set A_i to 0
, R% D- p2 s3 @' S  r  o1 w: w        clone 1 load to P_induction" m$ \4 P* g& S) M  X: N9 O; r
        wait for A_time sec
+ k' X( Z! N8 f    end
! J* v, Q" ^( b6 c6 E  j6 B7 Z/ Bend
* A  n7 x: r9 ?/ g( \
' G+ U, {* J$ x* U" l- dbegin P_induction arriving: T: Y; f4 z' O5 ^+ K/ ]% a
    if A_induct=1 then clone 1 load to P_pick1
; {/ C  Z$ m. H6 A7 [    else if A_induct=2 then clone 1 load to P_pick25 S, E6 D# z4 m& x
        else clone 1 load to P_pick3' i. [0 N6 n! q* ~
end" M, q: d) G7 O% ^
' z* P1 y; X3 v" s0 _+ z# t
begin P_pick1 arriving
' a2 r/ y" O- d    set A_i to 13 ]9 F" B4 i6 z/ |6 ?& @4 W
    move into Q_induct1
4 X7 x  `: W) s" l    move into pickaisle.induct1- b/ C7 Z+ s; b5 M
    while A_i<=30 do begin
# j% m( h' m% R% v$ X        travel to pickaisle.con(A_i)
/ A7 l+ w3 S. h. J* r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 K) m, k* ]  O4 W        else wait for 10 sec2 o; b& r, ?9 m3 A9 N
        if A_i=A_leave then send to die7 j! |) N$ _5 |) ^7 f
        else inc A_i by 1' d1 |, g; E$ F+ D
    end
4 A# l" K9 K% T( Oend
6 B) Z4 k3 f  Z# ~2 t; \0 I# u. ^) W& I1 v, |+ d' x0 p3 T
begin P_pick2 arriving
) u5 k5 G/ l: l' W    set A_i to 116 R& V( D% C' G6 N7 B
    move into Q_induct20 s* k- V9 L+ h) \
    move into pickaisle.induct2
" E* j+ Z' w; ]$ V    while A_i<=30 do begin
( h% ~. X# H* v' k3 q/ e# Q        travel to pickaisle.con(A_i)
+ ~& i' ]5 z+ ]( R8 r' L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 p+ z$ f8 u2 {0 n8 I8 T: c        else wait for 10 sec% d. s" r4 K1 ]+ x
        if A_i=A_leave then send to die
  G6 k2 ~8 Q0 ~) E        else inc A_i by 1
3 P& B5 [% ?. ^) E9 C    end0 i, _1 h( N3 B
end
- `/ M& {: P; X, C4 P
. d  H% A4 P+ I$ }4 n+ o/ |begin P_pick3 arriving
7 k0 n6 @' A7 Y. Z! k: L# J    set A_i to 21
. Y- _- B& w* o    move into Q_induct3% ]  r6 x8 U/ n& c
    move into pickaisle.induct3
0 n: l3 ^  [6 S1 u$ r7 S    while A_i<=30 do begin" B! \9 c/ G# j6 V+ {6 S+ @' F8 N
        travel to pickaisle.con(A_i)
" u( y: Z% f" x7 q, z7 q( u' j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& r1 t2 |6 Y4 W0 s        else wait for 10 sec
, q% a6 B! }( Z9 p- M        if A_i=A_leave then send to die
" I$ T# {% S9 f! h        else inc A_i by 1
4 V) x7 ~" p# P, Z/ x+ r    end& R: x3 K. L/ F: Q% Q7 Y
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是个什么东东?
* U3 @# m$ l% J8 \; x. b+ |move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- K$ l: Y8 P6 r8 G8 o  [0 R' d
- |, ~' g' D, ~- b1 Q* X
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) G/ a3 p" W- C1 e3 v+ q
5 s1 s6 o- W" b  e7 Y' P/ C/ _
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 m( |, C  m5 @* N% F4 b! E
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 I  v+ O4 n) E% y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;/ q) N7 R) }4 d- U0 x4 l" K
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
) `. \" |# Z* j5 p1 U5 Fbegin P_induction arriving# w0 b! Q- q8 q) b7 h
    clone 1 load to P_pick(A_induct)
1 C4 Z& i7 \: J1 \+ G- T, Mend最大的系
* v5 j- l6 Z" G( q2 v) D6 ?* i$ w4 C
begin P_pick arriving: Q. d( c- b7 _: V9 N
    set A_i to procindex * 10 + 1
0 J: c3 J$ t' o1 u8 G7 q' R    move into Q_induct(procindex)3 D" s7 g# b7 t+ V# }
    move into pickaisle.induct(procindex)
' w* c6 S( q# c3 a( Y: @3 j    /*check the type of pickaisle.induct(i), for your last problem.*/5 @) K4 V1 A, K* ^

; |' ~+ w) q1 m* P; b. ?- r4 M+ P    while A_i<=30 do begin
7 K7 |$ q2 b# I/ D9 I' C8 m        travel to pickaisle.con(A_i)0 N8 K+ H+ ~2 l2 P2 [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) i) Q7 P1 g. H2 R$ h/ C
        else wait for 10 sec
7 o& Y7 d  c6 I. z        if A_i=A_leave then send to die
! \+ V4 R4 V* Z3 l1 N% w) u$ _        else inc A_i by 1
/ s& S% m' K' _    end8 o! w1 ]3 a  Q# L' a
end
: k' m8 R/ z# z& @4 K2 D& r  j
& C' l$ |* Q( o. `# m6 n: K9 r其中的procindex为整形,代表当前process的序号。
8 ~  ~- a4 j2 c. Q# k0 K9 s% Istation和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-9-12 23:15 , Processed in 0.019397 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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