设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13943|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" j+ Q* H" E0 i8 C$ p6 f7 i& u
. l" @. P: b% m7 C) 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中的数值,不知道会不会有什么不妥。, ^6 g0 r5 M6 I7 d! w$ S
, \  q' @0 q; J$ u0 r' ]; J
begin P_read arriving
5 O5 N4 b+ j- ^# W4 ?9 s* W4 f    while 1=1 do begin
. J; R! b2 I9 }/ A7 f; F$ v! d        read A_tote from "data.txt" with delimiter "\n"
5 q# Z! w7 Z3 @        read A_time from "data.txt" with delimiter "\n"" |, X7 l7 F+ a7 O5 I/ v+ }
        read A_leave from "data.txt" with delimiter "\n"7 s" e* [: {/ W1 I
        read A_picks from "data.txt" with delimiter "\n"
; X" E- |7 ]5 o5 S! F9 B) g        set load type to A_tote0 T+ o! K7 B! Q1 w
        if A_tote="tote 1" then set A_induct to 13 B4 s) I0 Q8 _1 z8 r3 Z  V0 }" D% O
        else if A_tote="tote 2" then set A_induct to 21 M4 `: f0 q& k' a/ x" M, l% [: F9 ^
            else set A_induct to 3    & J! }$ g8 @9 E2 @
        set A_i to 0
( E% A  G+ ]* [2 |! U        clone 1 load to P_induction1 _2 B2 F8 q6 v' j; F8 \, T$ M
        wait for A_time sec
1 Y3 h' H# \# L& w3 X* r    end& i, Z/ e8 D! ~. t# j- A  s/ u/ L
end- }( ]- ~% O! e
* ~: y! R2 f8 E! [7 K( u5 M
begin P_induction arriving
6 F, K. E+ W, U( R    if A_induct=1 then clone 1 load to P_pick1* ]4 Y2 n- O; c( p+ O9 U
    else if A_induct=2 then clone 1 load to P_pick2
  f9 v4 N- R  [! T, l        else clone 1 load to P_pick3
+ `3 v# F( F1 Y7 oend) F( \, |- ]* K$ R( a! D8 o
. D! v  `- }5 y* C" e9 {( x
begin P_pick1 arriving1 r# k( x6 X5 ~3 A
    set A_i to 1
* ~- C) \& k/ H/ \2 ]6 J    move into Q_induct1/ n  ?( W  C2 b0 [% \6 E) S
    move into pickaisle.induct1! ]5 b5 [7 o7 I0 c
    while A_i<=30 do begin2 ~: E) E3 r2 L
        travel to pickaisle.con(A_i)
9 Q0 f$ ~; X3 [+ V5 I) B8 n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( S' b+ s$ B# c. }7 k, i8 d% b        else wait for 10 sec
* d+ }; t4 E# r& F        if A_i=A_leave then send to die
3 T) D2 g: z* Q9 L/ s6 b2 b' t        else inc A_i by 1
+ m( J( [; H, m! ]0 F    end
1 n% S& Y" ?( H4 k- a# pend7 D+ q( U4 c$ r, z
' j4 K  O$ U! p8 E8 Y. N
begin P_pick2 arriving
/ w# U) W3 K  J5 }    set A_i to 11
9 t3 Q+ t/ Q* ?7 X/ c4 c, t    move into Q_induct2
5 e2 Y# K) Y5 s; l6 c1 A    move into pickaisle.induct2/ ?- R1 {' C9 v; g/ M9 o- v2 l
    while A_i<=30 do begin7 o' z5 U: Z" l. n; P5 F4 [6 E
        travel to pickaisle.con(A_i)
/ [/ {9 a- l$ i( q7 Y+ S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, ]7 V5 W. n- }  h% p- P2 c' ^2 i7 o' _        else wait for 10 sec
) k" H; c: r7 B1 `6 }        if A_i=A_leave then send to die
- H$ r3 {1 J' z$ |0 `* n, j* u        else inc A_i by 1) @$ @& l& b( g9 z
    end* N! L0 E1 k+ t
end
: N2 m0 ~' M' e9 u$ `6 F) \' D& @# I! r8 O' L  U3 V
begin P_pick3 arriving
. @. \4 T( l( |9 d0 D! i    set A_i to 21
9 E5 |' E  d6 F6 X7 \9 \    move into Q_induct3
# h$ f& u+ Y: B/ I8 z# r; i    move into pickaisle.induct3
' X8 @5 N" R7 f& d    while A_i<=30 do begin6 Q' m0 X. V/ ^* m! l
        travel to pickaisle.con(A_i)
9 C% m2 Q$ M& T" s6 _' M3 \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ T, H. h# S: j/ ]9 u9 B) P0 b        else wait for 10 sec
: R( T  @# W& ^8 @: n        if A_i=A_leave then send to die
7 r6 P+ Y4 c. M. Y1 R        else inc A_i by 1
8 L5 _9 {$ e3 h) D    end
' `2 g. e$ m4 a0 t8 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是个什么东东?1 ], K5 m4 z  v3 g! q
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?. w5 U1 E: S1 O5 Y' X

4 i* ~3 R% ?5 H7 c  P/ b( G' TAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。# F7 c% E0 h: w) g* o+ e( j2 R
2 z, E& f- L* a2 [4 u1 T
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 w3 N# L# `, O$ Z; }
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 {/ t0 E" L9 E5 R2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;; v! c$ S9 |1 K
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:& f+ W8 C3 r7 r- S0 f/ X
begin P_induction arriving
5 g4 d3 h' B% `; |6 A, ]5 U4 T    clone 1 load to P_pick(A_induct)4 n2 {8 ?1 ~4 h' y
end最大的系
  Z2 c, E8 Q. o8 M0 Y' ^5 ]( k& }9 Y0 q6 f* f* B
begin P_pick arriving# g0 s* I0 G. l" Z9 D. z
    set A_i to procindex * 10 + 1
6 u9 w/ u4 N1 K  a' W: E( O; C" q    move into Q_induct(procindex); f6 A/ ^( q: U. ~$ M: k6 O
    move into pickaisle.induct(procindex)  r7 v0 e; l6 s% S: K
    /*check the type of pickaisle.induct(i), for your last problem.*/# F( d# ~' l% Z; H. V- K- M/ b
. V. ?( w- S3 f! h5 ?$ s
    while A_i<=30 do begin
$ ?+ O( c6 F/ |) e9 _" o# E        travel to pickaisle.con(A_i)
. u+ `; `& Z7 w+ r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: n* k" l) V+ f        else wait for 10 sec
' ^  N8 _% z! W        if A_i=A_leave then send to die9 \0 ~  B; H$ v( E5 k
        else inc A_i by 1
8 E0 J& L  c" T) d( P# w    end4 ?, ~7 L7 c% N8 m. e* R
end: I( b! J/ H# c, a
4 Y0 X+ }6 c4 Q9 a8 L4 ?
其中的procindex为整形,代表当前process的序号。  s. U* ]2 C# f: X' k
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-5-21 21:31 , Processed in 0.017516 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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