设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12373|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 @/ W# t( b$ n4 r; e

* W! I* j: C6 L; E( r; 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中的数值,不知道会不会有什么不妥。
+ O" I( E6 S* a9 `2 N# [. W/ o3 s
) [) v' p5 @* A1 ^. Cbegin P_read arriving% u4 i/ V% u5 X$ v
    while 1=1 do begin
, ?5 J9 w5 h; f) D9 m        read A_tote from "data.txt" with delimiter "\n"
, y# u7 m+ M, q! c" K- }        read A_time from "data.txt" with delimiter "\n". X. \% F" P* y
        read A_leave from "data.txt" with delimiter "\n"
) k" N9 V# |. _8 s5 {- j) s        read A_picks from "data.txt" with delimiter "\n"
+ u5 P8 {) s, }# D5 ?7 y        set load type to A_tote: I" t, o* w. d8 o* `, @
        if A_tote="tote 1" then set A_induct to 1, `) l" f, b' w/ E2 x6 C
        else if A_tote="tote 2" then set A_induct to 2
' l7 g. G4 n% O            else set A_induct to 3    ) ?8 z1 T" F. R' G9 j$ R# h3 M
        set A_i to 0$ o7 g. n2 y0 b+ O
        clone 1 load to P_induction, N  _3 s8 A3 C$ w) l! r* x
        wait for A_time sec" }/ j/ U# g- z& g; h1 r6 I
    end. g; ^0 M' n8 t& ]& X: ~9 J$ G
end
. v  U6 L4 h5 a: \( U! M' L
6 C! A) Q4 u# M7 T6 b& sbegin P_induction arriving' z0 s3 r4 H$ F$ A' i
    if A_induct=1 then clone 1 load to P_pick1
0 L1 _+ u7 M. Y  y. }( y0 h    else if A_induct=2 then clone 1 load to P_pick2  b1 R" ?; Q3 |3 ?( M
        else clone 1 load to P_pick3) t5 l" x( V! \# G5 k
end
1 ~. B- @5 u' f1 K/ r8 w+ T, E" }' e" A) V. v; H% ?
begin P_pick1 arriving! T" A! B* V. ?9 U; D0 W, Q; q
    set A_i to 1
) n: a5 [1 b7 P7 @. ]3 B    move into Q_induct19 @! z% h$ g& f0 ~& ^3 l4 x6 C
    move into pickaisle.induct1% E4 j; x" I: L: p  W
    while A_i<=30 do begin3 L- ]7 L  @" h. L9 {0 z) X- J
        travel to pickaisle.con(A_i)$ A. L3 u- q9 J& a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& h1 k) T$ k- R
        else wait for 10 sec
0 J1 ^" L- o% T! O( U1 e        if A_i=A_leave then send to die
8 d) J- a$ r) B2 o' Q, s        else inc A_i by 1
3 S  y# H* W6 R    end/ r$ O+ \% w  o/ r" _
end
6 \* {7 u6 N9 L# m  q. b- z; ~3 ]( f- o
begin P_pick2 arriving* e% d* n  R; a* I/ o  @, V( ^0 w
    set A_i to 11% c' k2 _5 Q' G7 x, k
    move into Q_induct2
% \9 _' c3 x8 j4 |/ I, z0 q    move into pickaisle.induct2! F2 n' a" P+ l/ Z
    while A_i<=30 do begin
9 H& V3 a, T# V- b" h        travel to pickaisle.con(A_i). b4 D3 L. q; }8 H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 E( N/ H. Z0 J* ]# \+ ^9 F
        else wait for 10 sec
# m5 O4 E) `' X6 }! q# q$ Z- m8 J+ ?        if A_i=A_leave then send to die+ E" ?2 `$ A8 o6 U# [
        else inc A_i by 1
9 D' l, T+ J2 A. m! {+ e' {    end- e( w: z5 q: g
end  S1 U% h, o0 j2 U/ t
. m3 b8 N0 {0 e+ d- t
begin P_pick3 arriving
$ y9 q  n; u( u6 {    set A_i to 21
& d  x6 O# a7 M- Z/ l7 w    move into Q_induct3: ~$ R9 Q, _8 Q6 x! Z
    move into pickaisle.induct3/ ]4 W, k2 B: i3 K; V. Z8 P0 T
    while A_i<=30 do begin7 ^9 c" h8 ^, F2 E( ?* Z
        travel to pickaisle.con(A_i)2 e( j7 E% s/ N3 w2 w" f3 V! Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* R" T( _% r8 {( F5 I
        else wait for 10 sec- |* q6 l- t+ W6 M8 v' u
        if A_i=A_leave then send to die
' `: z# F# O% k: R        else inc A_i by 1# L2 ?; E: g* X# ~
    end
- g" G# T5 I4 X; B* dend

最佳答案

查看完整内容

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是个什么东东?' o( \% Q+ d: ~" y% n& z
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?* O% G1 P1 J( L9 c

' h2 ?; {: x9 S* ~AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
' ~8 t& N/ R# b# m2 T' r6 q9 ?+ U, N* P
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:9 e7 D  c. @8 G' H, c, d* W
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;. V" e+ }# j& H% w( h
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) i2 l) q9 Y  J1 T2 U3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
2 o% b, Z4 b: H5 @begin P_induction arriving
* E6 H" G1 y& D% }4 W    clone 1 load to P_pick(A_induct)
# C! X: i. S4 @end最大的系
7 b0 U. Q% K2 b5 t! M" r) a  g0 I, `% W* |
begin P_pick arriving
4 O9 v4 b& [6 N* o2 W* P    set A_i to procindex * 10 + 18 T3 c  K! B; l: U; S
    move into Q_induct(procindex)
6 l  D$ u/ j6 W$ m* w% D5 P    move into pickaisle.induct(procindex)
' A7 G5 D( ]$ P% r; j' U& ]    /*check the type of pickaisle.induct(i), for your last problem.*/% {" O" y4 v' g0 {7 {$ ?
# R  c3 q7 f  C8 Z  C
    while A_i<=30 do begin+ @, l. S$ E" h8 {2 q6 d
        travel to pickaisle.con(A_i)# D$ V1 {* b9 n" d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 n3 m' j( y  u1 r        else wait for 10 sec
( q% j0 Q2 o) X7 S        if A_i=A_leave then send to die
& R4 D& h1 N0 Y" |        else inc A_i by 1
1 T; }: y9 F# h3 v+ ^    end
) f9 g1 U* W% [2 f$ Xend
# U7 a6 Q: C. Z+ l, }* @$ P/ i
! t  d1 w" V! j9 v; M其中的procindex为整形,代表当前process的序号。
. m0 S1 N# ~6 f/ _. p1 Vstation和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-1-19 05:17 , Processed in 0.043578 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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