设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14279|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ C! ~$ ~. n# R: a
. y% ?7 g* o% b我的问题是,在每个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中的数值,不知道会不会有什么不妥。
1 P0 ]$ I* D) Z, i3 r
3 z, S9 n* E8 T, x! r5 qbegin P_read arriving, I6 T& d6 B1 I2 l$ E
    while 1=1 do begin; k4 V# l; ~" e, B' b& m
        read A_tote from "data.txt" with delimiter "\n"
$ u6 i% `# o  l3 a7 H        read A_time from "data.txt" with delimiter "\n"! s, {! m1 z2 @: e# t  m4 }& Z
        read A_leave from "data.txt" with delimiter "\n"4 c7 v) X% v, z  [" b& K
        read A_picks from "data.txt" with delimiter "\n"
9 I% s# g1 Z+ t        set load type to A_tote0 G& x* ]# c' p% g8 Z6 m5 v
        if A_tote="tote 1" then set A_induct to 1
4 B  |, @3 e0 u  B; F! i  A        else if A_tote="tote 2" then set A_induct to 2& P6 z2 Q, C2 K7 u
            else set A_induct to 3    3 p8 s# z( F3 [/ F* b4 W; U
        set A_i to 0
: t3 D. S# Z5 N8 ]8 }        clone 1 load to P_induction0 x  o+ E; x+ j) J
        wait for A_time sec
5 u$ R# }  M5 e    end
6 v% m; E' O4 {4 h# f- X8 n4 [end
9 u. L" |# D' k5 c: \
1 M( m7 a! ]/ c4 w$ `$ ]begin P_induction arriving
2 p. {& P1 g1 p. A    if A_induct=1 then clone 1 load to P_pick1+ Y- }' B" X. M1 [7 M+ l
    else if A_induct=2 then clone 1 load to P_pick20 M  R5 Q; [2 d, w  ~( q4 M; {% W& m0 i
        else clone 1 load to P_pick39 X3 R# d9 ]% o# L- M# V  D
end
& E  S* B& t( Q3 \5 @+ A: l, L/ g. w  a- F0 q2 [/ R
begin P_pick1 arriving
6 y; B# C/ L3 L1 O    set A_i to 1
; z3 z6 t! c$ P! S    move into Q_induct18 Q* j1 Z& k" ^$ w  f: Y' }
    move into pickaisle.induct16 V* d  l4 ^  U: [6 ^/ n1 r' F
    while A_i<=30 do begin+ V' j: u3 J* R3 ]- `# }% _
        travel to pickaisle.con(A_i)
  _/ H3 E( x0 @  G' _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 j' M5 [% V& {( t% O' C; i; q# u& R
        else wait for 10 sec
5 }* }/ s* ^& }6 Y" t/ ~        if A_i=A_leave then send to die1 D+ ]6 R% ]5 w
        else inc A_i by 1% N) ^: _- s) @  x" d. X; W5 c
    end
* _) d# j2 J  @% ~, |end
1 O% y$ g  }* A: p( P4 O7 Q( Q/ i  d9 d, t/ e' x% H$ b
begin P_pick2 arriving
2 K) `9 N. |3 F4 B7 p/ q+ Z    set A_i to 11
: \; A5 v1 G: ^" }( ~+ x    move into Q_induct2
5 `# X0 ]' k5 A* R# j1 B6 y$ n  H    move into pickaisle.induct2
+ ?  \1 l5 t2 M% k    while A_i<=30 do begin
% W& f4 Z* n6 p5 v5 v9 d0 o        travel to pickaisle.con(A_i)
6 \: m- h5 l+ Y$ L: P5 j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. @. n4 y) f) S! K' ?: i3 m
        else wait for 10 sec
4 ~2 f  o% T1 Z# h) J2 _        if A_i=A_leave then send to die
! {% j: V: E) Y2 j        else inc A_i by 1! D+ |7 ^  v) Z8 o
    end  V% u6 g. }' c6 V; c3 e
end% r+ k) ?! Q8 j2 j! X
4 g6 f, C* ]. u$ P" g
begin P_pick3 arriving
" e7 Q; b- t8 [7 B7 w1 |    set A_i to 21+ w, |& s6 {# Z
    move into Q_induct3) K* ~. l- P4 z1 K9 ?
    move into pickaisle.induct37 X; C  ]; o$ F- `
    while A_i<=30 do begin
# w. q/ g+ S$ u7 \! w8 ~        travel to pickaisle.con(A_i)" ?$ y/ m& ^) D) Z4 A  W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 Q5 r* h) K+ g  W        else wait for 10 sec
" }- T( ^, X9 g6 y: z        if A_i=A_leave then send to die! f8 p& o* v5 t$ H. z
        else inc A_i by 1
7 g! l" I' [  A8 H( E  ]1 b    end
& w. q6 B( x$ V% j- L. [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是个什么东东?$ a# u# _. F" f5 L% N$ k
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?. W& S. A( ?4 N: v& Z0 X
0 R/ N* v) w6 r# u4 J; M5 {$ z
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。# i7 B; {: M4 z$ H" G1 o) ^

, b0 j0 [" w9 E( n另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:3 F1 w' `3 B3 l; e/ e
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
( f8 `; l+ H8 M- N+ O2 @0 j2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;/ g, g* g6 z. E. x$ H/ N3 }1 l
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:( z8 e  R+ q0 t& n# i
begin P_induction arriving' {( `" Q- O) w& r& H& G
    clone 1 load to P_pick(A_induct)
) z" [7 v% a* {2 y  }  wend最大的系
8 d) l; p2 r: L, r( C+ w, o/ z8 k& a7 D
begin P_pick arriving
! m+ [% S  I4 Z- k) X1 V& E    set A_i to procindex * 10 + 1% P) Y1 y/ E$ @0 [7 w
    move into Q_induct(procindex)
) S# \9 ]. V7 c* z! k    move into pickaisle.induct(procindex)
& m7 B2 r, q3 v( c  T& F7 S    /*check the type of pickaisle.induct(i), for your last problem.*/
% k8 T4 a: ]: T( s7 `# @) u/ n& P! G7 H) Y9 @0 q
    while A_i<=30 do begin: V( Q% Y- R4 s7 f1 ^9 e
        travel to pickaisle.con(A_i)1 c. N6 L, l9 i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 W$ I( M6 q, r! }- _        else wait for 10 sec1 G! K0 z( ?/ U; @, x$ t3 e
        if A_i=A_leave then send to die1 a* S5 ]- Z6 d% q
        else inc A_i by 1; L6 n( s0 X9 ~" B5 s
    end
% q7 y: ?) C& S- c6 F" k$ }" oend
4 n. k4 q& \3 y9 p" ]6 l* n7 V* g; {6 t7 R  E% O- M
其中的procindex为整形,代表当前process的序号。
; ^, H# V4 ]8 v6 p& o* T0 Zstation和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-6-27 15:23 , Processed in 0.013698 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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