设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11592|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 M3 O2 s3 w- Z( J# u  C% A) G( I, v8 r  X* B, d. K
我的问题是,在每个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中的数值,不知道会不会有什么不妥。5 R5 l1 T- C( ?
5 b4 |9 X$ m7 x  [9 Z9 ]: N
begin P_read arriving% B8 B; Q4 g: u3 h& p; O) [! e& D
    while 1=1 do begin
: v0 d' C9 M/ A* ~- O0 w1 N+ P        read A_tote from "data.txt" with delimiter "\n"
9 m9 d( K$ F% T8 U        read A_time from "data.txt" with delimiter "\n"
1 u* {1 {6 o8 q) h) c+ R( h7 S        read A_leave from "data.txt" with delimiter "\n"4 s! _" b- _0 X4 m# K# P
        read A_picks from "data.txt" with delimiter "\n"+ K) E. d; P% T0 t% Q
        set load type to A_tote
6 t, ~$ W* U6 ]: w) q( ^: k$ G        if A_tote="tote 1" then set A_induct to 1
1 u9 {1 t% Y9 y9 |' ]. k        else if A_tote="tote 2" then set A_induct to 2
' }7 J0 {% p  H  O$ a            else set A_induct to 3    * l. _! y# x+ D
        set A_i to 05 M: S. c6 O+ n/ L- k# W
        clone 1 load to P_induction
) b  P9 a" h' d% W% v( I; E8 Z' H        wait for A_time sec
9 M9 \$ P8 v3 R$ q7 q! Y; T    end
: P% e6 I( v" S$ [end
" L8 u! p3 G; i" `% ^
5 ]0 |0 ]& J3 y* ibegin P_induction arriving4 ^: S, k+ }/ V* k8 B7 w- ]
    if A_induct=1 then clone 1 load to P_pick13 `: o9 r) M+ `. R% [* y
    else if A_induct=2 then clone 1 load to P_pick2! z: R% s3 r7 ?% x0 f, I" T. O. A
        else clone 1 load to P_pick3& C* `1 l2 {( j0 Q) R# f' Y* J% q
end
0 P) r- M; a3 ~' g" ^2 b, l3 K
$ i( g! t- B& R$ ?( C5 L1 D4 i; xbegin P_pick1 arriving
! B8 y" M/ z9 j5 q7 _( O9 y8 G    set A_i to 17 C3 T3 {. E. ]0 B: X# U
    move into Q_induct1
5 U. R3 }7 g- P    move into pickaisle.induct1% l- U( H' |$ O* {0 @1 X6 [  i0 h" s
    while A_i<=30 do begin
( I/ t, v3 a/ U- T        travel to pickaisle.con(A_i)
6 B0 \  |, \# W; r; H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 R& W, E8 ~7 P+ A        else wait for 10 sec
6 \! M3 C0 X8 y. {6 L5 ~4 }. Z        if A_i=A_leave then send to die$ o, l( s+ h& s1 L- h% E- h
        else inc A_i by 1
" S* Y" T3 M$ i: `# G. J  b    end4 J& o; [5 k, P/ t* {( z
end1 e( X2 J1 y/ w) F# N% i
7 @( p8 ^& P6 P) Z
begin P_pick2 arriving) F: h: _7 u* Q; A
    set A_i to 11
. i; s# l0 e$ Q: ~( c    move into Q_induct20 M8 i) s: R5 r* R- c2 {# N
    move into pickaisle.induct21 X' X* Z; u0 D. \
    while A_i<=30 do begin; M8 Q' ^- K4 M3 C$ }
        travel to pickaisle.con(A_i)# w# W% q4 p; W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) O9 ^5 B2 Z$ y" v0 H" l
        else wait for 10 sec
( z# k, K* U! m        if A_i=A_leave then send to die- b+ E' w3 p6 y0 }" i
        else inc A_i by 1* `; P5 m& h& u7 A" _- W- I
    end1 |5 r. Y# @! A3 b) P) f
end
% ]0 ]  @/ Q- @/ f. t. @9 x' N1 F! A5 g, w# ]5 I, Y- h7 C+ A
begin P_pick3 arriving
1 }) \, K# x" B    set A_i to 21
3 h* q; c3 M, h    move into Q_induct3
$ A# O7 x. ^& E9 b  r/ |    move into pickaisle.induct3) d1 n. o/ U/ }3 `+ F( D
    while A_i<=30 do begin
5 }4 p7 W$ L" p! g        travel to pickaisle.con(A_i)
; S6 E: }" z3 `# Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# b# U# O; a: Y) j5 t        else wait for 10 sec
* R" W/ A* c( @6 ?' k        if A_i=A_leave then send to die5 F8 i9 Q1 P1 X. a" t2 ~9 s$ S
        else inc A_i by 1
% F# L/ C1 R$ X! c2 b7 c  j! y    end# }. ?- a# ?# P, l9 q0 S% 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是个什么东东?
( G( N+ r& v% }$ B$ _0 ^9 H5 Tmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, G2 s1 _9 O, d2 s2 F+ w) L3 t' L9 d2 |5 F! O. z7 L9 ~# y# P
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) _3 p6 |$ M) s6 g
6 z+ k5 c0 h" T: ?$ Z% Q1 A
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: k7 h; v8 S0 c7 B( o
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;" ]+ K& Y! E& ?+ w% Q0 m
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 M9 }! h" x7 d7 r5 C, j  P
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
# F" Y6 {4 @9 X* Zbegin P_induction arriving
5 w; R$ a7 l$ g- [0 u4 r    clone 1 load to P_pick(A_induct)
4 x3 `8 G% x2 F  H1 ]end最大的系5 l$ G- z7 j' V* z7 ^
$ C8 w, f# P' Y" ?; S7 j
begin P_pick arriving
. v, u, |9 ^% q7 F" n    set A_i to procindex * 10 + 1% u# s+ E" t7 w3 A1 c3 u. `
    move into Q_induct(procindex)5 W) x, X6 }' b
    move into pickaisle.induct(procindex)
# \% o* ?, C* @; G# n) c+ G7 z    /*check the type of pickaisle.induct(i), for your last problem.*/, h) O. a4 C/ M: N8 e

' d4 I: q) b0 O% W    while A_i<=30 do begin
" K% G5 {# N* p. r4 A, P        travel to pickaisle.con(A_i)& ~0 @6 s/ w* W3 T7 X- B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# t; W$ f& C" a' G! m8 V" o  p
        else wait for 10 sec
7 X% C* M$ g2 M        if A_i=A_leave then send to die0 ?8 P  ]+ o3 X3 Q$ Q  Z4 \
        else inc A_i by 1
2 b, M5 s1 j: q% Z    end6 p3 o- v* X( Y+ ?. {! q1 |
end( {( W* L8 M+ U+ N! K, C- o" P9 a2 q/ R) |

  B4 t- j- o' i: ]& b其中的procindex为整形,代表当前process的序号。  H% y* c' w. @8 Y* u  o
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, 2025-11-22 12:59 , Processed in 0.022934 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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