设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13265|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, J3 u5 f" d; d+ J6 q$ o( n

7 t8 o( |- F/ w我的问题是,在每个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中的数值,不知道会不会有什么不妥。
* t' m$ j, _3 W$ C- \
/ j4 W1 P. W: X; Zbegin P_read arriving
1 y$ _+ v! t) v2 y' w1 g- G7 X    while 1=1 do begin# j9 r9 l& P1 o8 |; e, A
        read A_tote from "data.txt" with delimiter "\n") P+ N+ e* u: a/ h+ a
        read A_time from "data.txt" with delimiter "\n"2 D  o! V) `( E; C/ ~$ b! x  h5 A
        read A_leave from "data.txt" with delimiter "\n"3 c; b! Y+ p: g9 x" u3 N
        read A_picks from "data.txt" with delimiter "\n") W$ u% e2 D0 W# `
        set load type to A_tote
) M  O% r2 f/ L' D2 Y+ y- E) [6 Z        if A_tote="tote 1" then set A_induct to 1. }) S9 E8 P* \0 t  \
        else if A_tote="tote 2" then set A_induct to 2
+ r$ [: ~  T2 w* Q3 M            else set A_induct to 3   
$ {/ I& k+ S: F' i& g( |        set A_i to 0
) }# ^+ Q8 k+ u. d        clone 1 load to P_induction$ ]( Q; J! F! b% P
        wait for A_time sec
) H. k+ x* j$ F    end/ k6 `. _# m/ D, P
end
! I6 Q  n* y5 t; i' z; S
! L8 G, |0 @5 K. @: Gbegin P_induction arriving4 q! }$ ^0 W4 d
    if A_induct=1 then clone 1 load to P_pick1! N9 U" \4 A. }; Z( p8 n7 K
    else if A_induct=2 then clone 1 load to P_pick2
5 X# {0 _- ^& O: v% E4 L9 X' A        else clone 1 load to P_pick31 \, }8 t) W; v
end* o0 ^1 w" p$ a+ c) v2 F7 i7 ^2 m

9 X- F5 Y5 Q+ j$ K0 d' @/ O% c4 Ebegin P_pick1 arriving
6 Q. I! ]: M4 _% }' v1 o. u    set A_i to 1; T( h& V5 z# J$ ]
    move into Q_induct1) H8 i% t& {( l7 A6 z
    move into pickaisle.induct1  T- J- z/ q* ^" u
    while A_i<=30 do begin
* m+ o# r  [/ p4 m# Q+ S5 U# j        travel to pickaisle.con(A_i)5 P9 y" R  D* S" X% `8 K. W. }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# U" U+ O2 N; D0 h        else wait for 10 sec+ v6 a! {( e$ i: p0 k; b
        if A_i=A_leave then send to die; X. y* ]! G/ S( f( a
        else inc A_i by 1: C- W: l' L$ }6 S' P+ T
    end
/ M6 l1 }, I8 ]( \+ Kend; {4 w: _- R& g6 F& B. O$ O. B
2 j" q9 O& j) s9 V
begin P_pick2 arriving9 y# t' x$ c; X0 x* t; o
    set A_i to 11% r3 f- I6 t1 u& w
    move into Q_induct2& V; _- ?  [' _( L" j
    move into pickaisle.induct2
3 Z% O3 ?/ |: N, ]8 H; Q9 F    while A_i<=30 do begin
8 |9 n! l. u1 l; e' m        travel to pickaisle.con(A_i)
9 y. Q9 e2 }- H/ k( ~4 y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- ^) P5 n: k8 v* j4 H" {/ r        else wait for 10 sec  L$ v# g2 g+ ]6 @* ^5 @
        if A_i=A_leave then send to die
. r/ h9 U( x; m" \        else inc A_i by 1/ `6 N. c4 }' f( P3 ^7 n
    end& E& ?& f! d9 M* i. A5 N9 B
end0 n2 \8 O, G- R, U) p% u; K
: ?3 c8 E* X" n1 r9 ]; k; N" G: E* t
begin P_pick3 arriving$ l( z5 j# ?6 t; R# b: n
    set A_i to 217 D3 J7 S2 m! b9 ^
    move into Q_induct36 N0 n" L3 k: ?5 \! v
    move into pickaisle.induct3
" m" E1 l# H2 a4 o, |5 o) f3 G' [    while A_i<=30 do begin
; V" [  X/ H. s5 I1 R: z" y+ {        travel to pickaisle.con(A_i)
4 g5 T9 e+ l' ^% s/ h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" h) ^4 Z- P  g$ P% R        else wait for 10 sec
  B! M6 I+ P- q% x8 {2 l- d1 l        if A_i=A_leave then send to die0 u: ?$ p1 Y' q+ k$ x. n2 t
        else inc A_i by 1: ?) L& V6 p! }; n5 R: @
    end
: h: b4 g! x% ]: B' \5 F3 ~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是个什么东东?
" r$ Z* D- D* D. w2 q( G  q7 Dmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?3 R3 d4 N' H% l& u: n+ \9 F

; ]9 R3 g' b/ m5 O3 Q5 N1 kAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 z) C7 T# \1 ]5 m  f
, r) _1 @+ Y7 t3 O5 B
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  U, P0 u* e: ]' Q- W: c& {1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% ~$ C, T' E* Z) v7 F1 {2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
  A3 d/ M- e) [  i+ |3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 x: k+ ?0 Z1 o1 o+ Z3 X( W
begin P_induction arriving
+ {1 J! X. q! T1 n' H    clone 1 load to P_pick(A_induct)
2 ~4 m7 {/ {5 g# D, R0 W3 T( J( lend最大的系  ?0 j# _: `' F
5 b  O0 u7 o7 z  z
begin P_pick arriving
  y6 O4 U+ o* a3 t    set A_i to procindex * 10 + 1
& U3 J6 w: Z6 `. j" [' S0 F6 p    move into Q_induct(procindex). k/ Y" R8 s& B* \+ C% J
    move into pickaisle.induct(procindex)
7 C. f1 {+ g7 ^% }    /*check the type of pickaisle.induct(i), for your last problem.*/
* h# h% B7 c% q# Q/ d! ?; E
- N, X  w: X9 T* X    while A_i<=30 do begin, s$ @0 A8 @+ H4 E9 R& ^8 H- {
        travel to pickaisle.con(A_i). _% `) x% p7 Z) @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' M. e2 z& y, K! X- W        else wait for 10 sec
0 v, e* e8 w, E3 u* K' J        if A_i=A_leave then send to die. s8 h4 X6 ]3 t& d: y
        else inc A_i by 1" j& w% F2 E/ ^8 I
    end& ?% K2 g0 B# c& Y- F0 G; ^8 S
end6 U' O* V0 h: D9 F; X7 M1 a
; n  d7 y( S: N/ K; O! V2 U3 T
其中的procindex为整形,代表当前process的序号。
/ ?+ M* U4 x7 d1 w% p1 F1 vstation和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-3-31 04:17 , Processed in 0.017645 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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