设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13391|回复: 2

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

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

& T  u& r1 F9 V# U0 F  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中的数值,不知道会不会有什么不妥。3 v- y, r- O8 e: ?
+ F2 p8 C- O9 U$ n6 U8 T
begin P_read arriving
- M. G2 {2 r0 {8 ]' ~    while 1=1 do begin& }8 W! a  J7 W# W4 ^
        read A_tote from "data.txt" with delimiter "\n"
9 m' W) @" c/ U9 T' I% s& B4 F        read A_time from "data.txt" with delimiter "\n"
8 u1 M/ S: H  `0 K        read A_leave from "data.txt" with delimiter "\n"' Q0 g& D. [. B" g% ^# f* N
        read A_picks from "data.txt" with delimiter "\n"
* `. N8 h& ?4 z0 X2 `  K        set load type to A_tote$ f& Q) B) Q- h7 X
        if A_tote="tote 1" then set A_induct to 1
- R% |: Z* ]+ U+ M' D: T        else if A_tote="tote 2" then set A_induct to 22 d. D' l: G- b7 F, }9 m+ R# c
            else set A_induct to 3    % d/ W6 i7 e& U8 z/ G% c$ }. z/ E3 t
        set A_i to 0' p. b+ o4 G/ `8 I+ j: t
        clone 1 load to P_induction
5 K! U/ g; P& b6 E        wait for A_time sec
6 p3 j5 k$ P: |    end
: n( d6 F, y/ b4 w) v& Aend) h2 J; X7 g. E2 G" w) k" m' p, D3 [
/ c7 R" |6 y8 }# H" {7 Y9 n
begin P_induction arriving
' u- W$ Z- e; X9 z& k' [/ i6 E, g    if A_induct=1 then clone 1 load to P_pick1
' x/ g* h* X& C2 {7 W    else if A_induct=2 then clone 1 load to P_pick2$ {% }4 z( }  p% D( m. ~
        else clone 1 load to P_pick3
9 H) D$ C- L! a+ K  J, J) ^end. e' R- B* t/ q: l

* v* b: }- k9 A4 w" dbegin P_pick1 arriving
, u* S4 Z1 I& \    set A_i to 1% ~0 t; @3 ~: R7 Q& N
    move into Q_induct1
: E" F1 N4 @  s    move into pickaisle.induct1
: E& ^8 U% {. |    while A_i<=30 do begin2 O! G, G! d/ f+ Q' s# h% S  n
        travel to pickaisle.con(A_i)/ L8 f( f3 |( U/ w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  N# y! ?* `; J5 L' T  g: }9 ]& O+ Y
        else wait for 10 sec
& m; R2 s+ `/ z, K7 b        if A_i=A_leave then send to die
0 s" j) U0 L3 T6 R; G- i        else inc A_i by 1; z1 K2 O. ]4 _2 d/ X
    end
: C& D  M! G0 c6 ~9 j& G1 gend5 @1 U7 T7 S+ o9 \% N2 f
! A3 \8 N4 W6 q6 P7 o; j/ }
begin P_pick2 arriving2 @. A# c* B& \) O" I" d
    set A_i to 11
1 ?* j( J- c; M, t& Z' X! ^7 Q    move into Q_induct2
0 j! @0 A! U5 t( ^1 V  e: H5 }    move into pickaisle.induct2/ _# ~$ d4 H# r/ [% E" X) y! u9 `- q
    while A_i<=30 do begin
; G+ `& M, c, i* R        travel to pickaisle.con(A_i)& Y( |+ E/ U( x8 A( y; V/ F1 T+ E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. S8 u! i9 \6 \$ p. L
        else wait for 10 sec' d5 S1 N+ \( I$ o& x% a
        if A_i=A_leave then send to die
, z6 C7 Z& U7 f* U        else inc A_i by 1
6 }  Y3 \% U+ X: a7 ^    end
3 w3 j; _- e/ F* A+ L$ ]end. q) u# l, y: W6 w4 ]
5 n  P( x+ R5 p* d$ p+ l5 z( C
begin P_pick3 arriving
1 [. X. R) [+ }3 i    set A_i to 21
& K! P- \2 i& T! l3 |    move into Q_induct3
* A* s) z( k4 l* a    move into pickaisle.induct3, Y5 R( C6 P9 d1 H. l8 O
    while A_i<=30 do begin7 l& U5 j  k4 X$ F
        travel to pickaisle.con(A_i)
; B9 V; r9 W* q6 P6 N" ~) G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! ]! Y; I' |7 G        else wait for 10 sec; B/ B: h' _% U
        if A_i=A_leave then send to die
" I( M3 z% G1 ~        else inc A_i by 1
. w; a7 t* Z3 j) p; W& K    end
; v! U# P6 O3 `$ Zend

最佳答案

查看完整内容

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是个什么东东?5 E6 u; N5 v3 a- ]* X8 x
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
2 r+ u# p( _% N! O* a0 L5 T# S( A! c6 n  \/ t9 a" ]/ \
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
# M2 h' W% N% |9 A, V/ W7 L; \: Z: O( ^
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:  [! w  A4 X0 Y8 j8 `2 S% S  i
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;8 p5 P$ H2 ?& M! Q3 ?. y0 s
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
! D: {8 n1 Q5 j2 p  o. {3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
$ V6 v, ^6 i8 `* D" |& Zbegin P_induction arriving) ^7 L7 N1 h/ H8 z% h% g
    clone 1 load to P_pick(A_induct)# r* U5 G' n5 ^/ v; [
end最大的系+ d, |: \' K. X, ~6 j. K# b. B6 J3 r
: s4 o+ `7 H9 [
begin P_pick arriving% `7 l3 V, ^7 g, h/ M
    set A_i to procindex * 10 + 1  N" X+ ^& ^$ |, G6 ]
    move into Q_induct(procindex)3 d' G# |4 p. M# m% D' K
    move into pickaisle.induct(procindex)5 U1 X/ j1 y: Z8 Z7 Q3 Q9 T* v8 B, w1 l
    /*check the type of pickaisle.induct(i), for your last problem.*/
6 V; q7 T8 F9 J3 p& w) Z( f0 i  P; s3 @% l0 N. q
    while A_i<=30 do begin
4 X: Y+ H7 W8 E        travel to pickaisle.con(A_i)
; ]# U3 h( Z# N: l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 @" R! g4 N9 I. ]
        else wait for 10 sec( B$ v/ f+ b! r7 j1 M! b
        if A_i=A_leave then send to die0 Z  {* J4 a3 k
        else inc A_i by 10 H* M0 `' i, g8 O
    end
: \, g! v8 B# H. x- j4 @end# |! ]" l5 b: F
$ e1 Z# L- \; V" M0 p8 S- V! F4 l
其中的procindex为整形,代表当前process的序号。$ Q1 Z  B. G' |" t. x/ Q8 Y
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-9 19:51 , Processed in 0.022432 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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