设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11635|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% h  q1 R9 q- Z6 r1 Q5 d

5 [; `/ u4 n2 D4 W0 m我的问题是,在每个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% b: T, S4 z! @. q  K# d

' y6 I% `- H1 W' s3 n% S6 Zbegin P_read arriving# c$ |9 s3 `: J5 [
    while 1=1 do begin2 E) n! U$ m; N
        read A_tote from "data.txt" with delimiter "\n"
( A  c, Y$ E+ S" ~$ E  m# A6 ]' h        read A_time from "data.txt" with delimiter "\n"
+ x$ }$ _3 O" ?/ l5 v        read A_leave from "data.txt" with delimiter "\n"
6 |  ?" k' A* H: J. N        read A_picks from "data.txt" with delimiter "\n"
2 ]7 r1 n$ n2 K, h1 K! v        set load type to A_tote. e6 T2 W9 f# F- ^
        if A_tote="tote 1" then set A_induct to 1* _, c; E) L7 ]& Z
        else if A_tote="tote 2" then set A_induct to 22 v( T; z7 m8 z. t! q7 f8 o
            else set A_induct to 3   
7 z0 F$ K) @' K& A        set A_i to 0% p5 \: Y, l* D( b" b5 b+ N/ {
        clone 1 load to P_induction* E% z3 M  f  I7 S' R" J& Z
        wait for A_time sec$ i- e, r: j& M/ N
    end
0 f/ G  X; C: J7 {( Rend5 c; Q. B5 Y  [
$ F8 P  y* e! w6 W4 s% S: T/ j7 ]
begin P_induction arriving3 d& G, B9 Y8 p; i5 `8 @
    if A_induct=1 then clone 1 load to P_pick1# z1 p' y' y) `6 M* m) C
    else if A_induct=2 then clone 1 load to P_pick2
. o! }+ G. ~9 ^& y        else clone 1 load to P_pick3
" G: ]  h1 Q" W, g/ L/ Yend
9 \  Z  S; a3 f4 ^' V8 H8 ]( g' b
1 @& S  ?/ Z9 r7 o( B$ y: ]" kbegin P_pick1 arriving
7 Z$ p6 t0 j8 G7 W7 ]$ |    set A_i to 1
2 E$ h$ y4 z4 ~/ y& t! P; \    move into Q_induct1
+ R  b; V3 C0 P+ m2 ~    move into pickaisle.induct1
2 M: |4 P, u% Q# \; T    while A_i<=30 do begin4 ~$ n" I' M. T' h5 |0 y' Y, [
        travel to pickaisle.con(A_i)
% ]: p3 g8 L; [# r: N8 Q/ ?' q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& l" d. e& E/ g0 G! ^8 y; |
        else wait for 10 sec
( c' Q0 B- `# M5 X3 ]5 v6 t( T' R        if A_i=A_leave then send to die, w; m2 F3 c! P5 Q
        else inc A_i by 12 P& ]; t4 F- |4 {" f
    end
, p# H3 t1 E  G  N8 X; kend
& {) `/ d; q+ b0 r$ S: ]2 m% X
  d9 x7 c5 ^) c  Z& u; m; ybegin P_pick2 arriving
3 t  s, M0 D$ n2 {8 C    set A_i to 11
: q8 M4 t' u1 v. k    move into Q_induct23 U, k4 V( g! a
    move into pickaisle.induct28 F2 h( D, Y2 f( z3 O
    while A_i<=30 do begin0 q; X7 p4 C: H* C1 e; Q
        travel to pickaisle.con(A_i)( Z. p  J$ |( h; c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- Z9 ~% O6 s0 S8 E. k; f
        else wait for 10 sec
( s5 k2 C, c+ G; e: u        if A_i=A_leave then send to die: D; z6 k' Q) T) S7 l
        else inc A_i by 1
4 F3 x+ x2 N8 H$ R7 r* c    end; b  K  V) S. M4 \( }$ a
end. G$ ^- _! W# C0 c

8 y1 \/ X% `/ \begin P_pick3 arriving
, p  s. E: B- @) e1 J, Z    set A_i to 21
; U' w4 S/ d2 o1 A8 D7 v; R    move into Q_induct3. K$ d2 U' K# x- A3 R+ p
    move into pickaisle.induct3
1 {3 D, H$ q/ f) I    while A_i<=30 do begin$ b* v+ v( p7 U' _5 f
        travel to pickaisle.con(A_i)
7 z( `( r; X" N3 {+ o. e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 ~3 V( V" \" a2 X& q" p# V0 [        else wait for 10 sec
/ }+ g% i* h+ I9 E        if A_i=A_leave then send to die$ D9 J/ h  e! c5 F- E
        else inc A_i by 1
4 v. a6 v- c3 T  L8 Y  c    end
, m1 Z' P) D& v% K8 Vend

最佳答案

查看完整内容

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是个什么东东?/ Z+ L- f4 U$ y; Q. ~
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?8 M. w2 h' {, X, L" R1 h- W
6 q1 H. _; V, o& y$ O& Y
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。8 B: n; {9 _& v3 {! Z, L

9 u/ T, M8 Z0 A# i, a- s另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, H2 E' f2 Z! u% n' }) M1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;; ^2 J/ X6 Z- Y. j4 n
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;, h% J& E* B2 I& {" P
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:# j  C7 n' d2 X
begin P_induction arriving
! i; ^1 ?- r$ V; V/ G/ e/ d    clone 1 load to P_pick(A_induct)
9 A% V8 u4 S: F4 I" Xend最大的系- m5 b8 m5 P: q7 H

/ e$ r1 l5 J. u7 s: S5 m% e) Kbegin P_pick arriving
% O- u% P2 Q& A* [( l    set A_i to procindex * 10 + 1
# H0 N1 `+ w, j7 v6 g( E    move into Q_induct(procindex)& q3 G' k" ^8 Z" e" E
    move into pickaisle.induct(procindex)
# P! X6 K& ]# N- d6 t- p    /*check the type of pickaisle.induct(i), for your last problem.*/
1 t# P: V, u6 F9 K0 V- y+ s7 m9 d4 f1 U
( g% q9 L) d4 |/ N8 D    while A_i<=30 do begin3 ^3 e1 a! O5 R& H$ D1 O5 T
        travel to pickaisle.con(A_i)2 e" ]4 V8 i( t! Z- W5 x# X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, {( a) f/ l% G; n
        else wait for 10 sec
& ]( ?* ?9 y; Q: V        if A_i=A_leave then send to die
& C5 S3 t! t% l. b: N( z        else inc A_i by 1
. g. h+ @: l: U" {    end
7 P0 s/ J( ]7 O+ V, N1 q# j: Uend
: j8 N6 Q5 O' i0 [% ]# ?
# |' [4 K; ^, U其中的procindex为整形,代表当前process的序号。
9 n* m3 b1 F% Z! T$ W% 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, 2025-11-25 09:55 , Processed in 0.020612 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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