设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14984|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. g6 s; @( [) w0 X0 Y, x) U8 r
$ u& m# n: }2 E
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( ~8 k2 n( i/ R: J; t, `9 u" o7 A; G  y8 a, k1 d9 T1 Q
begin P_read arriving
0 {) C/ k7 z  k/ ~    while 1=1 do begin+ O9 P1 L8 c3 c, b$ B
        read A_tote from "data.txt" with delimiter "\n"
: I7 M! ~, I# e- h& v1 L        read A_time from "data.txt" with delimiter "\n"
, S- C& n4 \+ ~* I$ ]2 L! B3 q0 {        read A_leave from "data.txt" with delimiter "\n"
  Y% w2 J' U9 f3 x& j        read A_picks from "data.txt" with delimiter "\n"
  r- |) ?7 I5 M        set load type to A_tote/ R0 _9 G" s5 P0 m" J
        if A_tote="tote 1" then set A_induct to 1+ y) v/ `' ^" F
        else if A_tote="tote 2" then set A_induct to 2( b  f9 j7 ~7 p( v1 y5 s
            else set A_induct to 3   
$ B, B; B- j$ G, w3 T$ U        set A_i to 0" d9 O  O  h3 y0 r9 P* r$ ~
        clone 1 load to P_induction
5 l- V$ ]3 u6 g6 C. Q8 B+ s        wait for A_time sec
- w. _( J. ]# \/ `6 o    end
3 d. L0 k( P; ~9 q3 G# {( x" Tend% S- l: C1 Z7 r  d8 c, e
) T9 e- e9 ^& G% L/ L/ W7 M
begin P_induction arriving
: l7 A! l; s5 L+ d$ {/ B: `    if A_induct=1 then clone 1 load to P_pick1
+ S/ O* X! k, Q- B# O: s6 n    else if A_induct=2 then clone 1 load to P_pick2/ ?* e- v# ?6 M
        else clone 1 load to P_pick3+ a( L3 J6 G! W6 ~% f+ p: }
end8 I: u) G) E; `" ^5 i; |

, W9 H  X; \& m+ qbegin P_pick1 arriving' O  N$ T8 [/ ~! r- i6 N" ^; R
    set A_i to 1
5 ^, a6 K' }. h) I( W( ^# i/ s8 Y% ^9 D    move into Q_induct1
5 n7 @1 R# W5 G+ s0 R$ B8 J& x    move into pickaisle.induct1( B5 o2 M, h3 q% M+ y. w
    while A_i<=30 do begin
3 [6 Q; }9 i, x) C: _        travel to pickaisle.con(A_i)5 n+ I+ v& N' G$ x1 `, V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! s  F$ g6 K3 T* v8 E9 |
        else wait for 10 sec% X& m% ~3 q0 w" t9 Y4 A
        if A_i=A_leave then send to die. `0 c- T( n% w6 u" F& f$ P4 W
        else inc A_i by 1, r& h! p: Q/ n& `$ ~9 d9 i- \
    end
) f1 K# `( |- l& {4 L2 D, Vend' e5 a- K& t5 T+ C6 p
& @7 C( X0 {- a; |
begin P_pick2 arriving* O+ y/ _3 G2 e" I* i
    set A_i to 11; ^; o# }3 F6 X- K$ w1 h
    move into Q_induct2. T' d( ?$ h3 O0 G( F9 A
    move into pickaisle.induct20 M: c5 ?9 B- |& v
    while A_i<=30 do begin
$ u4 D( m* u9 s  r. P* t' B% S% s        travel to pickaisle.con(A_i)8 M5 w2 X9 g/ L' v$ ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ B0 A/ y, B4 R5 N" M* z: D
        else wait for 10 sec. T& p8 v9 q2 E. I* |; k. `# \+ H
        if A_i=A_leave then send to die
% Y: s2 A2 n! E  Z        else inc A_i by 17 U/ r1 q: ?8 c3 F( V3 X4 B# k
    end* I1 @# w% A0 R% E5 s6 E  j
end
( e' K$ s: f2 h+ n( }
& A+ x* r3 {$ Y- g* Abegin P_pick3 arriving$ B1 _& ^: i3 U
    set A_i to 21/ K/ N, L' J; \2 z+ O
    move into Q_induct3
: b# e. \: A( j0 C, H    move into pickaisle.induct3
! s5 U1 L& K. x9 M4 |+ u! B    while A_i<=30 do begin
1 ^& N7 ~8 _. ?; u4 U        travel to pickaisle.con(A_i)  K) Q/ K9 U0 A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. S3 ]! c; W# C% T& i1 H, `) ?) R        else wait for 10 sec
) u  y: f$ K( w1 q# U. ^5 h; H$ C) h        if A_i=A_leave then send to die
+ f6 |8 u1 A( D# {0 D, `0 L        else inc A_i by 1
! m& [" p- Q/ B: j  X/ s0 ?    end6 R; i6 k: h: T' {9 G# A
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是个什么东东?
) D, e. O, _1 |move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( l2 Z2 X( q8 m

& r8 U: R, W* D1 kAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。! {/ o+ \+ S& W- Y
8 B8 ~! o6 s3 g) }2 g: m$ Z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* E1 W& r6 Q. ~. @) R1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
* F& a! d& M2 }& P. P2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& ]9 q( _- J. s6 G6 A: w
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 D. _, `* x6 ?8 E) e& q6 o0 U, g
begin P_induction arriving" |  T+ u' U1 Y% n
    clone 1 load to P_pick(A_induct)' ^7 [! E" j7 Z' S% J6 a) O5 K; R
end最大的系) Y6 J0 d+ c; _- o+ C' k

6 n" }& b9 n8 m3 G8 Ubegin P_pick arriving
# @, N: z5 F- {3 U! p    set A_i to procindex * 10 + 1
3 a; H) _" H1 }$ M7 k    move into Q_induct(procindex)* c6 ]8 P% l3 i2 Q- A
    move into pickaisle.induct(procindex)
- ~1 j( A, U! r/ F. q. l# U5 O6 Q    /*check the type of pickaisle.induct(i), for your last problem.*/0 G; A  A2 }6 b
8 Z- M0 c& g, o% u3 O$ n  X
    while A_i<=30 do begin
7 N" J! T. o: Q# Y! w' w( ~        travel to pickaisle.con(A_i)' N: s* C' w( z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" w- g3 d# g1 t# D! {        else wait for 10 sec
! w9 s1 u0 }: z3 ?0 g* y        if A_i=A_leave then send to die
$ p* A- P: P9 n  S        else inc A_i by 1
* I" v" E8 q- a! o: r  n! q* C. T    end
( `7 R) m7 p4 fend
' r! P" }4 c1 O. z9 f( M9 U4 D& O& t( O8 O7 Q
其中的procindex为整形,代表当前process的序号。. w' Q& ~4 l: ?  i3 C5 x& b/ d
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-2 01:40 , Processed in 0.017216 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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