设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15509|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢  }' ^& B5 _  V  W5 \
" q' G. H8 G; w" p/ @) |0 j
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 l8 F. D# m9 u: j/ @" J# D! D- k, M/ U. n4 m4 H" Y2 }' W7 Y  g/ r
begin P_read arriving  ~; S5 D  k' |# n2 _: g6 p
    while 1=1 do begin
3 Z" m7 j- O% A9 l        read A_tote from "data.txt" with delimiter "\n"7 w, a, g+ `7 H. u5 o
        read A_time from "data.txt" with delimiter "\n"
* _# ?2 N4 ^. _+ G5 o# J5 q8 p        read A_leave from "data.txt" with delimiter "\n"
' S+ T: Y6 q  U, j* X        read A_picks from "data.txt" with delimiter "\n"! {* S2 R1 q" N4 Z
        set load type to A_tote
- E7 i2 a0 z; G        if A_tote="tote 1" then set A_induct to 1
/ T/ \; \, g% {3 v* {/ L& @6 U2 }        else if A_tote="tote 2" then set A_induct to 2% ]: ]' s5 e. P. o) p2 h9 ~3 j0 g
            else set A_induct to 3    ! w! t+ d4 i* l' f0 |0 ^: c! Q
        set A_i to 0
/ y) P4 H" K: j' N  ]6 i; C+ C        clone 1 load to P_induction
2 a' e6 I# y- `$ E) u: F. C" m) R2 ]        wait for A_time sec
5 }, r* \( G- o8 T    end
( `, H! M2 ^5 ~end7 I, n* Q! p( O! [! ]; {2 |" y' y) s

( n; Y$ E2 I! w* d0 t( r1 Fbegin P_induction arriving
" p  G: [' o/ ~. V: H( J* G    if A_induct=1 then clone 1 load to P_pick1; k4 k( P/ F" W
    else if A_induct=2 then clone 1 load to P_pick2
+ r7 ]4 k3 w5 P) v# p' _1 M/ y: k        else clone 1 load to P_pick3. {& c& D( G0 L# v$ L: H
end' q. y6 G. C0 W2 H* I  i
6 I& B+ V# f# \2 U4 D
begin P_pick1 arriving7 V6 K# ?0 Y; F. c0 `3 ]4 I# Q
    set A_i to 1! d1 @! w$ e, Q
    move into Q_induct1# g: D% G* ^6 |' v) \# ^! E2 h
    move into pickaisle.induct1
- P3 l: y$ y0 P; Q. t, I    while A_i<=30 do begin/ r# o: e: Y. S4 Z, m, D! a
        travel to pickaisle.con(A_i)2 R4 r5 V3 B1 l6 b/ J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 v1 h# z( B0 @* d
        else wait for 10 sec
2 c1 w$ B: j* i  y& f" b        if A_i=A_leave then send to die( ]5 J5 a6 z. f$ J4 n
        else inc A_i by 16 ]: |. V8 g" a0 r. J) G, Y" Y+ y: g4 ?
    end
% X) p4 E# v: U* o  k6 g- i2 V( Bend
. Z; S! k$ O- X/ Y  r0 j
! T/ v9 E7 C- y7 ?begin P_pick2 arriving3 Q  E9 L. ], |( F: Y- B- y; _. ~
    set A_i to 11
# ]0 ~. u. W  o+ s    move into Q_induct2
% ?( C3 \8 {! B    move into pickaisle.induct2
# z/ H5 g9 |* L/ t- I) m# g- b! I' M  O    while A_i<=30 do begin2 ~" z: ?3 V3 Y$ s0 L+ c' N" L
        travel to pickaisle.con(A_i)
! X7 @% ]# h3 M0 w+ V( [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" U* q. M6 u: c: _9 o6 H. @
        else wait for 10 sec
5 \' v2 T0 c- ]7 _        if A_i=A_leave then send to die0 E; B8 }8 {# Y/ [
        else inc A_i by 1
& a4 c9 t5 {( v* O0 v) M    end
/ k: n9 n7 z3 g3 c: }" ?( dend
2 u" a2 I( S, `! Q6 t3 Y, o" i
/ C- m+ w0 I0 f# l" A! tbegin P_pick3 arriving
, d, C/ V* i% x    set A_i to 21
  q$ X- |8 w) @3 @& p    move into Q_induct3- d) v! l! {0 T$ p0 ~! Q" A6 d8 g- J
    move into pickaisle.induct3
8 ^1 D3 n6 r# ^& T# e$ U    while A_i<=30 do begin  x$ n/ s6 ]& @/ Y/ {/ H
        travel to pickaisle.con(A_i)
) ]( E( P5 E8 h) b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" @+ w+ b7 _6 t7 ]2 p
        else wait for 10 sec
" B0 p& b5 F! [9 M0 U- p        if A_i=A_leave then send to die) K0 i- q* A8 c* C' ]: @
        else inc A_i by 1
* k) f  J  T) w7 H& d+ w    end
6 n3 w; n; A4 C; a1 z5 C4 ~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是个什么东东?
7 e+ T+ L/ b5 @* Z) r4 S) zmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?) G. ]1 N8 K! L* [$ x+ `# E5 s3 d4 h

) ~2 Z6 W; X% P" XAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% R  a+ Y* M( v% W/ ~% }# I. k
5 F' H/ T1 O, L另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:! T% p8 g2 p6 Y
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;; ~$ m; U& o' u+ v' V, r. `
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;- b+ A5 p9 m) O) |' C; ^2 {
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:9 f" r) b: R# s! n5 O. w0 d
begin P_induction arriving
8 I( U- ]) N* L+ t    clone 1 load to P_pick(A_induct)% b. `" z2 }. }2 J4 j; J8 U
end最大的系
3 [2 e/ {. c2 [2 p8 P3 ?! ?9 T* H' F8 A- x7 B* n5 |! e
begin P_pick arriving
# s8 C5 U$ ^; z- C5 [    set A_i to procindex * 10 + 1
# l$ l/ n6 n% F    move into Q_induct(procindex)
! w) H9 c0 A* C    move into pickaisle.induct(procindex)
+ y! D2 ^7 P' U0 ]    /*check the type of pickaisle.induct(i), for your last problem.*/9 @0 w' V5 b3 u6 u8 x2 O- l

( Z, R$ P; I  @( U  x    while A_i<=30 do begin7 q5 t' v' v. ]3 }
        travel to pickaisle.con(A_i)! A# B) W# G$ t7 j; k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# L" U# u: }3 {3 y
        else wait for 10 sec( J9 W. Q) h- O
        if A_i=A_leave then send to die
9 M, }7 l" [/ t        else inc A_i by 1' K3 y- Z3 @& K9 u, U: _) I* q; v
    end$ e; q1 ], j1 e4 ]$ U% W
end2 @2 U: `* u1 s4 w+ J2 r
4 Y1 ?  R1 N: ~  V
其中的procindex为整形,代表当前process的序号。# y# z! J! I* E2 D2 J( w6 n
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-9-16 06:40 , Processed in 0.021490 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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