设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14460|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* H- u1 f6 K$ Z7 A& T5 r/ I5 C: C/ ^. z) B1 H6 J) V& 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中的数值,不知道会不会有什么不妥。
  v# c9 F+ H/ {/ y: U* {! H: P2 N; r9 m
begin P_read arriving
: X) X- C% ]  T: z" m    while 1=1 do begin
! Z7 X7 Y. N' O- l0 x2 {3 Q        read A_tote from "data.txt" with delimiter "\n"
9 L2 k! A' G! m) b* V; {        read A_time from "data.txt" with delimiter "\n"
, {  n' R+ F& N% n, c        read A_leave from "data.txt" with delimiter "\n"$ ~# E& s; J( S9 o
        read A_picks from "data.txt" with delimiter "\n"
: c+ z0 k( C3 E& C5 N' N$ i! m        set load type to A_tote
. ~( b& n. P) P4 I' O0 y* K: L        if A_tote="tote 1" then set A_induct to 1+ V7 r7 [) K) R7 R
        else if A_tote="tote 2" then set A_induct to 25 n- D/ ^9 v1 C9 H  U8 Z7 p
            else set A_induct to 3   
8 x/ y) @! {7 E4 v        set A_i to 0
5 E, _# N. X; _* w: b        clone 1 load to P_induction
# ~: L! X7 S( d4 V% z; I        wait for A_time sec
* i, g) l7 J  t) L, E- }& g2 ?( s    end
" b5 y- F# d4 I( V/ w, Mend; E7 n* d/ Y+ y. C
0 N/ b3 ]2 c/ q0 B8 Z/ H# i/ F
begin P_induction arriving
$ Q; B. q' Z2 w% V" Y1 `1 R    if A_induct=1 then clone 1 load to P_pick1
) {8 U5 u" `- w% O    else if A_induct=2 then clone 1 load to P_pick2) M+ ?& k5 P, z. H
        else clone 1 load to P_pick34 D; ^$ A- K4 k5 S
end2 c, g. w2 K+ N2 C; Y
- p/ O3 U; w* G) r
begin P_pick1 arriving9 q+ i) [5 m# A4 d# v+ E
    set A_i to 13 e" ?* E: S2 d8 ^9 J: J
    move into Q_induct1+ O5 N) i9 f6 w, t; x/ R9 F* u
    move into pickaisle.induct1! ^' e) A1 o8 T# T
    while A_i<=30 do begin& X" f# j* v" r
        travel to pickaisle.con(A_i)" e+ z4 f: C8 A5 y, ]5 P9 l9 |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ {6 Z9 r4 ]' y0 L- ~
        else wait for 10 sec
: Z7 m" e. @# M* t: B% Z        if A_i=A_leave then send to die
, N$ Z  c+ M, ?. ?$ b6 \2 ]( L- X        else inc A_i by 15 @" F  `3 J  }
    end
1 O# c" c: S$ X4 bend' `! S3 t( `# E% Q+ z; C. B

8 i! d: W/ Y% M# B' S/ U6 W+ }begin P_pick2 arriving
% W  G& f9 @  f2 Z: E. T0 [4 i0 _* k    set A_i to 11; }  Z( }& Z& _
    move into Q_induct2
, e, P/ E2 e7 B* x  R    move into pickaisle.induct23 {( I+ }1 i- C, W7 }
    while A_i<=30 do begin& n9 G/ y* l7 e7 x" a9 U9 k6 v& e9 B
        travel to pickaisle.con(A_i)
" e. |2 V8 ]6 M# O1 n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ R3 Z! a, l& r6 F4 {& Z  x  s        else wait for 10 sec; q1 {+ i4 P5 I- E
        if A_i=A_leave then send to die- k) f: S6 d; ?3 o; c7 O
        else inc A_i by 1- P0 ]( \9 J  x4 y6 t
    end
: m+ W- h/ A+ D/ ?1 wend+ N: j! u6 U+ m. S

) J) Y, q; }7 D) ]8 Ibegin P_pick3 arriving
% P1 _/ I* R( o* k, o% w    set A_i to 21
4 _6 Z8 l+ K: g6 d" m  s    move into Q_induct3" d3 T: l" W! W0 H
    move into pickaisle.induct3+ Y  B; e: j) v' ^
    while A_i<=30 do begin
: o4 D: N0 q8 a; ^7 ?        travel to pickaisle.con(A_i), f2 I, m# f( O4 {/ X! W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 h9 I! G% S+ z9 O) K: Z; r1 E1 Q% ?
        else wait for 10 sec; d( x' a2 q2 `3 w9 v
        if A_i=A_leave then send to die8 C& T. |( _0 p, r% M; k
        else inc A_i by 1. P. A& z5 N/ z! C0 [
    end
1 p- r+ B( e' [- G3 Q$ vend

最佳答案

查看完整内容

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是个什么东东?, S1 Z5 C8 z, p. q0 U
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( {- z2 X6 D  y! a. V6 z" x) V/ d
' `; d# o$ A: ~% r) c6 LAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 k/ I$ M0 y2 `* Z) T  n: R' _' z& n( U0 Q7 \. T2 `
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:" b; w# x3 ^7 T) |1 P
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! n; {! W* \! P7 q7 j/ z( T2 c
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& Y! t. k6 C7 J& L
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, l1 z6 }9 F! b# i$ W8 ?8 Q. o
begin P_induction arriving
) l1 q3 @, V/ F6 G4 E& ~, r! K    clone 1 load to P_pick(A_induct)  ]& n# v/ U3 n3 I4 x% m
end最大的系' U4 L  K* f% y5 |0 ^* A
! K+ w' l2 Q3 D; U* f& @: z
begin P_pick arriving% d5 R) b2 Y7 D9 y6 C- C
    set A_i to procindex * 10 + 1
' v& C) `# Y, B) v  U    move into Q_induct(procindex)
% Y' m9 ]0 ?* a6 R# T; ?    move into pickaisle.induct(procindex)* T$ C' \) q  `; o; V0 U# D2 C! z
    /*check the type of pickaisle.induct(i), for your last problem.*/+ ~/ D5 V/ n. u: D$ v

# E+ {, {5 J! f- I- G- U# j    while A_i<=30 do begin
0 n/ [: E' a" n+ d        travel to pickaisle.con(A_i)5 v/ `1 {- T$ o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* q" M' o7 E3 A& [4 d) B
        else wait for 10 sec6 k6 v& ~4 ^: y. n
        if A_i=A_leave then send to die
9 M6 q  ?+ L5 y' O& K& c- @        else inc A_i by 1
& T# [; s2 j6 A7 [. L    end
* R% o3 e6 F6 C4 z' i- k3 ~" ^end; {+ h4 e7 N8 m3 B+ G

' t4 a& O; A, I其中的procindex为整形,代表当前process的序号。
: E5 o, d9 @1 sstation和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-12 14:17 , Processed in 0.022894 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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