设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13686|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, ?" w* _/ y2 T/ q$ r; _$ @2 S9 \; t( i% N& V
我的问题是,在每个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中的数值,不知道会不会有什么不妥。: S; a: Z  m4 b6 n$ |2 u; l& K
; F& C4 S$ |. \3 P" N2 [5 W
begin P_read arriving/ P/ ~; Z! a6 W3 ?2 r+ l
    while 1=1 do begin
3 V0 V) N. d8 D0 B: c( W2 I        read A_tote from "data.txt" with delimiter "\n"
# s$ t' I# J7 l! J! t' m0 Z' d        read A_time from "data.txt" with delimiter "\n": {8 b, T: T0 J' ?0 v* a
        read A_leave from "data.txt" with delimiter "\n"# v6 E+ g# Y* Q
        read A_picks from "data.txt" with delimiter "\n"4 ~7 ]  h2 O  |# ~- M
        set load type to A_tote- I6 e! e# C0 r# G
        if A_tote="tote 1" then set A_induct to 1
, v1 k1 G) Z  M- ]5 J8 e        else if A_tote="tote 2" then set A_induct to 2- Q6 d; L2 u2 Z9 B8 s. n
            else set A_induct to 3   
  R. E5 [* w  p' ?; E        set A_i to 01 i; o1 B) S, r2 b2 ?. P
        clone 1 load to P_induction
# {7 O! i9 I/ Z2 ~        wait for A_time sec
2 E4 J* o/ N% Y    end" q$ w0 @- u$ a( K
end
9 \) s  \: i! I+ P/ L
; Z4 R5 D1 q- i$ vbegin P_induction arriving; i8 Q' n& y& q/ q# r
    if A_induct=1 then clone 1 load to P_pick1
$ b: {: F  j$ h8 O8 N7 }9 I' R    else if A_induct=2 then clone 1 load to P_pick2
3 `6 N! y( ]3 k- V! g: b- y        else clone 1 load to P_pick3
( k$ T! P" P& @0 F5 ~8 cend
6 {: B" o& y" A2 q9 K- ?9 U4 d- S" z! g" i& a6 r4 y% o! }/ F
begin P_pick1 arriving
$ P  \6 J& }7 F$ x$ ~2 @    set A_i to 1* s9 Z6 H. U9 _. t: m6 n" ~% }
    move into Q_induct1
: R# J9 D( p  q    move into pickaisle.induct1
% @0 i2 ]" }/ J1 z    while A_i<=30 do begin
$ h$ k. X, J# W+ w  ]$ M( ]3 j        travel to pickaisle.con(A_i): X+ G! K! |- x# v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 v; f0 a! d# N: }
        else wait for 10 sec
; Q1 `( G+ C' \( w4 z        if A_i=A_leave then send to die' P0 U6 d9 k6 ^, \, r
        else inc A_i by 1
, j9 A. y! `' K9 s: r5 o5 c& @    end+ g. ^$ s5 c! U+ ^
end
/ q2 C4 E* g  s% G- @% H3 o+ |% c( L
begin P_pick2 arriving
7 a; C. u7 S5 o( A$ d# \    set A_i to 11
+ |9 }% q; l2 D5 f, ~. A: G    move into Q_induct2
( ?* \. h9 s! J6 n9 y4 A    move into pickaisle.induct2
' w% w& k' \, T6 K! y0 y1 t    while A_i<=30 do begin4 p4 e# m; T9 O
        travel to pickaisle.con(A_i)
. _( z, D. R% @" M2 n/ J. ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& W' F0 h6 p) R- _. H- n        else wait for 10 sec
6 O; ^5 I% Y0 t- p& u3 H, ?        if A_i=A_leave then send to die8 n' X% i" J! M6 `' P) i1 L% M% {# [
        else inc A_i by 1
( n! M  `( O' Q! `5 b* n    end% q& f$ u" v2 d; A9 s
end# x9 x0 U( p, y% x
" z, r& M* k' ?
begin P_pick3 arriving/ `& M8 K, i0 s+ j5 n2 t
    set A_i to 21( e) g3 h( A" a4 E6 u
    move into Q_induct3
; f0 z: J$ P- B- x: X6 S    move into pickaisle.induct31 w  Q" T) \. `* \
    while A_i<=30 do begin+ q, O, I: P  s/ `) n4 V5 H2 t! s
        travel to pickaisle.con(A_i)
, S( u7 |( z! c; b5 W) K) K! X2 ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& o+ H% S8 Y" ]: j* y
        else wait for 10 sec
7 b; h  L* L" H% C$ O6 x        if A_i=A_leave then send to die
* n) v: c5 s" I5 l) `! g        else inc A_i by 1% U. z! v- c/ L& h8 Z4 M! ]! T
    end
6 }+ b( d5 g/ I" T7 O  q) q! I- iend

最佳答案

查看完整内容

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是个什么东东?  o3 `2 H9 H9 l4 v
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?; k3 C3 ~: U- Q' X6 R6 @/ j% t
  O& o/ t/ y# C* L0 ^  T) _& E
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 I$ F* N& B1 |
. ^" H' e( R, D1 z8 ^3 Z1 H
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ p* `( X1 m7 \& U9 G1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  q8 }2 {7 D. j: O2 U2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
% {& R2 e) ?2 O6 V3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:$ M) m4 k5 D4 p5 f- ?4 I
begin P_induction arriving% x6 m* P, L; s3 R* i
    clone 1 load to P_pick(A_induct)6 P% H/ C$ l2 f0 x6 U
end最大的系# Z6 N$ t  \" K, N3 Y
- Y7 j: K: h- r/ z- ~/ e
begin P_pick arriving
  k7 w; H& u% R! P% q    set A_i to procindex * 10 + 1, m: F3 V& F2 D: P7 e6 W
    move into Q_induct(procindex)
% I7 N4 C2 x: }/ L! D0 M* J    move into pickaisle.induct(procindex)
8 C6 a+ L4 R1 ?% O0 u& |+ w    /*check the type of pickaisle.induct(i), for your last problem.*/
. ]1 l4 Y  t  e' Y, H' a( a# J% t: ~% b7 A" n7 K
    while A_i<=30 do begin6 {9 L8 r% P2 C' j/ c8 K9 D
        travel to pickaisle.con(A_i)
* x; _! q- N+ R! e- E- \6 M" w1 {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& h$ t# H* `" o& ~8 f" |* r  M0 L
        else wait for 10 sec
( i3 T* q. K+ |        if A_i=A_leave then send to die# v' z! r4 Z4 z2 f
        else inc A_i by 18 Y6 [# E5 I& y4 j' R' b5 F3 s
    end% _; r+ A  J/ V, Z2 D1 {9 i
end. N8 B9 E6 T7 T3 E

. r. s$ t% h$ M4 o其中的procindex为整形,代表当前process的序号。
2 b5 v; h+ o% @+ M# k2 B4 estation和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-4-28 19:42 , Processed in 0.018613 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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