设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13284|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, x  M% J% O4 j3 M
1 k1 r+ m  T$ U+ p0 A8 P9 h4 d# 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中的数值,不知道会不会有什么不妥。
# ]+ y% d7 B  W4 U0 d' N6 [- V% J: q, X
begin P_read arriving
; N. X' _8 M7 V$ `    while 1=1 do begin
7 l2 z4 z. b5 P) _0 u% f, ]$ j        read A_tote from "data.txt" with delimiter "\n"
! D. f% `$ h* ~  d% q: d3 H        read A_time from "data.txt" with delimiter "\n"- ^7 \$ Y& O& ~8 p( W0 t
        read A_leave from "data.txt" with delimiter "\n"2 f* d% r- P6 d: Y" V: ~  j
        read A_picks from "data.txt" with delimiter "\n"
4 {  E) ?' W. k& G: P' y; }. A        set load type to A_tote
$ u: t  o: x! w6 }* W% Z        if A_tote="tote 1" then set A_induct to 1
8 M$ n( y: b0 ^; E8 K7 ^        else if A_tote="tote 2" then set A_induct to 27 Z- t6 B8 w2 t- r' `# \
            else set A_induct to 3    % K1 D& G# f' Y" _6 F2 n
        set A_i to 0
$ Q# F% h; U5 t9 v* n8 j9 a  c5 O        clone 1 load to P_induction
/ m" U* K1 x& u        wait for A_time sec
5 q& T; r* ^  C9 _4 ]    end
& ]8 ~# G: S  Aend
9 w4 ^8 ^2 u# y2 g0 w' N; t% M
6 l  p8 Q, f2 H9 e5 w3 ~. Ebegin P_induction arriving
+ N8 Y6 r( l% H4 O0 w6 @+ f# ?2 j" ~( e    if A_induct=1 then clone 1 load to P_pick1# C4 J8 u7 |: ]2 I: H7 u3 @" i
    else if A_induct=2 then clone 1 load to P_pick2- V( S2 o/ @0 \& a8 d
        else clone 1 load to P_pick3
! a! ]2 T+ d& t2 U( O1 Zend! Z) r% c" v4 z: O

/ s3 p" \, g" n$ p3 H. [begin P_pick1 arriving
  e: L; y* s# o  c    set A_i to 1
9 a" W: ?! t* K+ J7 m. v0 K    move into Q_induct10 i# I( F+ X5 j% T4 `, X
    move into pickaisle.induct18 N+ _) z' J8 D1 x; w- b3 A6 W
    while A_i<=30 do begin
1 _& u- ]. f& ]- g        travel to pickaisle.con(A_i)0 ?( u8 @$ p9 I' I! A, [6 h  Y0 C/ a! P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 b! G$ O+ k0 s) e, N! j
        else wait for 10 sec6 \8 l  L5 ?/ F
        if A_i=A_leave then send to die
2 ?5 d: R2 N1 s  ?$ W1 l( [$ G        else inc A_i by 15 D; f2 j# y$ E5 P
    end; i, K' w% [- Z
end
$ W' E+ l, s3 x9 h# v- ~/ M" n, Y  R; o- S/ ?5 p
begin P_pick2 arriving& ~  }3 F. d8 e$ t% d6 ^
    set A_i to 11
& T- R( r* |3 [: U" v$ f    move into Q_induct27 U% j9 J7 a3 }6 o" x4 Z
    move into pickaisle.induct2" D: e2 y& [. x" ~, [+ Z( u8 G, F
    while A_i<=30 do begin
! E4 E3 F# o1 {7 }3 N        travel to pickaisle.con(A_i)
$ t8 V* Z- m8 c( L- p8 t! D  d" C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( G: I8 v+ p# v+ G) i9 B- J/ y- ]( a        else wait for 10 sec
* S$ q2 [- e, p/ D+ Q: w" n        if A_i=A_leave then send to die2 ^, P' }" {: @7 U3 U5 u
        else inc A_i by 1
5 f+ f: T! X  q  A  w5 }    end7 |4 C" Y9 j' N& k. C: {6 f! L  c
end
9 e9 a3 m4 J, y( ?- V# m
# B/ S0 P1 R! fbegin P_pick3 arriving
$ N% u( m0 l; L- I! K    set A_i to 21
% F1 M6 C/ V6 b    move into Q_induct3( |: P9 y; }$ N1 s0 t( j; v
    move into pickaisle.induct3
+ h  b$ L# E5 g& x4 \$ D- @    while A_i<=30 do begin
. n: J2 g  i* `7 m8 t; `        travel to pickaisle.con(A_i)2 t) B1 ?6 F2 y% o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' G. u* y3 _3 V" r1 K" |% U- P6 @  V        else wait for 10 sec
6 E. D  V/ A- _, D' ]# v        if A_i=A_leave then send to die) u8 p/ y- z" t. X6 A
        else inc A_i by 1
. }9 [9 p0 [4 g. M* c4 U- X    end% M# O3 `& y5 ?
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是个什么东东?  V; g6 x" B+ A, f$ L( H+ w
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( _% [5 N7 m- e+ c: W1 _' I/ O! Z
& w$ l# b& s5 t2 L) P' q6 X, E6 lAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* O& [% `  S7 o; X  ^: V* v- b  g% J# W( P) g
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:0 t. Q/ q! I# D) a) Y8 E% r3 ~
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;7 X! {+ O, Y& l- y4 Z: X- f5 I
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- p, G5 C/ T- g* M4 y; O+ ]3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 B; _6 g5 b- Z& y
begin P_induction arriving7 j- ^: o& P& J; l# g0 D6 K1 Y
    clone 1 load to P_pick(A_induct)
6 U2 w% D: B% i* R: Uend最大的系; P. S6 F4 Z% I! ~* o- C* b
& D+ s& {. H! v  D: M( g* C( D5 M
begin P_pick arriving; m$ a! A# F1 Z# T
    set A_i to procindex * 10 + 1
& `. V! {' j3 k8 d0 \, l* O9 i    move into Q_induct(procindex)
( \: h1 m9 [8 {' z5 r5 `    move into pickaisle.induct(procindex)* a) i2 X- g" W' F4 U8 J
    /*check the type of pickaisle.induct(i), for your last problem.*/
& z5 d. Y2 \0 M  m! }/ Q
& t, _3 k1 z5 H: i  i* y    while A_i<=30 do begin6 w, ~# W! D& ?0 p, |  ?
        travel to pickaisle.con(A_i)& |1 t- ], W7 r; d8 l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 L, L- }1 q/ t% [- o. A
        else wait for 10 sec
2 U# W; n4 g9 s9 C7 \        if A_i=A_leave then send to die
# z' Q! W' a0 B. \* ?2 ], }& {( j1 z        else inc A_i by 1
2 D6 @1 `: A# K' a# U$ F! ?    end
, q8 q; j* ^! }end# }  n1 W8 r! g8 }2 r

; J3 |+ z, U/ t其中的procindex为整形,代表当前process的序号。" Z* k* G) k2 t1 u2 `( ^
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-4-1 10:10 , Processed in 0.017807 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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