设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14617|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 ~* y* e0 z3 I# t# a
, G- w. M5 L4 u/ D4 U* z我的问题是,在每个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中的数值,不知道会不会有什么不妥。) z' l) M, k6 Z4 u7 A# {

0 X1 ^  ]1 P4 i0 A3 [begin P_read arriving9 Y; h% s8 y( u# z9 F  l: ^2 S9 o
    while 1=1 do begin
# Y; a% ~& T4 H        read A_tote from "data.txt" with delimiter "\n"
) }/ x% L6 r$ X* s% r( f6 K2 e        read A_time from "data.txt" with delimiter "\n"
8 F: J: f( B3 L6 v8 X  U4 r/ ^" d        read A_leave from "data.txt" with delimiter "\n": s* m& @2 C) \5 r( P  D1 M7 V
        read A_picks from "data.txt" with delimiter "\n"2 d' N  y: O! g7 h
        set load type to A_tote4 \) a1 p! [( Y  D( t7 h: i
        if A_tote="tote 1" then set A_induct to 1, \0 w. X/ y3 W. O( m& n/ ^4 d9 v
        else if A_tote="tote 2" then set A_induct to 28 H( L7 a8 Y" a- G) h- f0 e
            else set A_induct to 3   
0 z5 l* X9 W' j# g) h1 M' b& J* q        set A_i to 0, U$ N( L& ]3 e( |6 ]
        clone 1 load to P_induction
4 I0 X( V# }& Z; F$ Q* G        wait for A_time sec
# O0 u! A6 c' F: o6 c+ W* `    end+ b! S. v7 f" H5 D5 L5 x
end
1 `0 d4 k/ U; _. u3 R9 H( ?5 o
9 O0 X$ K/ {) K. {1 g1 h5 Gbegin P_induction arriving
. i. x- |; L, m* n: A    if A_induct=1 then clone 1 load to P_pick1
( \7 Z9 o9 Z3 W  A% X6 j1 q1 N8 Q    else if A_induct=2 then clone 1 load to P_pick2" B$ e1 ?, U+ V# B2 c& ^2 }: ~8 O
        else clone 1 load to P_pick3
' D4 _  X6 \+ B1 @' K  {, ~end# r, F  ]7 o! S8 R# o5 Z8 X
, B* O6 @' |! [5 Y$ l" z
begin P_pick1 arriving
0 W3 h0 ^6 v3 I/ D0 N    set A_i to 1
8 G" M1 o) O" Y) R    move into Q_induct17 h* f0 [9 T8 T5 H  q3 E( q
    move into pickaisle.induct13 s6 l- [( |- B: I2 d9 I. v
    while A_i<=30 do begin
! ]: t+ T  y/ o. l        travel to pickaisle.con(A_i)! t/ a8 X3 t  A' Z6 q, ~- \4 h) F0 i0 Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 U+ Y8 @: c; y) B5 I5 ^5 Q
        else wait for 10 sec
& c& y, a6 H# J* X  x        if A_i=A_leave then send to die# ~! Y. r2 {7 {/ X
        else inc A_i by 1  P$ G$ [' J' l2 s' E' X
    end) f* b9 F# d6 b# T
end3 p) ?& y; l2 a/ B) z! j2 f

/ }1 S$ }$ M# B' p( Bbegin P_pick2 arriving* E( {. [2 O' ?" U" I
    set A_i to 11
9 M9 W2 U# |. s' r+ g+ }    move into Q_induct2& z" G: x0 Z) U
    move into pickaisle.induct2: O4 q: b, X3 q& @, P5 O1 \
    while A_i<=30 do begin% T, r* d9 _( T
        travel to pickaisle.con(A_i)
( K/ L8 X* U# T2 |: F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 d/ j1 e; Z) H6 D5 W! Q3 v3 k        else wait for 10 sec
1 q# A) m; D) @$ b7 h# w        if A_i=A_leave then send to die& U) ^+ c: m3 Q1 V. W) U' q' p
        else inc A_i by 1/ G% i" s, z6 K$ Z- |# X
    end6 ]4 J, h  p0 E
end, [6 w5 U4 t+ l& K: I
" a: v# j1 d& |( @/ s
begin P_pick3 arriving; {8 n; |+ W/ q4 [( E2 [& n( [
    set A_i to 21
. V2 X, L: j' z    move into Q_induct3
. `7 H- I. V! h    move into pickaisle.induct3
2 I9 K2 N& o4 B% }4 h* c# \    while A_i<=30 do begin8 s7 I8 {* W* Q) u' q0 w
        travel to pickaisle.con(A_i)
1 k- \; n' @( {, L0 h0 W; [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' V6 E5 f0 ~3 l' i1 E* @
        else wait for 10 sec/ L) r6 w# p3 R2 O( ~% F
        if A_i=A_leave then send to die( E) d# X7 F9 l2 L. b$ {1 ]" k& E
        else inc A_i by 15 n6 ]: n. F/ C2 k# `3 i
    end, g. ?) J, H- `$ x% X% f
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是个什么东东?
% R2 ~& Y  ^- ?7 m7 Emove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! k, L7 R1 q4 K! b  D: k/ f4 {

9 `( e; f  h  D  F* MAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) G7 O4 S6 ~- c% a+ B

9 u+ I/ l( z& l0 \另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 j, v9 h/ S7 t9 o: C
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;" T! I( J7 a6 l3 m. z1 d
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' N- }3 \) X% [" Q
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
# Q% p3 ^& n; ]" w/ Abegin P_induction arriving
" O; w7 D$ Q* m: D    clone 1 load to P_pick(A_induct)9 n* d4 B6 t: G# F1 }
end最大的系2 ?- {; q: T, f9 l5 s
0 q4 g, c% d/ g: j- `
begin P_pick arriving
4 e9 u$ G5 D/ l: z  I% `4 Q    set A_i to procindex * 10 + 1
% l2 ?6 l5 c; j    move into Q_induct(procindex)
2 U4 ^: t& T; a9 E  q: v    move into pickaisle.induct(procindex)
& @7 F8 |- G# L6 T" P# Q    /*check the type of pickaisle.induct(i), for your last problem.*/
  R8 W, ~( `# c4 I9 m7 B/ c# ^/ S0 F5 b
    while A_i<=30 do begin
) @! G; D1 r0 x( d, V( S& \& G+ o        travel to pickaisle.con(A_i)
( w- Q/ W7 B3 e: k# O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% G8 c: L" v7 l6 o+ [  w        else wait for 10 sec
0 Y0 C7 u' E4 l) O/ E        if A_i=A_leave then send to die
0 I. a6 Z& l, P' d        else inc A_i by 17 x/ j' \* A; o! W4 G( z
    end
) Y( \9 ]  ~. `5 A# l: x9 i" D/ Gend6 f1 x( h# e0 ]9 ]
1 f5 |7 \! Y) e' i( q$ X
其中的procindex为整形,代表当前process的序号。, V% m% K$ e% Z. `; ?8 D2 j
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-7-18 16:07 , Processed in 0.014478 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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