设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12983|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 }1 I) ^/ ^- Y7 Z; V
% z- Y% h$ h# u0 e/ A我的问题是,在每个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中的数值,不知道会不会有什么不妥。! O% z. E4 N' s
4 U& U8 A% r# G( }
begin P_read arriving& w2 P( s- o# S' G% C* i1 M
    while 1=1 do begin
& }4 i+ n1 X' n        read A_tote from "data.txt" with delimiter "\n"; Q3 m7 [  c  \3 [+ ?% [2 E: ]
        read A_time from "data.txt" with delimiter "\n"
' g( i" Q/ N/ M: y  v* w: j' ^' V: d        read A_leave from "data.txt" with delimiter "\n"2 u: e8 `2 Q% ?% o- w  R
        read A_picks from "data.txt" with delimiter "\n"
* E* G# [' ?0 |7 q        set load type to A_tote
; Q& E0 W+ X4 K0 `- ]1 r        if A_tote="tote 1" then set A_induct to 1
) R1 ?- V' \2 L$ @! P; G# z$ B9 a9 T        else if A_tote="tote 2" then set A_induct to 2
- B% _+ _( w, s4 Z  v            else set A_induct to 3    , k$ A9 v8 }! Y; c. U: N2 _
        set A_i to 0
/ h- v9 a: Z0 G& O        clone 1 load to P_induction2 ^1 R; x' k) Y8 f1 w
        wait for A_time sec
9 ]6 \; U6 U5 V. C. H    end
1 Z' k1 R, Z8 G1 _9 T$ R3 @end
0 M- t+ K* X. V$ X4 o4 u3 |% H# U" t4 Y& t4 [" k4 n: I
begin P_induction arriving* X& s4 i( Z3 r2 c2 P
    if A_induct=1 then clone 1 load to P_pick1. O; X0 ?0 r; H' y) I
    else if A_induct=2 then clone 1 load to P_pick2
+ e9 V" O+ M5 m- i" p        else clone 1 load to P_pick3% @1 y$ w6 H8 b5 i9 k- G* M. \
end
& t7 Y4 R9 V/ O' n: [; o4 |7 l1 r2 _+ r! @
begin P_pick1 arriving
6 t; u4 ^% f9 e2 L    set A_i to 1
) W8 Q/ A( w+ ^6 T- D7 j5 H6 K9 j# {    move into Q_induct1
5 o" K; q9 f, x8 _    move into pickaisle.induct1
8 H. {0 k9 y- R( @2 c8 W0 e& W    while A_i<=30 do begin( G* o! x7 H! b6 w0 |% U
        travel to pickaisle.con(A_i)
  `5 Y3 {8 |4 k( Z7 ~! u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 [% ]& Y" X; [4 ?# a        else wait for 10 sec8 Q, @7 u" F$ W4 c- m0 P
        if A_i=A_leave then send to die, e8 m( L6 U4 ^8 J0 W
        else inc A_i by 1, a% i- u% O% _9 G& V; l+ c, J
    end
7 ^& p$ R# z, p1 W6 Iend: V2 ]1 I& Y- E) O
0 I0 `, }) {. i
begin P_pick2 arriving
4 B2 N% M. X; u/ }3 z    set A_i to 11
, c& ]: {4 ^  n2 t# ^7 p& e9 n    move into Q_induct2) W2 }4 H5 r) d6 G- G- R
    move into pickaisle.induct2
1 @8 k+ O% @, n; Y    while A_i<=30 do begin
! f. L( @5 ^/ ^% R1 l* f" t        travel to pickaisle.con(A_i)0 D7 f3 }( w' g/ N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" g0 n" F5 [8 H  M8 x+ c
        else wait for 10 sec8 F7 C. y5 F* p
        if A_i=A_leave then send to die
9 s' r4 _; j7 w& x4 X: \        else inc A_i by 1) K' @9 j3 d; d* [- [
    end
% d7 O% T( y" Yend
- K/ I5 D( r$ |) R3 n9 j$ h4 n& [: @2 B/ b1 v1 u) E' [( e
begin P_pick3 arriving7 E% x: g* l( Z) b
    set A_i to 214 L1 v+ P0 T' G
    move into Q_induct3
7 F8 }5 S8 u5 S+ v$ H; N    move into pickaisle.induct3
2 G/ R* k; X' X! @    while A_i<=30 do begin* V2 v+ {2 x3 y5 L2 ?: k5 [8 E
        travel to pickaisle.con(A_i)
( O# Z5 I* t( ~9 q* C! V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' s( y# u9 p" g1 _* x% F
        else wait for 10 sec: f( _- }: h& B& r% \; H8 b1 t
        if A_i=A_leave then send to die
0 U: ]) x5 }9 p6 @, V( z& t        else inc A_i by 1! [: y8 P# Q: e5 C( y
    end
8 v/ h( Y+ A, P. {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是个什么东东?
3 S" q" a9 o" m$ f+ x( A! N6 ^* imove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?/ q+ q* H' F& E' _' F8 a+ `

+ L8 h$ J# d' C: O) HAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
3 s$ s& r, L' z  z. ~; g
, W6 y8 r6 U& T) |' s5 Z0 n. E另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
) R8 g! k) U3 ?. `6 [  [1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;- J# q8 H" h9 ]$ c% O+ |
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 l9 F% Y9 i( h) Z" \3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:& A8 X+ a; x1 ^5 [/ S
begin P_induction arriving, s9 V) {& O& Y5 S  N
    clone 1 load to P_pick(A_induct)$ C$ F2 L) v1 s0 Y4 W3 H
end最大的系) s: |: U. _2 n$ b' Z

: N, ?" v1 y1 L: m8 [& nbegin P_pick arriving
! F$ T  _$ i9 G7 e7 ~8 e# K  o    set A_i to procindex * 10 + 1
& U' S) V* A+ b    move into Q_induct(procindex)
2 S8 z& U' q4 m1 g& a* x2 Q; W    move into pickaisle.induct(procindex)
  _! W% r( [" G4 V7 H4 ?' B5 D; \. u9 C    /*check the type of pickaisle.induct(i), for your last problem.*/
8 F0 z# I. ?1 r' B8 C- F: i7 e* a& L- o" V- O; m/ I& P* C5 \! p. f
    while A_i<=30 do begin" @$ z. H, x8 ]9 z; o+ o# u) _
        travel to pickaisle.con(A_i)
0 Q' c  `, p/ q  Z. ]  j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: _6 M5 u( D) ~5 l5 p/ _        else wait for 10 sec* s7 w& X+ e$ `- K6 i# m5 n
        if A_i=A_leave then send to die3 ^: b7 p1 h1 M4 b7 X# _; d8 z
        else inc A_i by 10 C; d/ v+ G( N) E
    end# H) ~7 ]8 j2 [+ M
end
6 X5 n1 d8 ]! A& t
' Y; b, K% ^; o) M- x) W* m其中的procindex为整形,代表当前process的序号。2 z- ~" a! ^: ^# Q
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-3-7 18:39 , Processed in 0.017565 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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