设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14294|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' p  X0 U' w# z9 |
" v/ N% e. @. p3 _& o
我的问题是,在每个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中的数值,不知道会不会有什么不妥。& g4 c, ~2 c4 V# A
9 k4 ]3 ^! P) r" F7 o6 R
begin P_read arriving9 R+ ]0 s: ]- {, }
    while 1=1 do begin; u% }7 r$ q( v) F
        read A_tote from "data.txt" with delimiter "\n", j3 z, C# e" f2 _* w4 K, O
        read A_time from "data.txt" with delimiter "\n"" E( H& e& x; n& M$ f
        read A_leave from "data.txt" with delimiter "\n"; Q6 @9 h1 t3 ^* U$ R
        read A_picks from "data.txt" with delimiter "\n"
: b6 I( }, o% o6 N. {3 ~- A# l# j. ~3 n        set load type to A_tote
/ i0 g, l2 M# ~  ^* Y2 K; ?, y" a        if A_tote="tote 1" then set A_induct to 1
1 N4 U: O; A  |: [4 P        else if A_tote="tote 2" then set A_induct to 2/ D* S, v8 N4 T3 s) l6 r4 t2 g
            else set A_induct to 3    5 l& v% k: |) j, k% p, k
        set A_i to 0! k! l6 l- v2 H) n
        clone 1 load to P_induction) t3 X6 Q) P) b! V/ }5 e
        wait for A_time sec" ]. |8 Z, J7 Y6 K- H. p, u
    end
3 t- ~8 V& d! E' Hend
1 R" i. S  k6 r& v
: j. y9 _2 N2 @begin P_induction arriving
; y7 |6 P* T: c5 [    if A_induct=1 then clone 1 load to P_pick1( e' {$ V1 b3 A8 o* b
    else if A_induct=2 then clone 1 load to P_pick2$ k5 Y. ]1 o- G* K
        else clone 1 load to P_pick30 J. c/ V9 V5 m  A
end
0 c7 P. i7 K3 B! V1 Y* S* B, k. o4 r
begin P_pick1 arriving
! _" _2 O8 ~4 E1 B+ ^    set A_i to 1
! w8 p; x+ A9 [    move into Q_induct15 ^  K2 I! w" b; g) a4 s
    move into pickaisle.induct1
4 I" z2 t, V% Y1 @/ \    while A_i<=30 do begin
1 {2 \; |; l9 q        travel to pickaisle.con(A_i)
4 ^; x) @  t' g- c. }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# J8 d" r1 y  H. [
        else wait for 10 sec
9 W7 y& k: c2 Q6 Q; {% U3 ]" I; x! Q  b        if A_i=A_leave then send to die" m$ |5 F) T& i1 P; |, i
        else inc A_i by 1
1 |1 F3 w7 |$ m) V) I) o: m5 n    end/ R- C1 n6 F6 b) w
end6 O. ~( [/ d6 D: `1 v6 D7 C

. q8 [  q# s" C, Y4 w9 x/ xbegin P_pick2 arriving
$ j% b5 w/ i1 h% f. w- P    set A_i to 11- M* I- R" m5 {
    move into Q_induct2
9 W: A! j$ M6 |, p0 B9 [" _    move into pickaisle.induct2$ g- }: F) {. m$ e" G0 I
    while A_i<=30 do begin
- T+ ]1 Z9 d1 F7 i, f        travel to pickaisle.con(A_i), v  q+ _/ |8 ?9 g/ U. J0 z! L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- I2 j4 T4 _0 Q( ^& _9 S/ J# p        else wait for 10 sec! c; Z: t- W% c( Y# T
        if A_i=A_leave then send to die7 D( ?* K  X9 s
        else inc A_i by 1; _" q4 g' g$ y' _
    end& m  V% n* S3 X
end
1 J: j, H3 u% L( C3 x( }( e
  Q! J6 K4 \; Hbegin P_pick3 arriving8 k' T' M  |8 z) L
    set A_i to 21
. D/ V. M. A& [. N* ^1 N4 ]    move into Q_induct3
" P& _7 E+ J: Q. \1 j) O+ k    move into pickaisle.induct3& a$ f! y; [! d! [- N
    while A_i<=30 do begin
$ b) z( }# {% @3 t( _        travel to pickaisle.con(A_i)% Z- q! n4 E( P, Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 q  a& T0 p: }4 V3 `! U1 X        else wait for 10 sec
; ?3 `6 C& s3 C, o        if A_i=A_leave then send to die/ i4 `5 Z$ }7 }6 s  t7 _
        else inc A_i by 1
9 |( W6 E- U8 J, U  A$ D$ h) X    end' f0 p1 J3 f( p5 K7 s& p9 J
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是个什么东东?0 K( A" w) E$ J2 O2 f4 e
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! e, c1 I4 y* V9 \
+ N! L$ _  e0 u& ]9 SAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。, B: e5 }; O7 u8 S
7 l6 k0 D0 r/ @+ l  W- Y1 q
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( X) s+ t2 I9 J1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;; A/ E& t) R6 R! }6 l
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;# i: `, `( F! v0 S
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, f" B% m% x  m
begin P_induction arriving( Z* a( c$ G9 m; g; ^
    clone 1 load to P_pick(A_induct)' _! Q6 x4 V! q+ g
end最大的系, l# H2 F. O4 K) K# \9 K

  p& K! ^1 \' L0 Vbegin P_pick arriving; s* q8 I: ~0 j) k. `
    set A_i to procindex * 10 + 1/ K2 h: c$ u, ~$ Q
    move into Q_induct(procindex)
  s5 a" l% V; j" S# K9 L. f3 r    move into pickaisle.induct(procindex)! W3 X3 b; }, e7 Q0 j
    /*check the type of pickaisle.induct(i), for your last problem.*/
7 v; a+ i3 v: C2 d
8 p: W" A/ K% B  O8 M/ N    while A_i<=30 do begin5 H) M0 d0 D3 s7 d0 \& q" v
        travel to pickaisle.con(A_i)9 E( X* G2 d+ V" a) w4 i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* [0 _! g1 C1 a( C6 m. ]
        else wait for 10 sec* G$ O* n; L6 y; @8 t0 C
        if A_i=A_leave then send to die& z2 r6 O7 e4 ^+ m0 @' ]% j" @
        else inc A_i by 1
  {2 k) h& W+ f1 M( R' P- A    end5 ^; c7 m9 Y: V4 @9 u2 p
end
" D( z& M1 R/ I7 P
; s$ i; I8 G9 s' P+ ]3 R" Y! w其中的procindex为整形,代表当前process的序号。2 d- s/ V  H/ L$ H, Y  O
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-6-29 01:47 , Processed in 0.018753 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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