设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10590|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 W. Y2 q7 ?$ W3 |0 G4 s% @: |
; ~" C7 s4 V- P2 g; R. 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中的数值,不知道会不会有什么不妥。/ E* M; |, f  ~6 [

1 O) o3 Y% F; f1 M; |  R8 jbegin P_read arriving8 S7 R) r8 N# R$ a  I9 A
    while 1=1 do begin
+ l- E  p% c$ @9 f2 J$ Z        read A_tote from "data.txt" with delimiter "\n"1 G' G, A  |' _& W. M! ~/ T8 B
        read A_time from "data.txt" with delimiter "\n". v' Y/ z" T  |
        read A_leave from "data.txt" with delimiter "\n"
" w  C+ A7 R! B/ ~' H8 k        read A_picks from "data.txt" with delimiter "\n"
1 ]2 `3 R: W4 }( L8 f* R        set load type to A_tote0 W" Z( v: ?# y$ V
        if A_tote="tote 1" then set A_induct to 1" a  m6 x2 n& V
        else if A_tote="tote 2" then set A_induct to 2  _! U3 c0 {+ l
            else set A_induct to 3   
! x+ |' J1 t1 d8 ^+ J: B' b        set A_i to 0
$ d/ X) q7 w' \/ ?8 ]        clone 1 load to P_induction5 @6 M" Q5 c# X* n
        wait for A_time sec
  y1 L- v( V5 q$ V) r! @; t6 P    end
# E' c/ R3 x; n: K0 G" v7 d/ A' send
! Y* ^2 @& {6 c6 T: t* n; x
, G+ F7 E/ z# Q) p- y6 bbegin P_induction arriving
  F+ a% Q$ F, L! J: `+ |5 V    if A_induct=1 then clone 1 load to P_pick1
1 f; J* [" M0 H9 }/ I    else if A_induct=2 then clone 1 load to P_pick28 _. t2 u; T. n- R" b$ e+ l
        else clone 1 load to P_pick3
- ?) T- T# l. T' C4 V5 C+ g+ f; x9 eend
+ e4 j: P" A9 L2 I3 l6 H
+ h8 y) }# u+ A0 O" V. Rbegin P_pick1 arriving! z: C0 L1 n5 [
    set A_i to 1
; F% W' G; `0 |) Q    move into Q_induct1
4 E+ j- @5 S9 a    move into pickaisle.induct1
; O1 [4 R4 D( |0 Q/ e- \    while A_i<=30 do begin! K' I& T) x1 E/ O, y
        travel to pickaisle.con(A_i)% |+ R7 o7 `6 Y( e* p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% X7 k+ l6 f1 p' C0 O; ~
        else wait for 10 sec
; ?% ~; i( W8 _        if A_i=A_leave then send to die+ _7 r# @: ?( x/ b
        else inc A_i by 1& C& V$ ?. {6 }% `4 `
    end
! g' Z7 [. ^3 X) @( |end
: E" V( d2 C1 C( q3 ^% n; i! i) I& Q7 t& e
begin P_pick2 arriving
# X( ~7 B. {) N5 z/ c5 K7 G    set A_i to 11
7 i& C+ x$ Z  S    move into Q_induct2+ r# H- ?9 J4 d, k, p7 Z) z
    move into pickaisle.induct2+ {' M# |, C/ r  j
    while A_i<=30 do begin
% U8 v/ C( e1 O) z: K! f        travel to pickaisle.con(A_i)
) y2 H) n2 e; J3 v* X5 s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ y* a/ G+ Z6 x6 T$ G8 {. |        else wait for 10 sec
3 }+ ~& W1 z$ ^7 C, K- {        if A_i=A_leave then send to die
2 o: c! G5 P5 ], D% K        else inc A_i by 1
+ L0 q' X. c$ [3 c    end
: R3 n- k1 A, Y6 ~0 k0 j6 z% cend7 l" j5 i6 Y. I0 ^/ V4 f. w

0 k* b; }+ f7 @3 Vbegin P_pick3 arriving
, l+ G( t/ X3 K# o    set A_i to 212 J' \) r& f; U- O
    move into Q_induct3- U6 ?; ~5 n' A, }" V9 C( F3 I% l1 ~' N
    move into pickaisle.induct3: W; c2 F3 u: T& Z, L
    while A_i<=30 do begin
; e! u, W2 y  F# W/ q# [        travel to pickaisle.con(A_i)
' X5 E. n- @; v) f/ F* L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" c; w" |* a, r. O        else wait for 10 sec" w; e5 b. t3 d0 U! m# Z
        if A_i=A_leave then send to die$ _7 X0 s( }. b! N
        else inc A_i by 1
5 Z' T& w9 G5 u: p5 c    end
$ V! G* h3 |. e. h# n7 u' O5 O! Send

最佳答案

查看完整内容

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是个什么东东?
# y$ e5 d% X0 v2 p  C: M) Omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?5 o2 P0 h+ g' |$ P: Z

% _+ D) y" X3 t0 F$ e' H0 OAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
  T% i) ], p, b; k- e7 b1 e# h8 Z
( Z0 ~, ?! n2 T) d9 B另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 _3 e( I' e2 O& Y- d& d, }' s
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% c" a2 }; c2 B  ~9 h2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;7 }5 n8 M/ S; a: b
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, y# H1 A0 r: c1 Qbegin P_induction arriving2 o9 x6 f+ A6 H: W; c
    clone 1 load to P_pick(A_induct)# u& N5 t+ S- F' \! V
end最大的系8 C; f4 l* n! }. J5 v8 T- e7 c

5 \( `" |' c8 gbegin P_pick arriving
! r1 W5 m+ w* f" J, i. {' P( l! j( D    set A_i to procindex * 10 + 1$ e: ]  f* U! z/ a
    move into Q_induct(procindex)* ^; b9 [0 M& z" u
    move into pickaisle.induct(procindex)
* h1 T! i0 z/ n+ G' }( p: F    /*check the type of pickaisle.induct(i), for your last problem.*/
* e% V  ~! H. x8 ~8 W3 M* h$ l) q
    while A_i<=30 do begin. X, }9 X  M: d
        travel to pickaisle.con(A_i)- c2 F" o$ o' I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 H: C3 z: @; f* {( J1 \' G        else wait for 10 sec, A% u3 n5 J' R! U* {8 g. r
        if A_i=A_leave then send to die0 q( l+ |* _: W, t  d: E7 a- E: G0 t
        else inc A_i by 10 E3 A. b& N6 b' u2 l
    end) Z7 i. f) _4 _' t
end
' s0 Q' l  Q- Q4 k
# [+ R" }9 O  L7 W5 V. i其中的procindex为整形,代表当前process的序号。* c0 C( W+ r' X
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, 2025-9-14 12:12 , Processed in 0.016791 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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