设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14700|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% w1 U& H( s* D& k) N( ]6 y# W& J8 Q4 J  E
我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ f8 i, n' r. j: L! L; c: k

+ t  ~3 L. ^& n, y/ Ubegin P_read arriving
4 z2 A' i/ R( ]$ d; \, Q3 p    while 1=1 do begin
" c* F6 n5 F- N. y* @6 d        read A_tote from "data.txt" with delimiter "\n"
" u: w( W" l& t0 V# e# c2 l        read A_time from "data.txt" with delimiter "\n": `- F+ a; H; p7 W$ Z  a! k
        read A_leave from "data.txt" with delimiter "\n"# V  G% I. _/ d
        read A_picks from "data.txt" with delimiter "\n"5 G9 t* A8 ]$ P
        set load type to A_tote
5 D$ g5 R3 O! D" C2 n' W: d        if A_tote="tote 1" then set A_induct to 1
% g2 h: @6 G& ]: `        else if A_tote="tote 2" then set A_induct to 2+ f+ m( U& c2 ^/ E( r
            else set A_induct to 3   
: [: a7 l; U0 L' P: B5 H7 C; z+ _1 L        set A_i to 0
3 H( k3 t7 P5 V3 t7 b0 [+ ^, I- i+ r6 a        clone 1 load to P_induction" S* H" k4 S, }; Y* i# o. s
        wait for A_time sec) F8 q" V/ u6 D& a
    end
: ~, `- x9 h9 A# V! Q) wend
1 m$ m8 q9 K& @% W- h. S8 J" l
begin P_induction arriving
7 ~4 V8 g; H; b$ D+ q) B    if A_induct=1 then clone 1 load to P_pick18 z; @- K1 w' q2 g. s
    else if A_induct=2 then clone 1 load to P_pick2$ Z7 @$ p2 H4 e3 T) j
        else clone 1 load to P_pick3) k. E% u8 s, b6 ]/ j
end: U& E/ \3 J8 Y6 U. W: S6 `* ~& _3 c
" d$ D5 l$ M4 s2 z  M& U
begin P_pick1 arriving
0 o" H/ x# U+ e8 |$ _( `    set A_i to 1* F) m. @8 o- e. A, ]- G/ h
    move into Q_induct1
) J2 Q2 n" I* p% N, |# a    move into pickaisle.induct1' w- _: w. F: p7 j, S) R' Z, g
    while A_i<=30 do begin
% \" q( {9 s4 Q& F  \/ s        travel to pickaisle.con(A_i)0 ~5 U7 b  B2 B1 Q% I7 M/ c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) H! L0 L; A% P! k
        else wait for 10 sec: ?8 R( O  U+ m0 i! n! ~- E
        if A_i=A_leave then send to die
& k" l1 i0 v, c% S        else inc A_i by 1
/ X( N: P7 W( |8 T* E% R9 k& h    end
0 ^% g' [* z4 u1 v' K, r5 L$ oend: k6 j7 g  a; t+ C# K

4 a1 z% Z; G2 S& Kbegin P_pick2 arriving0 I1 b3 b5 g2 H% ~# ?
    set A_i to 11& T5 I6 d& `4 l2 w! I  Z/ B7 ^
    move into Q_induct2
1 n" |: p& P. M; ?    move into pickaisle.induct24 G2 c1 S" J6 X
    while A_i<=30 do begin
% d( y) w% @/ G7 [! n+ n        travel to pickaisle.con(A_i)
/ a0 o2 g6 {0 y8 s) b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) L1 F. g9 Y5 j
        else wait for 10 sec0 V. M9 f0 \3 W1 d
        if A_i=A_leave then send to die/ o) y6 ?) e8 A8 {1 K5 W1 B, z
        else inc A_i by 1
; K; \; N/ Q6 ^    end9 v$ I' d2 t9 W& G5 O7 k
end
& y) Y/ H( Y9 v4 y0 q! b6 _
# f2 F$ R9 `& r, lbegin P_pick3 arriving
8 R! c. p% B' [* R9 Z& Z$ I    set A_i to 21
$ E4 L( P) n  E1 b6 f    move into Q_induct3
$ r: D$ L4 q% P" i' V    move into pickaisle.induct3
1 F( ]5 `2 t* r" y. L    while A_i<=30 do begin
' o" Z* E+ g- i! l        travel to pickaisle.con(A_i)) b! Q# {+ o- s9 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ v: h5 o  q# O4 W' x        else wait for 10 sec
% }; ~7 E/ h& h: l2 v        if A_i=A_leave then send to die+ ~* `+ U$ Y, L8 j
        else inc A_i by 1
4 d5 T# S3 p# F8 m0 I    end
6 E# p$ a/ Z8 [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是个什么东东?/ n1 p8 H4 v2 o0 m* g: j( G7 L9 A' j
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
: N: R8 q# R- {5 S
  y( J8 z! p5 KAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: Y7 f0 J% |5 H: V6 Q

0 W' ^2 ^+ a' c- P$ k" S另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  Y8 l# u4 _; c2 y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 s9 h. H0 o  C! V5 r* e
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
  k: w7 O6 x9 _5 t0 d: u* T: p3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:3 u. W5 s8 R5 s4 Q
begin P_induction arriving' W/ m+ A$ {5 K: e
    clone 1 load to P_pick(A_induct)
+ ~0 n, {  o( U5 `end最大的系, Z( t0 y5 }6 z; x7 J
( Q; ?8 N/ n5 V) y! _& s- ^9 i
begin P_pick arriving& E7 U0 Z* L( B2 z1 d) H- m/ Y
    set A_i to procindex * 10 + 1
! s' o5 P  G* l! F5 f6 z- x1 K8 J    move into Q_induct(procindex)
) L) a7 B5 h6 @; G: `# ^5 L6 O    move into pickaisle.induct(procindex). ?# w8 S! j- {1 T5 Q
    /*check the type of pickaisle.induct(i), for your last problem.*/
  ~' H" i' \. l7 P6 U3 \6 E/ n/ P- V# N3 `# S0 a2 @
    while A_i<=30 do begin
) p. m. ~& L3 s3 U$ V% c9 m; Q4 }        travel to pickaisle.con(A_i)9 u1 k7 B6 p+ y; ~; I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 S1 B% E: E$ n1 a! V0 H' I# N        else wait for 10 sec
+ E- S1 w0 Z$ ~6 O" ^, @: p  Q        if A_i=A_leave then send to die/ u; d9 ~2 Z" N. e- I6 b! G
        else inc A_i by 13 r  ?' S8 @2 q: Z- v
    end
& I2 P; D% ]- T: F. Pend  l& n! V- d5 R1 w

7 Q* W( g. B, [# t. Y* `! P其中的procindex为整形,代表当前process的序号。; \, k# k$ S2 V. @
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-22 02:23 , Processed in 0.015440 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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