设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15154|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 w/ Z" S. a9 G) P: E
6 a  y" G% L' L/ S. q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。- F6 {& F" w6 N+ ^! X+ T
; x, L+ _% ]5 b: }
begin P_read arriving+ P) p/ }! H1 ~# x' T
    while 1=1 do begin
1 o2 I! ^8 s% V3 H  {* f0 @7 A$ E. r        read A_tote from "data.txt" with delimiter "\n"( `  {! `% r* l
        read A_time from "data.txt" with delimiter "\n"
5 a& V# F! Q9 o( r        read A_leave from "data.txt" with delimiter "\n"
0 o3 }/ `: e3 ~" ]8 K( g        read A_picks from "data.txt" with delimiter "\n"* w  ^, z  X/ S
        set load type to A_tote4 b$ |7 J/ S4 P1 [
        if A_tote="tote 1" then set A_induct to 1
! B) i& [0 K" n5 _: o3 ~  _        else if A_tote="tote 2" then set A_induct to 2! b8 X9 g' l+ q* X2 n/ f
            else set A_induct to 3   
$ F9 L$ I# Q, f8 g# C8 T* o9 k# q        set A_i to 0
* j  `3 r; S9 H7 V+ c, L6 J        clone 1 load to P_induction( j% S* S2 j# \2 ~4 @, v
        wait for A_time sec+ y. C" c5 r# m+ U6 x0 t/ Y* _
    end
* k; t- o; j$ A, B6 B5 xend" S% F6 H: B  X: ], _7 V

- ^- X# L4 N# j2 |% ?0 Ybegin P_induction arriving$ u/ f! Z) f7 ?' |
    if A_induct=1 then clone 1 load to P_pick14 `, o6 }2 ]9 c  f+ \$ o+ _2 H
    else if A_induct=2 then clone 1 load to P_pick2: J9 h6 x! m: H7 R5 i
        else clone 1 load to P_pick38 O, M+ f: w* C+ ]( |6 z
end! `1 o" O' Z7 i5 ?& b5 I8 ?( p# l( R  \
1 d% z# N+ c4 F* ^% f3 z0 H
begin P_pick1 arriving
" n6 {7 |# Y2 ~( y7 [7 h+ Q& d    set A_i to 1! ~) o& |# l3 O2 e1 u  A  o
    move into Q_induct1
5 S, q% V% j, c# Y5 }+ q6 G. P9 E    move into pickaisle.induct1) L, M5 e$ P, Z3 b2 S, X
    while A_i<=30 do begin6 ?- l: [/ X. m; o/ _: _# X
        travel to pickaisle.con(A_i)9 R6 ~; ^' n0 V: i1 X- S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% v2 p' G; D! a/ q% B3 e+ e3 y        else wait for 10 sec. Y! c7 s1 D# k5 Z2 T& m' b" R) S
        if A_i=A_leave then send to die
; X/ [  @" g9 Y5 V        else inc A_i by 1# S- w  g9 b( V, a5 e
    end6 G$ w; h, z1 k* J
end2 g/ `3 _- c$ I0 ]" t$ t7 R- y

' y0 Q0 q) R) O% s# e; U) x# S5 ^begin P_pick2 arriving9 x' v9 C) s  {3 H: K0 n
    set A_i to 112 c5 K4 B1 C0 B% D( W" ]
    move into Q_induct2
# C7 C, ~, n4 U2 v$ n) y7 \: E    move into pickaisle.induct2$ H6 h' c- o" R; g2 {7 Z2 o
    while A_i<=30 do begin; ~5 L) u4 e- o% V
        travel to pickaisle.con(A_i)  c6 ~( c" z9 U* F' t& C/ o4 I$ P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& o: o% y9 i8 y8 b: ?$ e        else wait for 10 sec, Y8 O4 q" J5 C; i4 u' S% ]
        if A_i=A_leave then send to die, f0 W2 W6 O$ x( s/ Q! V: [9 r- Z
        else inc A_i by 1& d. E$ t3 T2 {, Q( x0 b
    end1 v9 s+ ]3 c2 |* }8 n! S' q, k- `
end
' T. M5 H( _6 L% @
( }! @- S! A3 u2 ^( l$ `4 |' }, _begin P_pick3 arriving! p. D6 u  X% E( M5 x+ I2 z
    set A_i to 21- M) |4 E' X* g0 c9 _( W: H
    move into Q_induct3
% H6 T- p$ J. E5 n# N    move into pickaisle.induct3
. s. _5 h2 ~8 q' e    while A_i<=30 do begin- W* D, G* R0 W7 e
        travel to pickaisle.con(A_i)
2 Z$ i: m3 l) q# d0 O" ~3 {4 r  I8 {5 z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: X9 p, `9 G9 \# M% `% j' c6 p        else wait for 10 sec3 K  m0 P8 S- t; ~8 E3 j  s6 a3 Z! e/ O
        if A_i=A_leave then send to die
1 ~. G" ~- ^4 l1 o+ G. Q& l        else inc A_i by 16 D1 H" i5 H4 X$ M
    end: x& q" [# |/ T0 b; s
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是个什么东东?& i! P6 [0 N2 R3 X. o0 y8 [
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?4 j' S( R" y# z2 ?

1 N: I) B# W" T# H: t0 a! P3 SAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" X8 @" `$ {; I8 f; W. v- q
  r3 C- U+ d6 O8 T; M
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 p4 M9 B9 Q/ y* K1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 f5 N/ ]* n* ~. V+ t
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 l! O& e# H% H1 Y) }
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
* l% f; R6 \# T! lbegin P_induction arriving
, [$ U: _; j" b7 B  a* g- Y4 [    clone 1 load to P_pick(A_induct)
* \7 [. n7 p) h9 `) D1 hend最大的系8 B" E$ O$ L9 ~  s- J! }7 _" W
+ g- v& k" }) Z7 ], l( g& l* N( E
begin P_pick arriving
6 E" c, y' z4 g3 b8 `! T    set A_i to procindex * 10 + 15 W* F& a8 q  L" ?7 \& a& ]
    move into Q_induct(procindex)
& h) A8 M' w5 J    move into pickaisle.induct(procindex)
; S' v4 S. e7 `& ]/ R4 P    /*check the type of pickaisle.induct(i), for your last problem.*/4 z8 f! w/ @; w+ [

! ~4 L) P( J) w% W) U* W    while A_i<=30 do begin
$ N% ?, x% f5 _% n! g6 O        travel to pickaisle.con(A_i)
' P. [+ `  n0 r0 B$ ?# M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- Y+ ~) D7 K3 V# ]( w2 j, d        else wait for 10 sec
! u9 S& n  e7 a6 {- }( Q; C! ~        if A_i=A_leave then send to die
  w) F! a8 b3 [" b  Q/ h$ i# M        else inc A_i by 1
3 h/ L: k5 \0 C6 w+ r    end3 w: [0 l# d0 q$ p9 B, y
end& h0 d+ u% R6 ~% [+ x+ f! G- B
1 Q6 W: `* f+ |4 Z) p: ^
其中的procindex为整形,代表当前process的序号。+ @+ R3 Z5 D+ j0 P$ v
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-8-16 13:53 , Processed in 0.022836 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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