设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15185|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ W! w1 K2 l% L8 h
$ l' z% d( ]0 [5 |我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" ~& T! ~2 i- ?! T) g2 I* d9 g9 Y' V6 l6 C+ J# o. L# G' B" t9 k
begin P_read arriving
( W/ c% D" A- j0 G5 W    while 1=1 do begin0 i- k* c4 k4 `# F  z$ M
        read A_tote from "data.txt" with delimiter "\n"* L! o3 }) r& T" e+ _2 k' S
        read A_time from "data.txt" with delimiter "\n"* t! {* |" b1 P
        read A_leave from "data.txt" with delimiter "\n"
7 J& v/ u2 _( Z+ m( K" |- m; m        read A_picks from "data.txt" with delimiter "\n"9 O; R) ]' b" L% e: X7 r& h
        set load type to A_tote
/ }) \- k! P, V3 A  |) u        if A_tote="tote 1" then set A_induct to 1
- \2 {  d: Q  ?8 |" U        else if A_tote="tote 2" then set A_induct to 2
, p4 H. \8 u; _# e- }& g" K            else set A_induct to 3   
( q! q7 a( K1 @4 L" L" L" g: g        set A_i to 0
  q' e8 n" r' R  p; B6 n& W/ c& Q: q        clone 1 load to P_induction
# D9 I0 N) h8 k% Q7 r. v        wait for A_time sec' e9 J- J; l7 D. U
    end
) W: C: u9 @+ ]- M$ `, hend
6 A/ z( o' p  X" _+ ^' U7 \6 }
% y% l; i* d5 v5 P& N; G* }begin P_induction arriving2 h, W5 @* c/ L9 ]5 v; \6 B
    if A_induct=1 then clone 1 load to P_pick1
/ |2 O' g% z8 q8 z    else if A_induct=2 then clone 1 load to P_pick2
/ O" Y! @# f# q) q- r        else clone 1 load to P_pick3
  K' L: G* m2 Q2 h+ {0 z/ C) t% t0 uend9 m4 j' {/ s9 i" Y- p, n, w3 L
0 Q: \3 i$ u( y. _$ k4 r7 b
begin P_pick1 arriving
& D9 \5 H* v' X( u8 h    set A_i to 1
* Q* i, k2 T* m) D; {0 ?    move into Q_induct1
% f) q5 ]+ G5 q3 p. f) r4 m1 [    move into pickaisle.induct1
) f, \$ n; b. o( F4 }- o    while A_i<=30 do begin9 {' }% D2 H; o$ A) k% g2 d* W
        travel to pickaisle.con(A_i)
1 o1 M4 L6 J$ o! c6 Z, ~- v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* j  Q( V; C! V& h. N3 K+ Z        else wait for 10 sec
# j% j% A" e* ?" v' |+ _3 L5 `, M        if A_i=A_leave then send to die
  ?4 o8 @2 m8 l1 o9 n7 @' J3 c* B        else inc A_i by 1
! L+ U4 H9 U8 w4 ~& _+ O2 d    end
' c" N8 W" _# P% _end
3 R+ n3 K* w1 o  L: r
* G! o$ t' o: \" J- |2 [- [begin P_pick2 arriving
% z( W1 h9 ^2 i+ f    set A_i to 11
# W( A/ p: _# C% R0 i    move into Q_induct2
5 W+ E2 z, [/ a7 S5 n, A    move into pickaisle.induct2
( ~  @" R, x' w* U    while A_i<=30 do begin! n; A9 [3 f# Y/ G9 v8 X, g
        travel to pickaisle.con(A_i)
6 J" l7 z; D! u2 x3 J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ y, R& m) ^) S* t" Y
        else wait for 10 sec
" r: u) e/ m1 e2 D- j- I        if A_i=A_leave then send to die
3 a! c( z! D2 L5 X: {        else inc A_i by 1; |! E# k" Q9 ^/ E& M; i' Q3 Z
    end
: q. C; `/ g9 p% J4 C9 p+ Kend
3 @( W/ C. X& ^* S8 x  ]& i2 {  q% f( M* {/ a( H
begin P_pick3 arriving! X2 Z( ~7 E" G3 B4 b! `
    set A_i to 21
' _5 z, e9 U# X, h3 c  R. Z8 \    move into Q_induct34 j' c6 X1 E: G+ Y! u  z+ t! o
    move into pickaisle.induct3
: Y, s+ K$ ^8 h+ L( @  E    while A_i<=30 do begin/ r8 n( B4 n  y+ b1 @) N
        travel to pickaisle.con(A_i)
) I& ?: V- J- R  [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 q8 a9 o6 |% Y  X0 x7 U' c& p        else wait for 10 sec  X! X4 _  x0 }/ J* P" y: Q
        if A_i=A_leave then send to die4 H. r+ s, R& i* D
        else inc A_i by 1
0 Y# b4 U* _  {- L    end' _. Q( Q! a' ~; u, |: t& p
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是个什么东东?
+ J. [! z8 O7 E1 ?move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
- l$ x4 I" I- O1 D; {+ b7 G, x6 [: ?$ p: K2 G- \6 d: o' x
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 f* }( z( F+ A! O: X: x0 [- |
! H9 ^6 V/ N1 m3 |
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
4 c( q4 u( y# y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 g: l; ~1 Y" z% G2 ]
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
% q, x; o. Z3 h; w3 H3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
% `- `6 G. g2 m/ N# Kbegin P_induction arriving
  p+ J- D! v: o1 g- D6 w8 H    clone 1 load to P_pick(A_induct)( x7 {; }8 }* L2 R* M: y- q
end最大的系6 z& {1 H, h1 c! o2 c: X# A: F# T

! c) f! l: k8 q: Dbegin P_pick arriving! W  M/ ^( R# [* [1 R
    set A_i to procindex * 10 + 1
1 M- r# S* t4 @/ J. X0 P! K2 Q    move into Q_induct(procindex)
1 m; |! q# R. C" {    move into pickaisle.induct(procindex)
1 m/ q- h( I$ i    /*check the type of pickaisle.induct(i), for your last problem.*/
( U8 R0 ?0 L- p0 I0 f* L0 D, r1 e5 h& M  ?1 t/ h; \: X) c' W% r- T) E
    while A_i<=30 do begin
7 v( U, y% }; G' H$ I( N  ?        travel to pickaisle.con(A_i)
" |+ t5 ^3 E% Z! f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 m5 h" g( [3 ?# A( S
        else wait for 10 sec
/ n- a! v% Y" q% g" h        if A_i=A_leave then send to die' ?0 C( w/ M3 r+ ?' f
        else inc A_i by 1
! @$ ?8 o! Q/ B4 ]; o8 b4 s7 P$ G    end8 V) L; ?* X4 L) G" m5 ^
end6 _' ~: K  ]" y. E* |6 y$ s6 j% N1 C
1 ?/ n5 ]) {5 r7 K2 e: w8 x
其中的procindex为整形,代表当前process的序号。4 t" V; Z7 [: m& K. V
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-8-20 23:37 , Processed in 0.017671 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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