设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13105|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' v( d% I$ H) I9 Z8 |* O% f
0 U  e+ e3 {" X. J4 [$ B
我的问题是,在每个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中的数值,不知道会不会有什么不妥。( J2 X: K( m9 T( n4 X1 D4 Y$ h/ K

3 _! Y9 q1 ?# _& @) |9 o# Xbegin P_read arriving
- A1 O6 K* z; v% i' @8 a8 H* j5 `    while 1=1 do begin& }* S8 i" E! x8 T
        read A_tote from "data.txt" with delimiter "\n"4 F4 `; n, s, ~% H  E- f9 h5 d
        read A_time from "data.txt" with delimiter "\n"# Z3 G! c6 M1 g3 D/ h6 r" K% o
        read A_leave from "data.txt" with delimiter "\n"
% z% e/ s% ^5 h% H2 B        read A_picks from "data.txt" with delimiter "\n"
6 R3 N, h) H+ C2 W, i) e! q        set load type to A_tote
# P# _$ Q  W0 \' |* x* [6 ]6 M        if A_tote="tote 1" then set A_induct to 1
8 V; l& [) p# S% T- I; @; c        else if A_tote="tote 2" then set A_induct to 2
/ k1 B+ Q- x, O1 h- V            else set A_induct to 3    1 g; @- A: q2 _! ]
        set A_i to 0) D( V' P: r5 n# U. i; r
        clone 1 load to P_induction
/ N6 L- _2 z& f* K& ?% }9 c4 Z# x$ l        wait for A_time sec
7 _7 w6 h+ A, B1 `& C- \    end$ U, y# u& C0 w9 n
end
6 G! }" c( ]2 ^: e) U( l6 E+ N: L, Q+ m* |
begin P_induction arriving' Y* N+ v) j9 A( X
    if A_induct=1 then clone 1 load to P_pick1
9 k- I" p$ s0 d2 [' t& }2 o    else if A_induct=2 then clone 1 load to P_pick2& L3 W3 R7 g& U3 o0 Z
        else clone 1 load to P_pick3* ]5 T" N6 H2 A: g- y* z( v* Q
end. @. t7 \+ `  O4 y% I. l" Y

! Q' D# l3 d& B1 D9 Y1 J- i2 \begin P_pick1 arriving/ @( Z$ w2 V6 W; Z+ R
    set A_i to 1, P- }4 N' ]1 g
    move into Q_induct1
5 v$ H" x2 r  U* Y/ @    move into pickaisle.induct1( k0 ], D4 j! J6 q2 {
    while A_i<=30 do begin
( t: r9 `" x6 J        travel to pickaisle.con(A_i)
' ?9 j6 n6 T7 B) u% W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 K3 X5 v+ V* v8 i$ B
        else wait for 10 sec/ z. [7 p/ M6 P( g' C
        if A_i=A_leave then send to die. u0 ?. \8 ]9 ]  M( J4 C, c3 @3 o
        else inc A_i by 1
! ^. M- [6 ~6 a+ H2 }  k* \. R    end1 _: z0 p5 ^* s6 D/ A( e: d
end' I4 I4 ]4 @  w0 J$ ?5 _: U
6 F7 m. X6 Y9 T) z! E" o
begin P_pick2 arriving2 T; [! R6 V! d; g, ?
    set A_i to 11) F' q: t, j% m; g9 k! q* Z
    move into Q_induct2" p$ e* @! M& p$ B+ R- `2 j$ @
    move into pickaisle.induct2
$ ~& A9 v7 ?; H    while A_i<=30 do begin. i# ~) D8 ~+ q
        travel to pickaisle.con(A_i)" {# d6 C1 s5 K6 O2 m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 x0 f) }4 U! U2 @% d8 P2 u" _" I
        else wait for 10 sec
; R8 }: V" _% G: x" b        if A_i=A_leave then send to die
% Q( m9 Z- F& L) Q4 A        else inc A_i by 1
7 j0 W" y; j" @0 K- I4 M    end2 U$ }. y0 {/ d+ G! R* t$ G2 @' Z
end2 z7 ^& A$ X7 m

; A+ n  f0 p2 [; |" ?0 Xbegin P_pick3 arriving% V2 b/ U- W2 @4 t8 J
    set A_i to 21# E* B4 V6 S. \- o; E' Y
    move into Q_induct36 h7 g& H  G# v% @! F
    move into pickaisle.induct3
; v1 s! P' D. |' p' _. w7 d    while A_i<=30 do begin: r! W( Q& `$ o1 u+ K3 f% z* [! Z
        travel to pickaisle.con(A_i)5 ]' Y7 `' n! ~4 ?1 _1 P( W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 |* G5 t, i3 K6 M4 H
        else wait for 10 sec
' D! P" R! e' f        if A_i=A_leave then send to die+ U) m$ M/ }$ |1 t8 |
        else inc A_i by 1
5 e6 R" y" l# z  k9 P' B, e+ a    end
. c& T  v2 {# |/ M7 K* |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是个什么东东?. I' u# o! A6 T+ x$ D  m
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
- u- W; v* `6 o- W! p" q! J' l; b
, h' [$ P8 {8 S! a' d% ^AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ m7 @8 h8 d0 E" G" f# N+ k
$ D- p4 [$ v2 i3 x8 o8 Z' Y
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 \/ x7 \' ]0 @: q3 `3 b
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# U: x1 H5 y& `/ n* _" z2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;, k& S2 x% ^2 D1 e$ v
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) D0 z. t+ C$ v: e3 w8 D
begin P_induction arriving" E8 R& |6 m& e+ H# v% c
    clone 1 load to P_pick(A_induct)
6 f0 ^' v+ Q4 N1 F) h# {( {end最大的系* t+ @7 g4 o  j5 U
3 ~4 N% v! `, d/ w9 T, O
begin P_pick arriving: j6 d( h1 D2 W; `$ T
    set A_i to procindex * 10 + 1
9 j7 l  {. h9 I: P    move into Q_induct(procindex)) U8 @, E4 B, f
    move into pickaisle.induct(procindex)
/ a- J& o! T- o/ B4 A# ^, L    /*check the type of pickaisle.induct(i), for your last problem.*/, v' M. _" R3 e  I

2 l& ]1 |1 e# q    while A_i<=30 do begin+ l  l- A" p+ \3 K: W- Z
        travel to pickaisle.con(A_i)
4 l6 g& m! p2 \* E2 G9 ~% ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, T* b  g6 X! s8 p: _: `: u
        else wait for 10 sec) F1 P4 f) e& m
        if A_i=A_leave then send to die9 [5 Q4 T# S8 T" T$ g2 L
        else inc A_i by 1* a5 k$ Z1 g( @3 j- S+ H% }
    end
# d4 g, {; P% F! r5 l0 B1 lend
$ d3 L5 c1 ?0 c- d
) l/ E+ [* s3 X/ `4 q其中的procindex为整形,代表当前process的序号。( a5 H! I* F) c0 O, j1 p* w
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-19 10:37 , Processed in 0.015702 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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