设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15245|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, U# c1 i# W+ b' _4 A+ @
1 l9 {1 ~+ X6 c我的问题是,在每个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中的数值,不知道会不会有什么不妥。% ~" [, l. v. ], U

! t% ^6 @/ _- a0 _; `. Q& p5 _0 wbegin P_read arriving
4 ~/ ~- e. m0 i2 c6 B! t+ \8 A8 v    while 1=1 do begin0 l" M; J9 m  b% w
        read A_tote from "data.txt" with delimiter "\n"
) o3 H/ C9 a9 P+ A0 ^        read A_time from "data.txt" with delimiter "\n"
& {7 l0 m" U, ~+ Y        read A_leave from "data.txt" with delimiter "\n"
+ ]2 l) O* N5 {9 G        read A_picks from "data.txt" with delimiter "\n"* h3 R: N1 t9 j- U
        set load type to A_tote
+ U% r* A2 }1 N6 f0 ~" u; V        if A_tote="tote 1" then set A_induct to 1
* P9 q+ g" x) v5 F% S) P& Z, g        else if A_tote="tote 2" then set A_induct to 2
1 K% O0 p& ^' w% b+ g7 E, q+ |8 v            else set A_induct to 3    2 Q) S7 w' j- e: X6 R  q
        set A_i to 07 t. v9 t: `$ v) M
        clone 1 load to P_induction- A2 z$ U- [+ U) G, L# h  b
        wait for A_time sec
' }  I  ~) w. w8 n; i& ?. t0 O7 C! F    end
* x% ^1 T6 j5 M. i9 G* Nend' h9 z7 e$ a* x, F- F+ n

' D/ C' f- O0 R0 A9 c' K5 X$ sbegin P_induction arriving
7 k2 _1 p# q1 I* y7 ^    if A_induct=1 then clone 1 load to P_pick1" @5 s9 I9 k/ C" \; F- C2 b
    else if A_induct=2 then clone 1 load to P_pick2
7 }# S9 K' v& E* u        else clone 1 load to P_pick3# n' c4 C" h( p9 m! A
end
% ^  x# y" K2 J8 q# I8 u8 @$ z! ~0 Y
; S( J8 M; i' W* m0 ~3 a0 ?begin P_pick1 arriving+ n% ^" H6 D& V, m
    set A_i to 1
, M& `0 K6 h6 ^    move into Q_induct1* j: g2 Q& j* K- Z1 G
    move into pickaisle.induct1
' y- M3 w% F6 C6 r    while A_i<=30 do begin
! s$ {1 ~% G2 d( {        travel to pickaisle.con(A_i)
' E9 o2 g+ A) x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 [  L; r% j  r; C# H        else wait for 10 sec( H$ [, K! n- r! f; M% K% F5 J
        if A_i=A_leave then send to die
4 S& a6 z* r  V( T        else inc A_i by 1
2 j  S9 B, l, q8 j: o. Q4 R% e    end
7 o/ n: b5 ]/ H6 A7 K' F. |2 \end( z& o+ G1 c7 W' s) _* c" ?, C
. j6 V" X" B8 k+ t' z" q! D/ V) G
begin P_pick2 arriving
- l$ |$ k0 \" w) W! r9 c. ^    set A_i to 115 j2 f9 X% \8 i7 @% h6 w% ^7 P
    move into Q_induct2
* I6 q0 S6 l0 A! C& b( l3 O; K    move into pickaisle.induct2! s" G$ k% W% _8 q! ~  D
    while A_i<=30 do begin
6 F& l' n% ]6 L; q* n        travel to pickaisle.con(A_i)% y& A# y# s8 t! ?  _( {  z2 Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! S1 a- C4 D0 X+ H* b1 q
        else wait for 10 sec: `  M: P+ B1 F
        if A_i=A_leave then send to die
& D" F$ e. q0 O: g" Y* ]: c- j        else inc A_i by 1' ?- v4 r/ O% A
    end% z: a/ v, `- s6 x% w. Q$ g
end, y1 ]) u5 u* x) v* @% g* t; \! F
/ d) J9 f, V- y; P; _+ b
begin P_pick3 arriving
; `8 A) o# p3 D+ ~. p    set A_i to 21( k! g$ {) J. V# v& F  X
    move into Q_induct3. x$ i) H2 j1 }" g
    move into pickaisle.induct3+ o' l/ Z" F: I7 U7 ]
    while A_i<=30 do begin  Z! x+ ?/ R8 q* V6 n7 Y" `# }6 f, }
        travel to pickaisle.con(A_i)
  E( Q% K2 S( P$ ?4 {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 s& _4 @2 ^2 y: Z9 z
        else wait for 10 sec& o9 |  }( C. U. w8 M3 S& [
        if A_i=A_leave then send to die7 ?7 o/ g  _! V" z
        else inc A_i by 14 N" j: ?/ i9 E  a  z
    end
( v, S' Z- ~: r8 I- }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是个什么东东?
- m7 g7 V9 O* d) Z+ Q1 D, n8 P4 l4 @move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?' a! K% Y' k8 }  `$ K8 ^9 b

; \( O; p7 U  D! I% rAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
' R( X: M- p& }" t" l6 e/ y: C3 M
3 [. y3 D1 S* b( o另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: c6 b7 U7 y2 b8 o7 x: A
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* f. @2 h1 `5 p2 z7 P
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;7 y( f* s6 c0 W# V; c
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
. R# I! z  j& Lbegin P_induction arriving
) R: k; t3 b) G/ D+ X( [    clone 1 load to P_pick(A_induct)6 H: O! p" `. g0 }2 G
end最大的系3 h: B; X' @( z# K8 ?0 `* N6 W
# V9 U$ c8 K3 G* x) a/ N
begin P_pick arriving
: H6 }, W$ J2 u$ Y" E' g! d    set A_i to procindex * 10 + 1
+ ^  L. V* o6 M4 i5 p6 E$ k, Q    move into Q_induct(procindex)
! y/ i8 C. m1 u# b    move into pickaisle.induct(procindex)
& J. o: ?+ ?: K1 C/ w    /*check the type of pickaisle.induct(i), for your last problem.*/
& G( X! {; s, o' F8 I8 ?1 ^2 T) B0 C8 ]" ~3 [9 M; \$ r) `
    while A_i<=30 do begin
. s# K2 \3 t& X& G( \        travel to pickaisle.con(A_i)& i/ `1 }4 ?+ M. _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 d' r0 c% A; e- W/ w" C+ t  h
        else wait for 10 sec5 U* }, l1 K7 ?7 |* Q
        if A_i=A_leave then send to die4 r" F4 ~$ K/ U  V
        else inc A_i by 1
. Y# Z7 ~$ a) g1 h    end
/ L' L/ M* `. Tend: Q7 t! Z/ a" O- D( i! h
% G4 w+ M2 w6 G: i$ @* \/ |
其中的procindex为整形,代表当前process的序号。
: }/ x) d( C% k; Qstation和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-8-27 03:15 , Processed in 0.017539 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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