设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11556|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ @( `. l, b: V5 i% Z2 K: U- G# f$ \2 g0 F, s3 S
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# C8 C8 G4 N8 t( Y) E: f2 P) N0 g4 s2 p. U6 ^4 |: K
begin P_read arriving
2 Q1 B2 X7 B2 C7 [    while 1=1 do begin
8 e9 Y3 Y, G; d# N( r" l        read A_tote from "data.txt" with delimiter "\n"
: b8 N9 M/ @9 N6 u* B, w# G        read A_time from "data.txt" with delimiter "\n"% P! f; G; }) H& Z, c
        read A_leave from "data.txt" with delimiter "\n"! |& c0 p5 \2 R5 b/ {" {4 P
        read A_picks from "data.txt" with delimiter "\n"# ]9 c0 \4 Q. t& C: g3 e, ]
        set load type to A_tote
2 s. @3 T6 B& g6 r  t- J        if A_tote="tote 1" then set A_induct to 16 E' V( m# k- H% y1 |* W; d9 o
        else if A_tote="tote 2" then set A_induct to 2
# _$ Z* ^( v$ X5 B. z' @            else set A_induct to 3   
* R+ v  R- ]" @        set A_i to 0
1 P/ s: S3 |! z8 c7 T" @        clone 1 load to P_induction3 a2 q- O* F) x. d+ M" g$ Z
        wait for A_time sec
" c! B7 A) B5 o$ c( ^0 j) @    end/ ^( N# L/ T& n! W3 Z7 ]
end  v) {5 Z) n& r" f: w8 B. y
) U- _' [! P4 X; v3 w1 ~
begin P_induction arriving
0 x' i3 u0 o2 u2 p4 U    if A_induct=1 then clone 1 load to P_pick1
0 V" w0 I; D( ^    else if A_induct=2 then clone 1 load to P_pick2
' p5 E' Y: I5 B: }: a: u        else clone 1 load to P_pick3  d3 l2 h# j* ~5 {% b. I2 w: D
end
& W5 ?* O- i7 N# D
+ K5 R. A2 j3 g5 N) X; j# I! `begin P_pick1 arriving
1 y2 y8 O: H, I3 d" C  O    set A_i to 1
3 H, a  u& e. Y7 n    move into Q_induct1
% k0 G" G$ U1 v9 x5 o9 R5 Z6 M    move into pickaisle.induct18 \5 j: J. b) W& |
    while A_i<=30 do begin
9 m3 \/ U2 u9 M        travel to pickaisle.con(A_i)' G1 O, r$ a. f  t  U" b& ]5 k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 z4 f3 N4 W4 l0 U6 p+ e1 ~. x
        else wait for 10 sec
% S! ?1 A/ _  J0 q9 a+ c        if A_i=A_leave then send to die% T: n6 N, l! N6 ]/ m1 m0 b
        else inc A_i by 13 l$ p$ C6 F* U& R
    end- f" w+ F$ H) l2 P" q% O
end
9 G* O& W. S  _" j
; T0 F$ F$ @# e2 U6 O7 ~' E7 e' v# ibegin P_pick2 arriving
6 q) A* d; j+ c3 F9 a& ]) n$ S    set A_i to 11
/ I8 N7 S$ w" \$ d- C. H    move into Q_induct2
3 I" K0 M' `# o2 q. `  F4 [+ A" k    move into pickaisle.induct2
9 p5 |  C# r, V8 Y    while A_i<=30 do begin. U- B, h+ S/ q* q* B
        travel to pickaisle.con(A_i)
/ K/ {8 R- L7 R& E* _( }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- a1 Z0 R3 ]: ~& P+ [. U2 B
        else wait for 10 sec
+ j7 e4 Y+ y7 ?& d9 G3 c        if A_i=A_leave then send to die0 N, W7 W. A9 k7 X/ `8 m7 n0 e. A2 A
        else inc A_i by 1
: \! X4 T5 @, z/ `0 \" M5 ~6 j1 |    end
+ p- O' E, P- n, eend6 U0 I# e  r5 N$ |- o/ m. E! c8 V

3 S" |0 N& _) Q8 Ibegin P_pick3 arriving
$ X$ F- N* u1 @    set A_i to 21
- J: p6 g) t- @1 j8 O2 p+ e    move into Q_induct31 i* v3 ?/ D4 k+ i
    move into pickaisle.induct3
/ o* B7 o% p8 G    while A_i<=30 do begin& z% A3 w; Q1 `% s! B  k, Y
        travel to pickaisle.con(A_i). M& U$ D% g6 A- [; e3 ~$ m- ^6 J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% g6 Y4 ~# ~; f5 A8 p
        else wait for 10 sec+ l: [" z1 r' a" A
        if A_i=A_leave then send to die
) ]0 n- C  k* {% ~) b# F; _  ?# X0 G        else inc A_i by 1
5 n- v2 ]# q) z* t0 H( @0 T4 [    end
1 C. p. [! d6 Q' l$ u  ~+ lend

最佳答案

查看完整内容

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是个什么东东?; ]6 X" f, R7 O0 c; N2 _5 e
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
3 N6 `% o1 q# ^2 O5 H8 I: f" u
( ?  |& O$ i: ]1 S& RAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
# f$ E! ?7 E  b& n8 l" W% J3 D+ h
9 I2 @0 o; M' A: n( f' o! d另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ |( D! [$ ~: Z5 o# X
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
; a9 ^0 ]5 ], y8 r7 s" M% d2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" \- y5 Q4 G" Q, p+ A+ Y3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 R) \2 L8 r0 ^- B( g3 `$ Y/ Vbegin P_induction arriving
  U0 {# I: J5 A+ J6 [; }    clone 1 load to P_pick(A_induct)
, V$ p) ^, f0 V. T% iend最大的系% {* x8 M6 W0 F

  [( h5 E  E9 h& s% F2 M6 r/ Cbegin P_pick arriving  X- @, C8 P1 W& e/ J
    set A_i to procindex * 10 + 1
$ ~- m2 e  y- H( _    move into Q_induct(procindex)0 Y! m( x/ q! ]* i) {
    move into pickaisle.induct(procindex)7 @, ?( K0 ~% s% ~/ {* N* l
    /*check the type of pickaisle.induct(i), for your last problem.*/! t( |& P( G2 M) ?& n) O- @( X: H

% |4 b% @% H/ G' C  j/ F    while A_i<=30 do begin8 D) F/ b+ r0 L7 l
        travel to pickaisle.con(A_i); r- _$ h0 T! p+ C" v7 ^/ k$ f% ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 D/ K9 {  x+ V" o9 F* u# P* Y        else wait for 10 sec
0 ?8 ~( G- M" O# C; r  f( t& |        if A_i=A_leave then send to die
9 E0 ]0 L6 N4 u% i' N        else inc A_i by 1" H7 m/ |0 c7 m7 Z7 C
    end) l. H1 K" P4 u; v
end9 \6 U1 w1 y9 P$ D- U6 Q8 [( @
  O0 |% O$ M  }8 Y. }
其中的procindex为整形,代表当前process的序号。& ^  _3 w) c+ [* X7 S6 {
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-11-20 20:18 , Processed in 0.022429 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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