设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9805|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, G  |5 M3 R' H( n
' o& c' [! l5 E' H
我的问题是,在每个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中的数值,不知道会不会有什么不妥。# H6 z9 t9 k" L) q6 _
0 R' o) Q* V) h, s! @
begin P_read arriving0 y8 |: I% i) h1 C
    while 1=1 do begin/ ^2 z/ y) `1 N8 A& Y9 P( z4 r
        read A_tote from "data.txt" with delimiter "\n"1 A6 a: G& t- b8 m2 b
        read A_time from "data.txt" with delimiter "\n"$ f! E6 v, A. ~; s% D- l
        read A_leave from "data.txt" with delimiter "\n"0 Q! b. a. _0 M2 t- V5 i2 Q
        read A_picks from "data.txt" with delimiter "\n"
) `9 M3 r6 D- G8 L0 t' K4 U- T        set load type to A_tote) \' J" j3 r# P* m8 k2 t
        if A_tote="tote 1" then set A_induct to 12 b  A6 G5 l7 a' Z' C! e
        else if A_tote="tote 2" then set A_induct to 27 X5 m0 \8 l9 V  A5 q- x
            else set A_induct to 3   
2 G- z" h4 L) w9 z        set A_i to 02 x( c6 Y; c6 i1 J3 s; s
        clone 1 load to P_induction  o  b9 [) {2 K7 _$ s
        wait for A_time sec
* [8 O0 ~% W. Q" X    end- x& T( k( d6 M
end
9 [& d: L& V: l' A5 G$ F8 U2 L: G: ^! n
begin P_induction arriving- W4 T) v# d% t$ V  j4 o  c& d
    if A_induct=1 then clone 1 load to P_pick10 K. y/ C2 I: Z. t! ?
    else if A_induct=2 then clone 1 load to P_pick28 p  Z- y, O+ }, S8 t2 _! ?- B
        else clone 1 load to P_pick33 F; J" ~( p) F4 N0 y4 A% a
end7 k1 f8 s/ Y# F! U
+ z# J9 h2 t* V% d; {$ o, s6 K) ~
begin P_pick1 arriving' g7 w3 o- t  c) U% @
    set A_i to 1
5 u3 W; g/ E5 |% m! N    move into Q_induct1+ k1 E8 g( t# p8 n4 V/ b
    move into pickaisle.induct1) |5 t  G6 Y) {  S+ U
    while A_i<=30 do begin. O; G1 k5 x$ R
        travel to pickaisle.con(A_i)$ S- t3 V+ k0 Y* ]# G4 y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ o! n; n$ [; @; L; P& J' w
        else wait for 10 sec
6 w  P! t' M% H        if A_i=A_leave then send to die/ C. d8 m& O' W2 T* q, ?
        else inc A_i by 10 G' W8 g' Z6 W8 b' f
    end6 F7 s  B4 O, ]9 A; u6 c3 V8 y) K- ~
end
# Z# ~6 f0 k# W# v" e6 [* g) Q4 J
begin P_pick2 arriving
0 B4 x' V6 i4 ]. F. B+ J( D1 H    set A_i to 11
* L* v0 f" k2 U    move into Q_induct2
7 W* a; B2 o' _* V" Y    move into pickaisle.induct2
# V" |% d) M& B2 X4 P    while A_i<=30 do begin+ F, r, R  n+ a
        travel to pickaisle.con(A_i)
7 B% u5 d: v6 D% |8 c* h) l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- {0 |4 ~1 _% K$ a( a/ u# E        else wait for 10 sec
8 _; o; I8 K, }) R  Y        if A_i=A_leave then send to die
# W0 u2 J! k( _7 n5 h        else inc A_i by 1
" k# Z8 r: E) H' ]6 U$ a; c% Q& V    end
- N! v) a" o" Y0 Eend
: H+ R1 d0 `9 m& V$ o$ g( {, d0 ?/ Y9 q' f8 w
begin P_pick3 arriving
% w, |% `! K; d- D% c2 F    set A_i to 21
8 k8 w4 I$ O; Y  a- C3 H    move into Q_induct3
7 w5 l) G5 i* ~+ ^+ G: H    move into pickaisle.induct3
9 I7 |2 c, }% T& D, H0 w    while A_i<=30 do begin5 `3 F0 J2 Q& K
        travel to pickaisle.con(A_i)4 Y3 W3 F( e( r9 _! V" T9 L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 [* V& Z3 B3 j# K- S' L        else wait for 10 sec
6 G& O9 F7 i; S. ]) q8 o% B        if A_i=A_leave then send to die$ ^7 t9 v9 `# I+ \9 F
        else inc A_i by 19 t9 G' `5 W1 d2 a3 s# Y* s# u
    end  J2 H" Z) i" o. j2 o$ S' ^
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是个什么东东?
- F3 E/ y( e6 o+ smove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ a/ y- A0 o, m7 f9 f) Z+ ]/ \$ E% X" f$ C, E2 M! b
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。! v1 ^# w' t& }+ ]# v7 I

3 a$ l) {1 }+ E# d8 i; ^另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:* q2 W3 _) \  [$ N5 S, e
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;8 Y, u6 t6 o/ v
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" F4 z. @0 z( M& E- D, W" G' l% r3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- B. U9 W1 R# n. g% j7 Y
begin P_induction arriving7 N+ A. w* }: e* f
    clone 1 load to P_pick(A_induct)4 q- S4 H4 ]" x
end最大的系
2 h! m- Y& @" h
. u- Y: n4 r5 b1 Q, _. s- }begin P_pick arriving" @; R8 I% c6 U3 ?" N+ ?; k. j
    set A_i to procindex * 10 + 1
" j! v5 I9 s. z) G7 O1 p0 F2 t  v    move into Q_induct(procindex)) t% K9 B) P; Q* y
    move into pickaisle.induct(procindex)
0 J7 v0 _: S% s! d  R! \# X    /*check the type of pickaisle.induct(i), for your last problem.*/8 w9 F  y+ G* a& `
0 l2 f, _/ n" U; {+ u' o: p8 B& ~7 r* A
    while A_i<=30 do begin
4 P  x" o0 I3 P" Q6 a- U        travel to pickaisle.con(A_i)# l+ k! s: a4 a* P! o# s, Z+ X4 y$ w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 `9 t* S( h4 y5 ~, t# X, `/ y  Y9 U
        else wait for 10 sec* X. e3 T2 z; l: f% c; s+ q. X0 `
        if A_i=A_leave then send to die
- y" N% T, m- g  O: Z! d8 K        else inc A_i by 1
' R$ l! `% u% U7 Q3 i. [% a    end& M  ]7 ^* S* N; c
end) @7 n% x. V0 h% f! f/ X! Y5 c$ H
9 r$ l; w! ?8 p( I
其中的procindex为整形,代表当前process的序号。
! J8 t+ s& e. I+ \) 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, 2025-7-6 07:58 , Processed in 0.012564 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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