设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12881|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) J" g* d$ D( Z) _
$ @  Y) l6 Q/ D! 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中的数值,不知道会不会有什么不妥。- R: [9 }$ r# T5 M6 `

2 K3 n7 ]4 n+ ]6 x$ [begin P_read arriving
2 `. }  T% T+ x8 s9 }1 p    while 1=1 do begin
/ j# W; ?) n4 K0 P8 m        read A_tote from "data.txt" with delimiter "\n"/ T: y5 ]/ a$ `5 m5 m( `
        read A_time from "data.txt" with delimiter "\n"
, V; S) ~+ g( R( f2 C' m6 K  @        read A_leave from "data.txt" with delimiter "\n"( @" C: M( X# E1 c! T% }
        read A_picks from "data.txt" with delimiter "\n"2 O4 v8 k+ p% ?7 P  M3 e$ F
        set load type to A_tote# g8 l& u" L3 a5 F0 M- ]
        if A_tote="tote 1" then set A_induct to 1
$ _: p) J" r, A: l4 |9 C: f        else if A_tote="tote 2" then set A_induct to 2
  B5 k  y" i; ]' L5 g8 v- B/ W            else set A_induct to 3   
* C5 K4 W  w. M        set A_i to 0
& i1 k" l) e8 P; _5 I7 U/ I        clone 1 load to P_induction
( @5 \* f7 F' F5 p        wait for A_time sec
; }, R* D0 \( R$ E    end5 k) u2 H9 k( g8 g' H4 [
end
" V; B: `0 B6 n6 y. \1 k3 A6 C1 O. w( ~' O2 U8 {3 d
begin P_induction arriving
: C. t3 u# p. o7 ]5 h6 ~2 _/ S2 Y) |    if A_induct=1 then clone 1 load to P_pick1
% _! D, H5 J6 n    else if A_induct=2 then clone 1 load to P_pick2, k' U3 j$ x  A
        else clone 1 load to P_pick37 J# ~# c: e0 x1 z
end$ q1 b) @9 U" j. i0 }* _
' b: P- M6 f5 D4 O+ }7 L% ~
begin P_pick1 arriving& X+ ]1 e3 w7 b/ m' e6 V  B: `3 o
    set A_i to 1
  |3 v2 A; r/ B4 x, I    move into Q_induct17 O/ X  R. q6 F/ E- H3 ]
    move into pickaisle.induct1# J, L2 i3 a1 t/ D
    while A_i<=30 do begin" y% S0 u) y2 ~* H
        travel to pickaisle.con(A_i)
2 f% R  I$ V5 K" t4 S5 M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 H& w) O  [$ t* n
        else wait for 10 sec4 r5 D. Y. e+ H: T# D/ K
        if A_i=A_leave then send to die; m# s3 H  [6 [# ^1 k/ J" j
        else inc A_i by 1
' j9 O8 [' X) S  p7 R( W    end: ?% x  S/ \4 c5 E+ [* g( G
end
( s( {2 x+ S* y! @9 r2 ^
, o3 W1 e2 e' O! E8 D% t. Ybegin P_pick2 arriving
. R6 e, Y% A% p    set A_i to 11/ [5 k& l/ _* k4 d. {9 ~) \
    move into Q_induct2' n% ~1 r- x3 q
    move into pickaisle.induct2
) J9 G; }' w  V. N8 W    while A_i<=30 do begin* o6 C* a# Z( L4 H0 S$ |% D/ ]
        travel to pickaisle.con(A_i)
- ~+ y0 _! e( F. x5 Y$ E- R" ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! J/ L4 _& @! d, ^- f& f        else wait for 10 sec" E! i3 h- _* g
        if A_i=A_leave then send to die, _$ }# {: z& e
        else inc A_i by 1
; r7 V. u1 V+ n2 M6 j8 k1 V: t    end
5 M  X6 L1 d$ uend: E- o1 Z' X# ?6 x- q

1 @. i& A" i8 |" _% v0 bbegin P_pick3 arriving3 c; l2 R& R' j1 Z; Y$ G
    set A_i to 21
: i4 _0 C! ^# D+ R, h/ u    move into Q_induct37 G) A# Z7 {7 G; Q, v
    move into pickaisle.induct3# E+ }; _) b% Z& U6 b5 ~3 Q
    while A_i<=30 do begin
+ M& p8 H) n+ l3 l) Q' x# |; K        travel to pickaisle.con(A_i); \+ w& f) X& s8 l/ D6 ^3 ~. k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' \( e7 @2 y- U- w. r% |0 O1 ^% {5 w5 f        else wait for 10 sec$ K/ _+ y% G+ k" p7 D" S
        if A_i=A_leave then send to die
- c- e+ w0 j7 n& X- o        else inc A_i by 1* P. r( c: t& `) u, Z3 A( _8 ]5 J
    end
, C& P3 j. b9 [) s' s* E; oend

最佳答案

查看完整内容

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是个什么东东?! z1 W2 [7 |4 i' n# I% G# |3 g
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?' b- L! s8 x  P
" `6 Q, p0 L2 k) h
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 K% I2 n! p  L' b% p! E/ c: d' [& L8 B1 c6 }
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:. X! e$ U% R7 S
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  s) h+ k2 [* z5 j# H2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
7 t/ F0 ~4 m& q5 b3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, x7 `5 V( E( a; Xbegin P_induction arriving
/ C* F- L3 L8 P' p( ~1 D8 c, D3 Y    clone 1 load to P_pick(A_induct)8 x3 G: f- Y$ u5 A" b
end最大的系' U/ Z8 B4 Q7 E3 g
- z* _, U1 o9 R6 B
begin P_pick arriving$ Y+ M. A" y9 X7 e9 d6 h  w. T
    set A_i to procindex * 10 + 1- f' [# @+ s" D% H' m, p' \5 f
    move into Q_induct(procindex)3 S* {5 z2 O. V. c1 f- ?: o
    move into pickaisle.induct(procindex), I$ H# H9 w6 d' Y
    /*check the type of pickaisle.induct(i), for your last problem.*/: Y3 L. M5 @0 e4 z
* C, L8 i+ a! s4 j4 l
    while A_i<=30 do begin5 d" C0 `' ~$ ~0 H
        travel to pickaisle.con(A_i)
/ _8 Y1 @0 w+ k! C7 ^% y  `0 X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ m1 e" D$ {/ S  O        else wait for 10 sec
2 c# K% ~1 ]2 {, k/ v" S        if A_i=A_leave then send to die
1 ^" z" u9 @' Y8 a# Z% i2 h$ e9 Z        else inc A_i by 1' [; Z6 e2 D6 O9 `' o" B
    end- l6 s( g8 A0 _, C1 w
end
5 u: q. F, h% K. l
9 F1 k; U: Y. o& Q# E/ H4 ~; `1 c其中的procindex为整形,代表当前process的序号。
- a3 t' g& U' E# cstation和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-2-27 15:37 , Processed in 0.018940 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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