设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12573|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 v+ V' s$ {& Y! |- L5 |1 S. ~- ^/ e, a  J9 m' {
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( k* R' c( W  x& E
9 n+ y+ C( s$ c' ?$ V, kbegin P_read arriving# e, s, _1 o( y. a) J+ V
    while 1=1 do begin
7 d; \1 q% d" U% S7 Y/ b4 {        read A_tote from "data.txt" with delimiter "\n"% f+ M. x& ]3 n! z, }3 a$ Y
        read A_time from "data.txt" with delimiter "\n", H( G2 m( P2 r1 ?! M
        read A_leave from "data.txt" with delimiter "\n"+ _/ d4 Q+ G4 q: N+ T/ k9 n
        read A_picks from "data.txt" with delimiter "\n"
8 i8 E0 V9 `& z3 ?3 e* f" ^& ]        set load type to A_tote
3 F% ^& ?+ h5 y! I( y! j        if A_tote="tote 1" then set A_induct to 1
/ c5 t0 m7 d! e6 x/ U        else if A_tote="tote 2" then set A_induct to 2
# C* P; a1 G, l2 q0 J1 O2 }$ T            else set A_induct to 3   
" k$ d; Q5 }1 l4 R4 s! y  t4 p  X        set A_i to 0
* p! z9 H6 K9 X5 L' w# O1 s+ ^        clone 1 load to P_induction% @- N! \( M% Z" f2 J) O7 q
        wait for A_time sec
8 z, ]1 v7 O4 k; n4 C    end# [8 z& u6 m6 T1 J  p
end3 b$ }+ A$ d8 G) }4 l( Y/ h' t% l* k# q
# C6 o  r, `+ g9 X
begin P_induction arriving
& q* a! O- k0 j    if A_induct=1 then clone 1 load to P_pick1
& H; P4 O9 B# X4 Q5 s; b    else if A_induct=2 then clone 1 load to P_pick2
) K, Y8 l( }5 Y$ l$ \* N/ _2 h+ G        else clone 1 load to P_pick3! b; w4 Q1 e- a9 O( M& }
end( M# _6 N$ {' u9 I; U; Z' m

; {7 h: i. e- T. C2 w& Z7 Pbegin P_pick1 arriving
% E/ K. ]+ K! h; t0 S) ?; F$ u" x    set A_i to 1
$ u3 h8 ^" P; x9 `    move into Q_induct1
! B3 p/ n) j* H3 r    move into pickaisle.induct1
2 B+ V2 f, p0 Q    while A_i<=30 do begin" |( Z( I  }1 P( P2 Q6 @
        travel to pickaisle.con(A_i)* _) n$ r3 Y# T" C! V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 H# I  P* O( {0 V8 |
        else wait for 10 sec' ]; ~6 l9 \' f/ l# p5 {5 i7 w
        if A_i=A_leave then send to die' m8 K4 j3 P: t' j! j' b
        else inc A_i by 15 I1 M; @5 D, N- |
    end2 D) w7 h; @# }+ D' f0 w6 m5 u# R
end
! e- j  ]5 p. b: V  d% K* w
0 G) a7 F9 q1 f2 @  w- obegin P_pick2 arriving
. }; q- y9 M/ l# D    set A_i to 11
* v+ V/ v  W% d+ j    move into Q_induct28 N& a' a0 ?' ?1 p) b4 V% L
    move into pickaisle.induct2
2 k+ f' S  ?$ U" l9 M$ u    while A_i<=30 do begin6 r6 }( D3 V1 X% [) ^: I. z1 X
        travel to pickaisle.con(A_i)
0 Z$ D; Y& a* C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ _# W1 r( P. T" P        else wait for 10 sec
; z( Q0 K! r3 u& `5 |% k        if A_i=A_leave then send to die6 c$ L; X9 @3 b& h! M! Y
        else inc A_i by 1
" H7 S8 N" a6 }+ _7 N) B4 `    end
4 {5 i, s3 c! h  E0 ^: dend; L- w: D+ [6 l! C4 ~

) A2 W. L6 F' J  y/ Xbegin P_pick3 arriving
% e" ^% _( q5 b* H    set A_i to 217 {7 {4 B( M9 ]! O& f" b
    move into Q_induct3
% T( t. S0 S; H; s& Y3 V    move into pickaisle.induct3
5 K# ^1 w1 J" Q% M2 M" T! \( S% F    while A_i<=30 do begin6 P4 p$ ?' ?, V9 m* z5 W/ X
        travel to pickaisle.con(A_i)7 ?& K- p7 P# A0 L: W* p9 ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- o% Z  }, r5 O: R
        else wait for 10 sec
1 C2 l* s; ?' O7 H+ t        if A_i=A_leave then send to die
6 [6 {& V1 z) b( n0 Q) {3 o/ _        else inc A_i by 14 Y2 j8 D4 ^5 g% d) [
    end
( A2 X; I/ i8 g( P# H5 _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是个什么东东?- m8 B0 \' [# G! q! W# G
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. c+ X# s$ w) a
) _; a& A; D* gAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ {6 ~# f+ `3 Z; \# h! O
8 ]& ^& t- b  f* t% s
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
9 ^) u2 x" F! h+ P) i1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
/ U* w# S7 t5 T9 G+ H2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
# v6 O4 b0 e5 h5 N/ M3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  h/ m/ }  |$ h' D# t) ]$ Obegin P_induction arriving! S% E6 i' W, K; n* Y( P* x0 [
    clone 1 load to P_pick(A_induct)- L( n- N% f& o0 [# z2 k6 p! }
end最大的系6 @9 y7 J" I; W  ^( Z! k! Z4 o9 f
4 S$ J: F6 o# z1 d  Q0 L7 V
begin P_pick arriving, ^; M) Y& l1 V& F6 N
    set A_i to procindex * 10 + 1
% T1 I) U! j% K: v: T7 B: g. X    move into Q_induct(procindex)
, Q1 q- Z1 i6 k! ^9 P1 E8 U    move into pickaisle.induct(procindex)
' s  V# x/ j! v! a) P2 K    /*check the type of pickaisle.induct(i), for your last problem.*/
  R0 ?/ O( K6 C7 |9 E' I4 i; T! R
    while A_i<=30 do begin* K6 d4 f8 s) I1 C. m- D8 X
        travel to pickaisle.con(A_i)
+ G) m7 H: s7 f' t! [0 M. T, G) \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( n! B; C/ X, ^* q  {
        else wait for 10 sec8 s; \- o6 W& I9 K" p8 g
        if A_i=A_leave then send to die  S  c2 f' u- E7 G2 z; Q2 A
        else inc A_i by 1
0 ^  g/ {' H' t: ^/ ?    end9 l( F! W; Z# |9 x9 }
end
6 c* Q1 p" T7 S3 {' Y7 p6 e2 I
7 w+ i1 ~' g+ ^. P/ f其中的procindex为整形,代表当前process的序号。
) H+ @: L+ B, j1 ?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, 2026-2-2 03:47 , Processed in 0.022493 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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