设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12481|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, |: [# m' ?3 q9 F' ~8 U

; g9 ?$ a- t9 G' [! I8 s3 h我的问题是,在每个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中的数值,不知道会不会有什么不妥。) X$ m5 |0 ^& e2 U1 X5 m- j

& w1 ^5 j. k7 a8 e) ?- c/ _begin P_read arriving3 `7 L- g; |* l+ u2 m, w
    while 1=1 do begin) d7 M7 `# O: N$ m5 P7 L1 j2 l9 x
        read A_tote from "data.txt" with delimiter "\n"
8 d% h+ K1 f+ }2 v1 n5 I/ A; _        read A_time from "data.txt" with delimiter "\n"$ i7 u( C. p( T, M% }7 x
        read A_leave from "data.txt" with delimiter "\n"
# Q: H' B& `* `6 A) O        read A_picks from "data.txt" with delimiter "\n"
) s0 e/ O4 \) J7 G* N        set load type to A_tote) C8 c( ~, N* n) R7 ]: d, |
        if A_tote="tote 1" then set A_induct to 1
0 |! U! X) A) Q        else if A_tote="tote 2" then set A_induct to 2
) l4 M$ x) U7 [            else set A_induct to 3   
. K2 v: V0 E  `0 t. ~' L# Q        set A_i to 05 y4 H1 s; ^- f( n, U% y
        clone 1 load to P_induction
" e9 [5 J4 J/ C! s; v% \, Q9 x2 ]        wait for A_time sec
, Z) X- T6 z& h5 c: X2 f& }* f    end7 [$ @/ k5 F* ^' C8 V
end
8 |' t6 N3 G" U! t
  I1 D8 d7 V- Q" F( Nbegin P_induction arriving
+ j. e3 h$ }& O( K4 {6 ~    if A_induct=1 then clone 1 load to P_pick18 ^$ N& g- m  w6 ^5 ?
    else if A_induct=2 then clone 1 load to P_pick2
* g! A# O! B1 \+ X        else clone 1 load to P_pick3( f- N6 A, S! G1 d" ^: I! d, |
end& b/ Q, Z+ b* T) W/ `! \

9 |  o; ?5 N7 tbegin P_pick1 arriving
: k" t7 Z% v0 X) K  a    set A_i to 1
2 v; P$ j7 f' x- u% T: a2 c    move into Q_induct1
( b/ S) k/ x3 l8 V) a  m5 ]    move into pickaisle.induct10 E5 U: v1 g7 p
    while A_i<=30 do begin' p- ?2 T# p8 x6 z# w, H
        travel to pickaisle.con(A_i)4 E, U1 Q" R4 T- i2 G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" H- D& l5 P" h        else wait for 10 sec8 [4 ?: z3 U# b% r
        if A_i=A_leave then send to die! e$ Y/ L" t+ N, [: }  v$ T" [
        else inc A_i by 1
" K" g  N. a; A4 W" O9 H! L    end
: Q$ @* w6 o" d+ ~! l  M) R, u& u' }- cend
  |" b( ?* _$ l( V5 d. s' r8 ^
8 R3 i9 S1 V8 Ubegin P_pick2 arriving$ ?# {$ o; m3 d: p
    set A_i to 11# I9 P  L2 I  y% T# e; n% h
    move into Q_induct2
5 t5 S/ p( @7 K' W+ O) Z    move into pickaisle.induct2' P( \0 P0 p) {" A% `6 C: f. J
    while A_i<=30 do begin; P3 C* V9 }( {( X$ n+ t/ k" H8 c
        travel to pickaisle.con(A_i)  s2 P9 F$ K6 P6 H# {5 l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 Y# Z  ^. v$ |2 q/ ?
        else wait for 10 sec% k7 i! y9 m% i  ?2 ^
        if A_i=A_leave then send to die' m0 {) r! H% J
        else inc A_i by 1
9 W7 P0 g+ c2 N. \% B    end3 Y. \+ t' `$ v) Z6 t
end
7 X- B# w/ @$ o' k
  \, a* E& _% gbegin P_pick3 arriving
( Z$ {1 k$ u$ \/ H7 w1 p    set A_i to 21% k9 n8 `# L2 K  A5 P. r
    move into Q_induct3
7 [% F* W2 y0 K  Q( C    move into pickaisle.induct3
7 P, z5 x8 |$ b# G( n    while A_i<=30 do begin: M: S: ?4 \1 Y2 o: H( f
        travel to pickaisle.con(A_i)
6 q+ x! e: ]4 D6 F2 ~& f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 }% a7 j& I: M
        else wait for 10 sec
2 R; ~$ @) f2 F$ W# a0 r/ w        if A_i=A_leave then send to die
* X2 X+ ?; C) V7 t' A! Q8 v+ B        else inc A_i by 1( t1 e' X% ~. L$ b+ h( k2 A
    end$ C# O' U& G+ l) C
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是个什么东东?
0 y5 b% t9 L6 N; Z$ ~! t. wmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ j' T+ u& |" I. j7 J2 K6 Q  e+ g# S0 Q) ~
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 _( c; t1 q7 f

) L0 E1 _  Y' Z. i+ a+ R0 S4 L另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; g3 b3 S% U: [$ j+ q* I1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, w- g( s7 ]/ D" n2 ]
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& [% ^$ o( q) Q) w( {$ o  E
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
) m- m  H& c4 c% t0 {2 l. ?  o: ibegin P_induction arriving) o0 ?+ _+ X+ p8 \  W
    clone 1 load to P_pick(A_induct)
  M, |* }; `9 H$ c1 m$ M- ]) n8 J2 Pend最大的系
, y  j: s! B+ T/ z. Q4 q* }
8 o% p% i* u: ~* pbegin P_pick arriving
5 S" B/ A$ b1 x" j+ a5 v* e    set A_i to procindex * 10 + 1
) n) ~4 w% F  V% u5 h7 y2 ~# @3 k    move into Q_induct(procindex)
; Y/ J) C* [' |8 }$ T    move into pickaisle.induct(procindex)
* C& m- y0 A0 ~- N) A    /*check the type of pickaisle.induct(i), for your last problem.*// f% [2 S& n( L! g6 Z# ^/ O
5 B. Z: d$ o# }, m/ }3 G$ j
    while A_i<=30 do begin& z5 ~# ~  x: ^5 Z
        travel to pickaisle.con(A_i)
( Z5 {2 e) r' I# B  L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" Z# J. v: h' X/ c3 p9 G        else wait for 10 sec  ~0 B& i' D1 V+ z) A
        if A_i=A_leave then send to die4 R" m/ C3 j+ m6 K
        else inc A_i by 19 B/ }# n! q9 @  f3 f* Q( p
    end5 O  }. ]! B  O+ U
end" n% s# a7 B: K
) G  j2 A/ J( }
其中的procindex为整形,代表当前process的序号。
' Q4 G' ~. g: T0 W, |$ @% H) Fstation和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-1-27 22:48 , Processed in 0.017966 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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