设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15171|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 d2 ^8 k- F2 c# g! L4 y8 G
5 g/ w, _/ r, D" h; ]. v$ x7 _我的问题是,在每个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中的数值,不知道会不会有什么不妥。
  I5 U1 |2 y; y! Q+ G/ S- l( r% n, a( V; R4 t: I
begin P_read arriving$ D0 g/ m  a& G* n, a, O
    while 1=1 do begin
4 @! v& y8 W8 o5 ?+ C8 h        read A_tote from "data.txt" with delimiter "\n"
/ B9 w, t( u$ H: O4 r/ K: L! a        read A_time from "data.txt" with delimiter "\n"$ @0 z/ j2 e7 a/ B' C) m
        read A_leave from "data.txt" with delimiter "\n"3 }0 r, b) B( r+ n3 u1 {
        read A_picks from "data.txt" with delimiter "\n"( M2 D6 D2 p: [2 |2 C
        set load type to A_tote
! m  X- l+ V0 B" f2 H- n! r3 S( o        if A_tote="tote 1" then set A_induct to 14 v# U# Q# m9 }: q  G9 M& s
        else if A_tote="tote 2" then set A_induct to 2
) p9 |! X- ^, C" W9 S) G& |; v            else set A_induct to 3   
* D" p6 l9 C/ P. D+ X8 P        set A_i to 0- Q8 f7 C9 J; Z0 d" I3 r
        clone 1 load to P_induction
9 w, o1 i. I: g' l2 h4 O- q; g: u$ [        wait for A_time sec
- o' Z$ s! N) ]/ [. k    end
+ G* x1 G- e6 H4 _6 A" xend% `; L9 i/ V$ p! c

" u4 h, g; d4 I  \+ a4 V# `, Bbegin P_induction arriving
% X/ M7 `7 W7 K$ O* w6 ?+ R$ M    if A_induct=1 then clone 1 load to P_pick1. P9 {& K1 c4 t: N7 t( h6 E
    else if A_induct=2 then clone 1 load to P_pick2) J5 O/ ?& Q* C9 ?1 {
        else clone 1 load to P_pick3
( _  }  Z  s5 P; mend- i# z: Q, T% K! Q0 O1 ~8 f  s4 U

! I( x: }' c- {& D( }: Sbegin P_pick1 arriving
8 A) L# g$ i2 }8 \    set A_i to 1# Z/ g8 N6 J3 I2 o9 U" R0 t
    move into Q_induct11 H9 e! T( }6 E5 g: U6 r
    move into pickaisle.induct1$ n% ^8 G  \4 v+ x& W+ c1 _: O& Y
    while A_i<=30 do begin& J0 p7 H2 [: g* Y  I
        travel to pickaisle.con(A_i)
- c6 Q  S4 D6 `) X* J. z' ~8 K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# u) L6 i5 [' k# ^$ D
        else wait for 10 sec& t! `% E8 ~0 L6 c' R* V
        if A_i=A_leave then send to die
1 x2 \$ s' }3 T7 L* Z# J# O        else inc A_i by 1
/ q  y( U7 S: L# \! s  f, q3 o5 ^- A9 U    end
! ~% I! K4 u7 t% g( f& u) q( [6 Eend/ m% `& q6 e4 Y3 ?

7 i" b! O( ]' ?3 ]8 w# t- v3 L9 A( `begin P_pick2 arriving: `' w$ N* z3 \; _4 w# x1 G
    set A_i to 11% x8 O9 G% R: I3 F  R6 s
    move into Q_induct23 F6 V) Z" a5 g. ~3 L
    move into pickaisle.induct2
' r* }$ N. {2 _; S  a( E    while A_i<=30 do begin
: e& C1 x; d, l        travel to pickaisle.con(A_i)
% Q7 `& T& D% X6 g1 G9 n# k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% Y  v7 E3 c, X2 }" I  v. @        else wait for 10 sec
& G$ S5 l2 b  j& T( u8 `        if A_i=A_leave then send to die
# n* }) c7 z2 a        else inc A_i by 1! @9 L4 e% ^) ^( H1 a& J1 i8 L
    end/ n$ u# N7 }  U+ x4 W
end
8 e2 w5 p5 j  Q( j+ ]6 O% |, g, `  u
begin P_pick3 arriving
. }+ o# P3 ?- X" Y" k& g  `) y    set A_i to 21
% }+ C7 y/ d& e3 b* ]; _* O' I8 l    move into Q_induct36 D( ]5 @& H+ T6 }* O' Q
    move into pickaisle.induct3
- y! {) x9 z8 Z# t    while A_i<=30 do begin
7 }) ?! C. X1 v. I# M  z9 T$ k0 v        travel to pickaisle.con(A_i)( N0 T" h  Y" O" [( q$ ]7 m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ _% l7 |/ d" K* P% Q
        else wait for 10 sec
- @5 M4 `: d" v        if A_i=A_leave then send to die
7 u4 T/ _( i  {4 h3 }        else inc A_i by 1
' C) l  P: ?6 C6 r5 }+ x' P    end: b" c  Q# }( n. O
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是个什么东东?
6 M5 D, j2 b; \8 T/ cmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?. n6 O6 a2 v7 F; h0 d' g& Z

( S; n* r6 w+ }; PAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。* b6 b  T, l8 o" R, N" V+ T

" }: ]& k. W0 F另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:+ H6 [3 K4 P8 O6 F: N. g% w
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. h5 p# ?; U4 C% L; [2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
3 A6 W$ r' f: `$ q/ \& `3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
6 N$ V* W+ a: W- kbegin P_induction arriving, h1 b5 y. K/ J
    clone 1 load to P_pick(A_induct)/ l; Z. m7 s2 _( e4 h+ m- L
end最大的系2 Q0 w* B5 b# f+ m3 t- ~7 ~% t
& {$ w1 Q) \/ W% P. I% R
begin P_pick arriving+ O# T0 C: a- G# W  O1 Q) @- _
    set A_i to procindex * 10 + 1* q9 H0 `2 Y4 S2 G
    move into Q_induct(procindex)
' e( b8 {2 T6 A, W    move into pickaisle.induct(procindex)
! R; V/ u1 E- e; K  }- a: W& q    /*check the type of pickaisle.induct(i), for your last problem.*/
  I/ i* v1 l% N4 K" V8 z' g  H3 h
$ _( {: x4 N4 P. }, t) U9 o    while A_i<=30 do begin$ C1 ]! p4 }% B' ^, E% h
        travel to pickaisle.con(A_i)
0 J' K* k, _* Y7 a: Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ o+ D& A4 }. p
        else wait for 10 sec5 [2 I1 ~0 l4 ]; p1 a% ?/ n
        if A_i=A_leave then send to die  @  p9 t( l' E" |+ \* x& X$ {
        else inc A_i by 13 G1 a. _% Y. h% W: D4 E$ M+ K& A
    end
; N; m! a$ X. J1 }3 T/ wend
1 ^8 |; A/ L1 y1 Q/ e# M4 I9 ~
* @% _+ n3 T! y  D& R其中的procindex为整形,代表当前process的序号。
. w& g+ O6 F; j8 \1 bstation和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-8-19 09:43 , Processed in 0.014834 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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