设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12646|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ _% j: E6 u8 T% r7 ?6 H
5 R0 g; D! ^) b) I7 j
我的问题是,在每个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 `/ z# u  ~3 n0 V, W, ^
% R  `5 u3 `5 E& X2 O% b% J
begin P_read arriving0 }9 c- N% r5 r& T! b7 X1 l
    while 1=1 do begin" J- I& X6 ~: N6 _, b" L: S& b9 K
        read A_tote from "data.txt" with delimiter "\n"7 D: }) e. I. U- E
        read A_time from "data.txt" with delimiter "\n"
6 d+ ^6 f6 z& ?; W' ?        read A_leave from "data.txt" with delimiter "\n"
+ i; G7 J8 N& s* G. u2 w- H" j        read A_picks from "data.txt" with delimiter "\n", ~6 W- m% n9 j2 Y" r. y! n
        set load type to A_tote
$ V( T4 W2 N' I" B  |! x        if A_tote="tote 1" then set A_induct to 1" q& Q0 {7 p+ m" l& \3 P. F
        else if A_tote="tote 2" then set A_induct to 2# a4 W. J7 `" ?; u9 D* B
            else set A_induct to 3    7 N& Y% H& ?4 \5 A+ N0 R5 N( \! @( c
        set A_i to 0% h- p3 t: U9 Q5 x. p8 B
        clone 1 load to P_induction
/ b0 A3 Q! }1 j" J  G# o) H        wait for A_time sec8 o( h* E& d" p: v+ J. j
    end# g# E0 x5 _; t% j& N
end3 N+ D9 U" ^  R) S
, ~( }. k2 L8 ~0 s0 R
begin P_induction arriving
/ Q5 q. N" n: Z+ y) H0 B" Q7 _; y5 m  _    if A_induct=1 then clone 1 load to P_pick17 {/ _' ]7 `- Q' h3 a; t+ G
    else if A_induct=2 then clone 1 load to P_pick21 _3 ~9 U+ ^) {* H
        else clone 1 load to P_pick3
6 z8 [; Z  S6 Z- Z! r9 Uend$ }- c" i- L2 M: w

8 U/ _) \: u0 W. dbegin P_pick1 arriving
+ U1 h) Q& y" ?7 }! I& X* |+ h    set A_i to 1. I2 r* \* b9 Q
    move into Q_induct16 F: U% ]# z  c, e% {
    move into pickaisle.induct1' W: {! W% n, I: h% q. N- n
    while A_i<=30 do begin1 `$ V- @. x1 L; C, g/ m: s! u& D
        travel to pickaisle.con(A_i)
- n( z. u  a) P7 D! j1 R7 L1 Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 t; \/ q  z; e. K1 o# Z8 e
        else wait for 10 sec
6 u% B) ]  B* S  w# |        if A_i=A_leave then send to die
% b9 t, p: m% Q        else inc A_i by 1
* G( r: r. {: L4 M/ T6 b    end
+ ^9 r$ C% e  e' Wend
3 S# o/ k/ n. \+ i- v
+ n, d/ o6 m. Z$ i% D' ?begin P_pick2 arriving
  i2 N* `$ E3 s- |    set A_i to 11. ^, w- {9 g5 @+ Q+ B
    move into Q_induct2) ^: c8 W. N  a- L# c1 F) P4 i/ x6 V
    move into pickaisle.induct2
* f& h4 H4 M; W+ E    while A_i<=30 do begin0 U- Y* ~) H/ }( ?; F- w
        travel to pickaisle.con(A_i)
6 w6 K9 [  E% q! w1 g$ r1 U. M6 [, o* o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" c# |9 O: J) y$ m7 B
        else wait for 10 sec
5 R: l" j# e" q+ N5 U/ h$ R        if A_i=A_leave then send to die$ i8 j9 F; D: ]+ n( }6 P, P! s
        else inc A_i by 1) \1 b& y% E* |! W6 f7 ~
    end. D7 X# |2 h# d! Y' I
end1 q: H* u3 Z5 d" M& {2 {% H5 `
: G: t# s6 W0 M9 X' p
begin P_pick3 arriving  e# K# ?1 @8 J
    set A_i to 214 o8 e5 {. D7 F! A  w
    move into Q_induct3
7 ^/ K  z5 n  v! U    move into pickaisle.induct3
# p. r. h$ Q5 ]    while A_i<=30 do begin
8 H/ Z* m2 s" E$ f4 ^- O        travel to pickaisle.con(A_i)% s1 E  G+ D8 A) ?* G) p  x9 P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ Q4 o% W+ k) s, Y7 {4 a
        else wait for 10 sec
, u5 ~% r! G7 d' [9 M        if A_i=A_leave then send to die
/ G7 [) x$ i0 e$ _2 x4 X        else inc A_i by 1
; m, l- |( M1 E, G) e+ J    end
1 X8 l! `. o/ L4 v. [9 Q' r, Mend

最佳答案

查看完整内容

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是个什么东东?2 l$ T+ }$ X7 E9 f& E' N3 \6 R
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. B2 c9 Q* t0 i# F' ^7 l
. z6 W3 y- n" F5 }; l. BAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" Z" F9 P+ l; ^9 J% H% `

4 W7 r7 y2 |1 f# F4 g' y另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- M3 ^( H" c5 l( M" J1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* u% |, N0 H0 I: k( V
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;1 Q/ p; \9 g2 s9 [3 H
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
. k3 @* o# G7 j( ~, Z4 Wbegin P_induction arriving
3 ?5 @3 O0 n8 E4 y    clone 1 load to P_pick(A_induct)
5 j0 s9 _. }0 H  Yend最大的系
/ o/ ?: g# ?: J9 w  M2 h+ K) [. q6 T1 A+ S* o
begin P_pick arriving
2 P! N( S3 N! C9 r1 U- U    set A_i to procindex * 10 + 1) C* |" {+ m# m8 h( @3 E
    move into Q_induct(procindex)" P/ e4 E. s$ A+ F
    move into pickaisle.induct(procindex)9 J. g# P6 a4 T, H/ o
    /*check the type of pickaisle.induct(i), for your last problem.*/! M( a% Y. [1 u% K' U5 F
$ u) L3 L; k1 F+ g3 N1 I% n6 n
    while A_i<=30 do begin
9 ^: s! Z4 k+ J, B7 L        travel to pickaisle.con(A_i)4 S3 P' D. }4 V, @! i  z, ]  v4 e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 l; N& @; W1 ?$ a        else wait for 10 sec
' R4 M* n+ A+ z3 s* F" m# _) A        if A_i=A_leave then send to die% m: x- ~; f- U' e  k7 U. k' k
        else inc A_i by 1
+ s% c* f  D; h- A3 _$ i    end8 H( J& I4 }7 ~
end! E# ]; E* {) u  e

# F) a' ^( f. b' i7 e其中的procindex为整形,代表当前process的序号。
8 a2 w3 e" U1 g2 B6 m) Rstation和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-7 19:14 , Processed in 0.018210 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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