设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14329|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" w3 a5 A- M; n9 t- d
, r4 v( q1 I9 l! Q2 a' R
我的问题是,在每个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中的数值,不知道会不会有什么不妥。! \0 `$ e( m: Q' j- h5 V& t% Y# _
* v0 N/ s1 z0 [. W" A. r
begin P_read arriving
9 L6 w& r+ ^& ]+ z    while 1=1 do begin
8 u3 @( e& R. Q        read A_tote from "data.txt" with delimiter "\n"$ e$ Q$ e2 D% O# J
        read A_time from "data.txt" with delimiter "\n"4 r$ y2 c& s8 n, e* p
        read A_leave from "data.txt" with delimiter "\n"1 e2 W: f4 I6 U# a! v- @' X; I
        read A_picks from "data.txt" with delimiter "\n"  O7 n  H1 P0 C$ {6 C5 s
        set load type to A_tote
/ _) n$ a% r6 J- i, x        if A_tote="tote 1" then set A_induct to 11 I% |# Y# d- P" Q7 V( a
        else if A_tote="tote 2" then set A_induct to 2
0 {' q# |: b- l" T% a' K5 W8 n* J            else set A_induct to 3    / k4 R, q) E& O, Z& E) e
        set A_i to 0- J/ @9 \3 o: ^1 H$ f) \
        clone 1 load to P_induction5 f4 N- X: ]) i( G1 d4 ^
        wait for A_time sec
; C& f1 ?' A9 {+ m% g# w  J    end
! |! p' l) l( t' Send# E4 w, `' @- W0 F8 Q& j* {% w
1 y( J* J2 l8 f/ P7 C& }  D
begin P_induction arriving: M, A" m0 n8 k+ ~! V* j& ?7 Z
    if A_induct=1 then clone 1 load to P_pick1
1 u6 n4 S  n: b) f    else if A_induct=2 then clone 1 load to P_pick2
( J6 l+ m7 q+ M4 q4 ?        else clone 1 load to P_pick32 f: ^! Z( Q6 o! D. W7 X
end
; ]3 a$ @) U# Q; Q1 q, j: W6 O$ h% @3 L/ Q
begin P_pick1 arriving& P  E1 ]/ Q2 N1 h; r/ @
    set A_i to 16 Q' }+ b3 ^! X" p7 u3 [. Z
    move into Q_induct1- U8 f6 `) W7 I+ p3 T: I* a
    move into pickaisle.induct1
- q6 g  F" i  n) r" {% n! ~    while A_i<=30 do begin. {& @  g# L  r
        travel to pickaisle.con(A_i)
( H) \' h( `/ Y8 ]5 f( S4 ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, S8 }; e+ i: H$ t" j# N        else wait for 10 sec
; w3 o# H  j$ ?' L7 A5 ]# e        if A_i=A_leave then send to die  j$ U  b! ]4 T
        else inc A_i by 1/ p8 p  n* U' d* h) M
    end
  p) g! _  U5 n5 kend: E/ U+ i9 ^$ w6 l

0 h: H- I) l9 R' r: |' w1 l8 B9 C5 k' qbegin P_pick2 arriving
, x; J& B+ G5 K, u; x6 B    set A_i to 11
; v, e6 i) h0 E8 @% H' N/ S+ f. A    move into Q_induct2
$ P, @9 b" P- U& S    move into pickaisle.induct2, B4 g2 \; [6 ~
    while A_i<=30 do begin
% F3 O8 S, Q/ e; Q9 x. b. @8 K        travel to pickaisle.con(A_i)2 F8 s2 b) F% j; p& l& V, w* I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' b2 d) X$ F3 ?9 H  [7 v, X        else wait for 10 sec+ F9 G, y3 A# c' K' I3 N
        if A_i=A_leave then send to die
9 i' q* u3 n$ ?9 o& s        else inc A_i by 1
! z' o9 c! i3 k" I3 B    end
" _" B' j$ n3 D  Fend! y2 q7 S$ K! {4 A0 l
, Y) ], S" D2 L- W4 `, N
begin P_pick3 arriving
- J% E: l4 B: L# s    set A_i to 21
- t: p% Z& M3 H; F) [0 O    move into Q_induct37 ~+ B3 j) j7 d) W+ p4 e4 h8 D
    move into pickaisle.induct3
) ~4 |: L( R7 P: Z/ r2 e    while A_i<=30 do begin
6 w* ]+ m. Y3 p        travel to pickaisle.con(A_i)) }) V( z% f" |& ~! f0 P, c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" C6 I* t- O+ P- Y1 b
        else wait for 10 sec
, r2 @" l& A% v/ n7 ^/ O" F5 t6 G8 B        if A_i=A_leave then send to die7 Y* q9 |& @8 l! d. ^: a) f' f& Q$ `
        else inc A_i by 1
7 n9 Z3 W  m* I. i! w0 e5 e    end
9 C6 v, g( J! r4 c$ r: X, Yend

最佳答案

查看完整内容

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是个什么东东?
  G5 Q, q9 c  J2 N) n  Qmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?: B# A" q* P, @+ o9 I0 U

9 W6 f8 \* \# \4 s2 h  {2 z# s- @AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% v; R* e' o, M* |5 C  e  e
. Y. U9 F/ F+ i: C  Y另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* \: U0 Z+ i- R4 l  Z1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
7 i6 x1 A: `% C2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
7 ^+ }" v6 i8 w$ U% C$ Y2 z9 v+ |3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
( j; A+ {. {6 x- N* B' r. l0 }begin P_induction arriving/ ?, m5 E- c6 Y6 t; w
    clone 1 load to P_pick(A_induct)4 T7 _+ \0 U8 T- I# f
end最大的系& Q$ Y5 y% N4 f. P8 B
1 O7 n2 o6 |+ P* h7 u3 M1 _
begin P_pick arriving9 v! ?/ D" @/ x+ `
    set A_i to procindex * 10 + 15 T" c" h& ~6 J1 |5 D, ~4 P; ?
    move into Q_induct(procindex)% j# t' e) t5 q
    move into pickaisle.induct(procindex)
9 o5 f+ g9 u+ q3 y  q% F4 Z" ?7 D+ b    /*check the type of pickaisle.induct(i), for your last problem.*/
  L* Y3 }  ~; O! W) _0 d: S
% [6 ], r, Q' t    while A_i<=30 do begin' y4 [! y" g6 M) V7 B4 {" b( X
        travel to pickaisle.con(A_i)
# ]2 W0 d" @" d7 G; ~% x& w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# U5 h- s' o$ Z# b% e. O+ q; n0 l' m: ]
        else wait for 10 sec
" G) Y/ O5 p! |. r/ Z        if A_i=A_leave then send to die" Z2 z- D0 h: o9 R( U; @" Y. c
        else inc A_i by 1
, w' _$ R3 h5 t1 t4 U" j% A    end
' s3 `7 j" k/ k9 p  i. ^% R: oend
' Z, z2 w$ z" M* ?6 L! v" {
4 ?5 {: I5 i% d; B其中的procindex为整形,代表当前process的序号。
% j4 W' v5 S# S( mstation和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-7-3 12:51 , Processed in 0.018124 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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