设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14744|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
  Z& p% a# l) s6 j' \
8 d6 [& e$ R9 z4 P+ R我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 ~3 J5 t' K# K" `# U/ w3 Z
. M. o2 c9 ]) r, k$ e6 ^begin P_read arriving
7 [1 c0 ~/ @- y" z' `- }7 f    while 1=1 do begin' \5 ?4 l: f" I, }2 u. b2 b1 v& q* V
        read A_tote from "data.txt" with delimiter "\n"
% p' V5 }8 _- H& T5 ]" w5 t        read A_time from "data.txt" with delimiter "\n"0 ^, e/ `2 a+ t( H! c
        read A_leave from "data.txt" with delimiter "\n"; I% d! d% F1 g5 b! _- _1 k
        read A_picks from "data.txt" with delimiter "\n"
+ a+ E3 X3 x" p+ f: B5 m        set load type to A_tote
; F3 q, w8 v$ {$ G& H0 s        if A_tote="tote 1" then set A_induct to 1" Y8 Z1 I& s' f6 C& ~; P7 T
        else if A_tote="tote 2" then set A_induct to 2/ Q+ N) F# V; C9 w( E
            else set A_induct to 3    9 N; q. h! x; y
        set A_i to 0# X) u" f* l/ [3 H8 h# @
        clone 1 load to P_induction
0 [) \9 K5 m: B7 J$ z- n        wait for A_time sec
# E( |2 w+ D% f* S' s    end% e7 @5 R6 G& n! `' J4 `
end
- u" d4 h$ q3 b( h
! _* L, B* p# B- v1 e. Ubegin P_induction arriving0 t9 V5 m. F3 Y$ T6 S; n! I1 s7 r; u
    if A_induct=1 then clone 1 load to P_pick1  Z5 f( B$ K" r# T6 [
    else if A_induct=2 then clone 1 load to P_pick23 M3 S7 M+ ~" L. F
        else clone 1 load to P_pick3
0 y7 s2 B# V0 ~3 q; Z4 z, Send0 @$ W9 O0 }/ m- {  b9 A. d! y" D3 S

+ G$ v+ T1 P" n* y7 t' \  qbegin P_pick1 arriving
# L/ R- i6 {9 s( _- W8 k3 D    set A_i to 1
2 Z3 Z9 L2 K) d3 x0 t' W* w    move into Q_induct1; t+ L/ X! @* m/ t' C1 P+ P$ }
    move into pickaisle.induct1: }) z- L6 K# D  a- f
    while A_i<=30 do begin
( P0 b  N& ~! k( U1 |& U( Z0 X        travel to pickaisle.con(A_i): a  A) m) D& v! X: Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 y6 O- F! @5 G% P6 o" G4 T
        else wait for 10 sec
# e" E2 X7 t; A1 t        if A_i=A_leave then send to die0 r- h* I8 s) i
        else inc A_i by 1
; l' ?% Z6 Y( P& [/ l: L    end; O" B2 W# Q5 e+ ]
end
+ n: {9 L; b8 A5 e  `- u* ^2 G+ s; @" b+ J* L% z
begin P_pick2 arriving
0 |" I9 K5 z/ P. i$ Y    set A_i to 11
$ T, `7 \3 V: H    move into Q_induct2
. {; Y5 i5 y8 y* S  C: f6 t    move into pickaisle.induct2/ P8 k. t, H3 G! I0 ^3 T4 ?  k
    while A_i<=30 do begin
1 o8 O0 e) H: o  B% }        travel to pickaisle.con(A_i)
( _/ J" X9 A- z1 `* x- ^# D) D; J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* Z4 R* ~) G; u2 k% t
        else wait for 10 sec
9 B3 k6 T5 l/ m$ H3 S        if A_i=A_leave then send to die0 X6 [" W* N8 x, |: r& D& x
        else inc A_i by 1/ n% V8 M0 A7 Z9 O. N& o' ?7 Q- H
    end
% I  e2 S3 D* Qend& u" u8 z. Y( L/ e
' Q7 x% N/ Z1 I4 K. z+ O6 j9 R
begin P_pick3 arriving+ W/ f. E' v) K$ j
    set A_i to 21/ o" s. G( l7 k: p1 z
    move into Q_induct3
8 l: ]3 ^7 F6 L2 F" I    move into pickaisle.induct3
! K% x5 A8 a4 X/ D3 M( U    while A_i<=30 do begin
- e- I$ D+ _; @% [        travel to pickaisle.con(A_i)
5 n, E4 S, ]1 Y2 Q5 c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 @0 N9 b5 Y7 w+ J- A        else wait for 10 sec
) G/ t. K4 d& c# m  C        if A_i=A_leave then send to die  K9 h# X; d. m, ]; d0 {
        else inc A_i by 1* \1 h# |' J. i* k) T5 L
    end
( C2 y9 S0 s0 f* C; W; J1 p  p; zend

最佳答案

查看完整内容

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是个什么东东?: i% _. D5 y. D0 a" E
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 V& k! e# @9 h8 g
5 K$ r. {9 O' c9 B1 V6 s/ a3 tAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 @4 r, A1 {2 T' P$ v* c

" K0 q- {. y" U. @2 e另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
+ _, Z) }, g8 Q8 u1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
/ e5 m5 I0 U* o4 ^8 ?* |9 s. N2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 {) s7 F) ?/ K" N& H. R7 c3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
2 f% a2 E, |/ T5 y4 _begin P_induction arriving
& w. q  F( N; x# _    clone 1 load to P_pick(A_induct)- f0 D. T6 Y# w
end最大的系
5 Q0 p1 j- ]' s4 a' m8 q2 Q9 F+ Z, c: p3 h& ?1 @& j: Z
begin P_pick arriving
5 J; p% U. x8 a! c    set A_i to procindex * 10 + 1& b( w" E. g  t. Q1 _) t, X
    move into Q_induct(procindex)
3 z  C. r8 O7 b6 n! J    move into pickaisle.induct(procindex): Q4 M: j) m/ ^$ }" ?; \
    /*check the type of pickaisle.induct(i), for your last problem.*/
; D. S" B% P. w5 C# c( p
) Z  d2 V; k  W    while A_i<=30 do begin& f- F6 s- B3 z$ t$ z5 g4 Q6 q9 G
        travel to pickaisle.con(A_i)( e& X. U0 p0 q1 K) M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- g( c( W; W7 k+ |2 J
        else wait for 10 sec
3 S3 z/ ~2 A  _6 k$ a! J        if A_i=A_leave then send to die
# I) v% x. z3 \! S8 p- r        else inc A_i by 1
4 Z& Z/ `& }0 ^, ^8 Y1 M& d+ t    end/ q8 t8 a. n" F2 Q  B
end% d2 h- ]7 \# r, i, z
& ^1 F# M9 X, ~6 ^( X
其中的procindex为整形,代表当前process的序号。+ j' k+ U, D% \% u; a2 e4 K
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-7-24 22:19 , Processed in 0.015598 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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