设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15316|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 l- i2 P3 W0 T" v8 t( n! [

; F# m5 o& v; d我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ g* H2 _5 s1 _$ u" J( R* q( I4 t  w( j# b' r3 j/ z8 {* Q+ I
begin P_read arriving
6 R4 _% C1 T6 D3 D    while 1=1 do begin' j" P9 P, r. v* i" a
        read A_tote from "data.txt" with delimiter "\n"
4 E1 q$ g/ ]' s) w# ^; q, c/ N        read A_time from "data.txt" with delimiter "\n") ~2 y  m& R$ b: N  U+ o/ b0 k8 q
        read A_leave from "data.txt" with delimiter "\n"/ `& Z1 [/ n; e+ J$ Z
        read A_picks from "data.txt" with delimiter "\n"
& T' r* ?" q3 E6 h. l, T, m        set load type to A_tote. ~2 P, K" S( q! l! g) F1 C- N) D
        if A_tote="tote 1" then set A_induct to 1' H) q/ K: L# ^; k5 q
        else if A_tote="tote 2" then set A_induct to 2
# P3 `1 {7 a8 R2 @            else set A_induct to 3    9 w& f! T) L/ |2 `% U% `
        set A_i to 0
) x' s& O; A7 g$ z        clone 1 load to P_induction! Z, V2 A8 w: _: P
        wait for A_time sec
4 H6 z5 x4 G& d8 C9 R/ x    end7 `3 V; ?* J. g, A- O. C$ _
end
$ @7 P1 `- j7 D0 |0 l5 _: x: S: z; W6 [4 z9 H  n) {* e- P
begin P_induction arriving) W* f, h" s* v' H3 o4 }+ H
    if A_induct=1 then clone 1 load to P_pick14 V9 K% m8 U# [# Z
    else if A_induct=2 then clone 1 load to P_pick2& P% f  f2 v# n/ O
        else clone 1 load to P_pick3: x9 ]1 z; X# f- P0 z
end! U; b1 W1 H0 Y+ s5 c6 W

) X1 V" A/ b+ e8 a. ?! m4 T- c+ H2 bbegin P_pick1 arriving
5 p( w) x2 e( v* p* _    set A_i to 1& o/ f; L/ z( W7 _! H& @  T$ ?
    move into Q_induct1' C3 t" R* S* w" f" O
    move into pickaisle.induct1
2 o$ ?6 A8 r" W; f    while A_i<=30 do begin
/ b+ U! r, w; p  o# T        travel to pickaisle.con(A_i)& A7 C! L8 p3 E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 W$ Q- b- v: a. ?, o        else wait for 10 sec2 X( O8 N8 y. W7 e  L& U
        if A_i=A_leave then send to die7 ]# t& o$ L, ]) _8 N; w. H
        else inc A_i by 15 P; N, }4 ?5 I+ t% B( @- u! O
    end' |  i& j+ ~# _; f
end0 u" m% R" `0 l8 B( v, X

- \9 [: W5 W7 P8 [begin P_pick2 arriving
0 \' M  k) {" d2 q    set A_i to 111 l( w6 A- o3 C9 R! f
    move into Q_induct2
& x0 s9 X0 F5 e6 u    move into pickaisle.induct22 Z" Z  R. T/ y0 b! W3 K
    while A_i<=30 do begin
; l1 K5 Z" P, j        travel to pickaisle.con(A_i)5 k2 a9 f! c# j: J8 N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 T% |: E" \+ E! k" k
        else wait for 10 sec
; h, M: S5 |1 T; U9 H7 b        if A_i=A_leave then send to die0 {% y4 m, J$ M/ C' r* |
        else inc A_i by 1" u; B# _% f% i, h$ d- j
    end% Y- e7 ?4 l. C* V1 `8 B2 \
end
. E8 E8 E, ^' O  ~9 c- m8 l  y5 [- b- s9 }1 \
begin P_pick3 arriving9 k, _, w) h& g; Z# [  j2 l( R8 P
    set A_i to 21& V$ k4 f' h+ p8 S' u4 i
    move into Q_induct3
) G9 o& N8 b) N    move into pickaisle.induct3. j& d! }" Q! M' T: d# V: R
    while A_i<=30 do begin/ K- F! r: I2 a; A7 R9 P0 x2 O
        travel to pickaisle.con(A_i)
  F# G6 Q& Q0 Y( j: V0 w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, q: m- z9 f7 U6 D' C        else wait for 10 sec
2 b4 y, f, b2 h* t4 \8 x0 ]        if A_i=A_leave then send to die
! E; K( |9 p2 C        else inc A_i by 1$ R% [% M! f! Z# f2 F
    end1 l! J# O1 N  l9 h3 s& ]4 n
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是个什么东东?8 ~6 i6 T* j6 e- \9 D0 E: T
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" Y* B( q, Z4 w0 F' K: ?

1 p3 P; C* O  ~2 V/ C# J1 X) iAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 Y% ~& O1 Z$ w3 I  r

) D* \( p3 K0 q: }另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 m+ I7 ^# Q2 Y, \$ c1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
' e) ]; P* A. P8 L2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" |) G' h7 ~3 f! A9 h1 Y- Z3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
2 O: ^* D* ^  F8 g; Dbegin P_induction arriving
9 D; ?8 f" {; V2 J( ]9 m. k. O3 ?    clone 1 load to P_pick(A_induct)
2 N) t) \  q4 ?- c3 {9 M$ k/ oend最大的系9 X' Y3 j  X$ b, w

/ U$ Z6 S3 N" `+ _; s$ W1 _% c+ sbegin P_pick arriving
: a( C( v* R! Y6 v0 k    set A_i to procindex * 10 + 12 t9 n! ^- s6 K4 n4 i7 ^" C; U
    move into Q_induct(procindex)# U7 Q# l) i6 l" p* R- ?/ |5 g# ~! J
    move into pickaisle.induct(procindex)* n3 C! f( C) r5 I
    /*check the type of pickaisle.induct(i), for your last problem.*/5 l: U0 g7 h3 a/ i7 L5 `

$ ?& s- ^+ t2 Z) z; f9 T    while A_i<=30 do begin+ D; k! R* \' u& T- ^3 o
        travel to pickaisle.con(A_i)
* R5 `/ A' H9 s3 m' B2 O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. O1 I! d4 V( X- c3 M        else wait for 10 sec
  I" ?# r3 p3 H: z        if A_i=A_leave then send to die
, A9 g  b8 m4 A  ~& m7 g        else inc A_i by 1
3 v: q8 }& _. l: s  l* @5 _8 B$ t    end
, r0 z8 `0 z: O  Y& Lend) |7 j. j! ~2 b, m
1 G: Y* a; j# k7 R, D: t
其中的procindex为整形,代表当前process的序号。7 k7 S: ]% l/ o( E) T
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-9-1 22:47 , Processed in 0.018764 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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