设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12378|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! }& Y% P: Z5 ?# J( J" O! }( V
4 Q; w0 D8 O) j; P5 a& E" N
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" H4 ]" r* _0 |2 c6 W: S5 }) N% f7 [. l
begin P_read arriving
+ w4 u5 o0 s/ o: Y6 g* t* p    while 1=1 do begin. P4 @* l2 d* X5 O' v
        read A_tote from "data.txt" with delimiter "\n"( B& [% }3 P. j$ {
        read A_time from "data.txt" with delimiter "\n"; i  t0 `3 w( g/ {8 H  ?  E
        read A_leave from "data.txt" with delimiter "\n", l1 y' Z/ @( F% U
        read A_picks from "data.txt" with delimiter "\n"+ c# d3 k) n, j
        set load type to A_tote
; J( x+ O& H0 `        if A_tote="tote 1" then set A_induct to 1
6 U- t' S5 P1 o6 `- o+ i        else if A_tote="tote 2" then set A_induct to 2
( T) g7 ?+ Y, B            else set A_induct to 3   
2 ]6 T$ H/ g9 _& T8 S        set A_i to 0
3 \4 @9 y* y  x" f6 T        clone 1 load to P_induction( r6 @; y4 v2 w2 S! m% G
        wait for A_time sec" ~! b+ ?# ~6 ]+ Q0 m3 z9 D
    end
3 I; K! l2 E9 w) b' l8 y( B: gend
( C  k& j5 `7 F2 }) L/ x4 _8 [1 B
3 q- l1 o1 N0 j, h8 ~& c2 ]( |begin P_induction arriving3 {4 h/ M1 M" n
    if A_induct=1 then clone 1 load to P_pick1; r' s( a+ V2 z5 r/ B" `
    else if A_induct=2 then clone 1 load to P_pick2% D* u* Z, l: |4 `" T5 F
        else clone 1 load to P_pick3( h$ j, ]) ]) Y' g2 d9 ^0 n* Z
end
3 x4 }/ \# Q' @; Y1 x3 H+ u/ X0 ~
' T$ @0 k$ g9 X& v! Y. K7 abegin P_pick1 arriving" `+ [* H% p2 X
    set A_i to 1
, t8 k5 a" u7 r' z, p    move into Q_induct14 f2 H" @5 A/ P
    move into pickaisle.induct1' t2 `9 e: U; w$ w
    while A_i<=30 do begin
6 B) z( f6 M0 U" U        travel to pickaisle.con(A_i)$ i+ L: G* A- a8 ~, y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) C% o& ]( q7 @
        else wait for 10 sec; F2 N" v9 q% ?  d- G
        if A_i=A_leave then send to die0 x7 @- a0 v# G6 i6 s- H% W/ Z; p
        else inc A_i by 1' I, |' h- w* ?; t% p
    end
0 _; l* F5 x* _: d$ I" i4 _end, ?. l) e! i9 @+ W8 l7 b' D

+ W( R. K' w+ N3 f/ [) Qbegin P_pick2 arriving/ o% c/ o7 X5 V$ G3 u
    set A_i to 113 k, g& R9 J0 x1 F
    move into Q_induct2
4 ]9 f: o  [" y& i    move into pickaisle.induct2
% S# L" q- z4 p    while A_i<=30 do begin
: N* b- m% n0 {, Q4 g) z- M; }% |        travel to pickaisle.con(A_i)
8 {5 K0 u5 T# ~- w, [: P; F2 ?, q8 Z) K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' ^$ j/ M) Y* R: N5 H6 \! d0 n
        else wait for 10 sec
- h; d. I2 d# T! \& W. U        if A_i=A_leave then send to die# _  V; k# }1 a' u) B: B
        else inc A_i by 14 l3 l0 A9 g8 U1 h1 K
    end
& z$ t! B. T4 s  D# Kend1 e. }+ O3 K, a+ M" l( s0 y+ n: K

! Y+ T; Y7 `9 g% |  bbegin P_pick3 arriving' q8 R( ~1 h6 c. U5 B5 r
    set A_i to 21
! n7 r7 y' P* U+ n' x5 Z6 T% G8 q6 B    move into Q_induct3/ b9 D$ a' O  \' z4 |4 y+ V+ E
    move into pickaisle.induct3
/ ?0 Q0 J) v$ p6 D, V5 p, ?    while A_i<=30 do begin8 Q- ?3 l; y% [7 h% S
        travel to pickaisle.con(A_i)
& ^! ^/ G( r, }6 ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! s& f6 i6 d  [% l        else wait for 10 sec
4 u" C9 ~) Q( Z. c        if A_i=A_leave then send to die! N+ P% w% Q4 E' K5 m% Q3 u" G
        else inc A_i by 16 P- H, Q, P: R- ]( u
    end" }2 V8 Z1 [+ w: c3 S. y* x
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是个什么东东?& j5 M! @! h9 w9 R, [# N
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& @8 |# K- M9 O  C9 W6 S
! w; K$ q/ W8 V5 V, \3 E$ q2 rAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! H8 y7 M9 g( T7 a" r
6 }1 c: ?' J! U4 r& U5 H另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 Y2 i6 Z& _6 x- y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
- m2 t$ @: _; ?% A2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- T: c4 z6 A) m/ v* M3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
: G, t2 \: }, R( J5 n, ibegin P_induction arriving% I8 x6 Y- b& X- ^8 M. ?. A1 f' h
    clone 1 load to P_pick(A_induct)6 S' j2 M+ x- t4 l  {" W8 L+ O5 ]
end最大的系' Z/ D" R- g9 p8 c- P8 R: p! v

. p$ F% C9 ]9 D9 ]begin P_pick arriving# G$ ]5 e6 ^% |4 j: Y3 X
    set A_i to procindex * 10 + 1% z( O9 @1 H$ ^* C' Y9 K# m
    move into Q_induct(procindex); L: k' E; z% F4 l1 i
    move into pickaisle.induct(procindex)8 y! u9 m2 ?$ r/ w0 v. h+ M
    /*check the type of pickaisle.induct(i), for your last problem.*/
# w, f+ _! H: R) L- V# F. X- z& Y
3 L2 H/ W. O6 P' j6 u    while A_i<=30 do begin5 E! e! [- l- A& k) d
        travel to pickaisle.con(A_i)0 G  l% L/ r( L9 ~. p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" f& O* {% Q" |/ L/ `
        else wait for 10 sec
$ L* e: g- e7 V        if A_i=A_leave then send to die! b3 y( U! K1 E& l0 i% w) H
        else inc A_i by 1
( ~, z! B4 i7 {- a+ \7 N    end
! {7 H: K- a" [/ Y0 H( s- zend, o  Q; [* z/ m: Z; F7 x

# u4 G3 }6 U. ~其中的procindex为整形,代表当前process的序号。9 O+ v* L  |* j/ o
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-1-19 19:49 , Processed in 0.016736 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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