设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11255|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 v8 A3 C% `& b- b

2 a' @+ C- ]8 d# l- Y% x我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 u0 v3 R! E+ h* S
% l9 H" r( ^" q+ G* V0 Z
begin P_read arriving$ a- m. l) U7 G- p! L# q- F8 g
    while 1=1 do begin8 p  I5 K$ K; n3 d; V" T4 M
        read A_tote from "data.txt" with delimiter "\n"
, K2 k( Z# h; d        read A_time from "data.txt" with delimiter "\n"
1 j8 R9 |6 B) Q- ?( [0 j/ W        read A_leave from "data.txt" with delimiter "\n"" W6 G9 p) {+ @" _3 q" {
        read A_picks from "data.txt" with delimiter "\n"
( h% R! A4 Y, g& g0 M        set load type to A_tote
) x! H* @9 j0 q3 ?        if A_tote="tote 1" then set A_induct to 1' N2 ]* O9 e1 Y2 U) u
        else if A_tote="tote 2" then set A_induct to 2% h8 L2 y, ~$ `: f
            else set A_induct to 3    9 Z  y: F" N  f, q/ @
        set A_i to 0" s- l' E( `- |& `* x! }  H1 X
        clone 1 load to P_induction
: ^0 G4 _" m" X        wait for A_time sec9 t: \! f7 \* y/ C
    end
( _1 ^5 N0 E, C& Kend6 v7 Q5 J7 ^# b% |  P7 P3 D8 _
3 A- h6 ~- `, C7 B4 ?
begin P_induction arriving
5 J" k1 I  U) r! t    if A_induct=1 then clone 1 load to P_pick1
) K. H& P: `$ W8 Z    else if A_induct=2 then clone 1 load to P_pick2
  U+ X" W& t7 C8 R9 ]  B        else clone 1 load to P_pick3
! v, q% O& K6 g$ nend4 K3 K3 }4 N$ |
) [; D6 Y* v  O  D1 S
begin P_pick1 arriving
5 }4 ?* \; T6 T8 E9 N    set A_i to 12 N, @9 E" E; O. g: p, g
    move into Q_induct1
" |* K2 o: m# b! `- P% ^9 Q    move into pickaisle.induct1
% [2 W" O' P! A# Q9 m    while A_i<=30 do begin
' ]4 k7 A0 H; Z9 ?8 g        travel to pickaisle.con(A_i)
/ K. v3 _6 p; N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 Y1 k1 K) K1 {
        else wait for 10 sec3 H! m& c3 w+ ?' u* S% J0 w  s& L
        if A_i=A_leave then send to die$ U: [) }8 W4 h' J/ Y( j
        else inc A_i by 1/ @6 S% N9 G9 l% X7 c1 A% @+ Q  G
    end4 i3 h: _  G8 A: v* v
end
8 z8 R& z8 M% m* r  H; p3 |; Q4 i, j# F* m/ F
begin P_pick2 arriving
/ {- G* d  `) [+ A) u    set A_i to 11* P1 Z5 U; Y: t1 Y' ~6 i
    move into Q_induct26 C4 d  a( [2 t
    move into pickaisle.induct2
/ D! z7 C) j; f# G& Q    while A_i<=30 do begin
1 Q7 D! Y, e3 }7 j        travel to pickaisle.con(A_i)* _4 W& ?# ~- I2 l+ E( M2 k, p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& S( Q9 }" G4 L6 q/ F
        else wait for 10 sec7 j$ X" }' O: ?9 [3 C7 P: w* \
        if A_i=A_leave then send to die
9 S6 X: L3 @; G( b        else inc A_i by 18 {& r3 }9 D0 o, `1 j* p
    end/ Y8 d4 N0 U, o8 l# j: l
end; x( {# a" Q( Q# X
; M; `1 [  ^. g6 X' g
begin P_pick3 arriving
3 |+ O- P4 V$ N' r8 f+ l1 {    set A_i to 21
) b& I' |# k2 i: t8 [    move into Q_induct3
: C; Q- l" t' A" z+ P  ?! c    move into pickaisle.induct3
8 \) Y7 z. H2 b$ ]& ]( J/ z    while A_i<=30 do begin
7 v1 d) D5 ]: E3 V, ]        travel to pickaisle.con(A_i)  l; L4 p! I( V+ D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 r, s% k4 S% ?- Y' S+ \
        else wait for 10 sec
0 ~5 o, G  C$ q( y3 r/ o        if A_i=A_leave then send to die. h0 t$ d) E8 z$ r2 }  F/ F" V: Q) n
        else inc A_i by 1  Q3 E! W' _/ D4 M1 W( m' Y
    end. I; `- m5 a- {3 `. X, R! C1 c
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是个什么东东?
  H# Z9 I' {* c( ^6 Q5 ~: d2 Xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, A; R4 |! `6 M: g5 |8 P
# h4 i/ s9 k; F& yAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 R5 p7 P" z9 ^& e
) Z9 P& r1 U$ c另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:1 x2 F, X/ d+ E6 t7 _! `
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ ?# q* y3 H7 P/ ~  O* e
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
' i; D0 d* j- _6 v) B% f* `3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
) {; y8 L: V: O  h7 C* i6 Pbegin P_induction arriving) M3 l3 l3 k& D' F
    clone 1 load to P_pick(A_induct)
7 v: D6 Y  M8 l9 A# W+ b5 g1 _end最大的系. R$ k, B% ?) z/ A$ y- O6 _
; c2 [% l; A1 Z4 O2 R0 M
begin P_pick arriving
6 ?% o9 N3 M$ Y/ t1 G    set A_i to procindex * 10 + 1
& \8 q6 m% _" u: a7 v+ @    move into Q_induct(procindex)6 ~" j8 M$ P, F) B" J/ l
    move into pickaisle.induct(procindex)8 ]) c# ]% K6 @3 ^0 R
    /*check the type of pickaisle.induct(i), for your last problem.*/, h" U6 S2 J3 x& [1 f1 \; a

2 t( s- P# H4 Y" q4 V8 V    while A_i<=30 do begin/ E7 y. J) L2 L0 t% E
        travel to pickaisle.con(A_i)/ w6 X2 @# g& L. R, ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ c2 c3 d! N( w5 ?1 F- T4 r; Q
        else wait for 10 sec( |1 c8 i7 n: t: b& V
        if A_i=A_leave then send to die
" }  \' L- f( P2 J: K/ C6 b        else inc A_i by 1
, `3 h; d. d/ P! L5 B/ U( h. D. i7 z    end
7 K. ?. B9 J6 D% _* y! s/ Yend
0 h$ N# L& N: J: Z% N6 I4 m5 Q" h9 N" M3 ]+ C; j
其中的procindex为整形,代表当前process的序号。
4 H: ]% r) ?% M6 ]2 [! Hstation和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, 2025-11-2 19:59 , Processed in 0.019210 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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