设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15362|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" a, Z/ F6 W, l& J  f" p* P3 y' Z. [3 s2 `0 U, Z+ M5 D" S
我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 E9 x$ p! w; h9 q8 }) E" }1 v

, g: u) e: i: |4 X6 N* ~begin P_read arriving* z! I& I8 P  R& e. m! A3 |
    while 1=1 do begin9 c6 R1 ^) b" A! Z* M% R  E
        read A_tote from "data.txt" with delimiter "\n"
) {9 z: p9 ?! E7 t6 w        read A_time from "data.txt" with delimiter "\n"# @: I( G( @; t3 R3 J  X
        read A_leave from "data.txt" with delimiter "\n"
. q: B3 V9 n+ Y& Y  {; t        read A_picks from "data.txt" with delimiter "\n"5 H5 Q' R8 X" x5 v5 n5 U
        set load type to A_tote
' `# E5 y! ]! ]        if A_tote="tote 1" then set A_induct to 1
7 u% y8 y# Q, }, g- j+ h# t% V        else if A_tote="tote 2" then set A_induct to 26 G" v8 ^& }+ n; R
            else set A_induct to 3   
1 H* K6 G9 ?$ |        set A_i to 0% S- j; \$ X- _& B
        clone 1 load to P_induction! ~/ p$ \, N: c2 U4 t
        wait for A_time sec
8 Z- X( ]# j7 m# ^8 {& h    end" I" W! R# Q5 A8 O$ I$ a& `
end
- L9 j9 X$ c3 Y. U! F6 C$ I/ ?! B$ k  \0 Q, \- N$ d- C/ _
begin P_induction arriving  ~4 g' n5 ]6 |" k' w7 r! A. T
    if A_induct=1 then clone 1 load to P_pick1$ _- Q1 E& \! A% X- E& H
    else if A_induct=2 then clone 1 load to P_pick2
) A$ G; d/ F7 x# ]( A        else clone 1 load to P_pick3: A; b6 i: s0 Y) [) E6 v
end
' ^; S) \+ ]( U2 O7 `- y+ ~9 c8 b0 n8 F3 y
begin P_pick1 arriving
+ J& y0 y2 N. m- P+ Q5 K- @+ [9 n8 m( L    set A_i to 1
+ t7 C6 v0 r9 L/ y* q( M    move into Q_induct1
3 Q4 i6 ~% }' l4 R, L    move into pickaisle.induct1
# N% c2 ?: n; O# k) w& g    while A_i<=30 do begin
/ @4 F7 X2 ^# j" c- [        travel to pickaisle.con(A_i)0 y2 x9 W8 t% |+ H( G: }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 h2 M1 p( c$ n, a
        else wait for 10 sec
5 ]; Z7 H# O! k1 G7 z        if A_i=A_leave then send to die
2 m$ u' A& [, s5 n5 K- B! J( D        else inc A_i by 16 e2 f3 P& R6 {8 D  p: {
    end
7 t9 }2 U! P) J7 N0 yend' w  `) Z5 r6 t

" U' w: b# E7 abegin P_pick2 arriving# e0 u' J0 N1 A' I& t) y) I
    set A_i to 11
' t) L( y. C& ]6 _    move into Q_induct2  S6 i. i1 _: h1 |4 X
    move into pickaisle.induct2
- c' ?- t/ B2 m3 d/ x    while A_i<=30 do begin/ ?3 F, k9 O" [& W  X- ^6 ?4 x
        travel to pickaisle.con(A_i)
$ k- ?/ I, z4 s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) u1 ~! m! r* E- M        else wait for 10 sec
' s0 s" x1 F% X9 f+ N        if A_i=A_leave then send to die
; y1 K* c) O9 {" m3 a        else inc A_i by 1" `" S# }& K8 A- i1 d5 ~. Y1 L
    end' \2 |+ l2 a7 ?% I* e: [
end0 X0 s, l% e! n& r+ s1 _1 f
9 H3 v( Z" o) I3 x* e* `
begin P_pick3 arriving% p2 e# b. m4 m- q  I
    set A_i to 21
' X# H8 m9 ?2 s7 N    move into Q_induct3
1 m) a. p7 D( y) Y; J. p" b    move into pickaisle.induct3
5 P! c. H8 N$ g; K4 H    while A_i<=30 do begin
+ @1 j+ ]4 i" U        travel to pickaisle.con(A_i)' s/ k4 F$ }5 R- E: J6 `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 t# Y/ V) v4 D2 G/ }$ q' Y
        else wait for 10 sec) \4 U6 x/ `/ O! M3 f; j
        if A_i=A_leave then send to die+ M; Z( x/ M6 P
        else inc A_i by 1
- |& A& v% e9 Q# V+ Q$ ?+ q- @    end2 q! `% X' C7 i" {2 J  Y
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是个什么东东?% k0 c- l  K( {; J5 G% b
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" `0 z( }+ [6 y. I, E# {
4 M$ H( P/ f% i4 d$ ^% o; VAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ V, \$ e* T5 \. O. `/ x" e
0 u# s7 B& [5 c
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: |6 c; M" O: e) a8 w; M
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;6 P1 m3 _+ i: i6 ~! J
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;, ^( R! r6 n* n8 O' }% _
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 O+ O8 G1 k* B1 r: z
begin P_induction arriving
1 _0 g8 @  e5 F1 q3 T( Q3 |    clone 1 load to P_pick(A_induct)
& F7 z1 N' n* A) f9 X- ~end最大的系
3 c$ t- Z6 a6 \8 y" Z9 P7 K9 N5 `( E" d
begin P_pick arriving
5 o3 {& Q3 @4 t2 {& s! @/ ?1 k* G* @7 J    set A_i to procindex * 10 + 1' p% r; H( b. S; h. c) D* N
    move into Q_induct(procindex)0 `# L( ]% o0 V2 B% b+ n4 o9 r
    move into pickaisle.induct(procindex), z- |* w( M. |" n: x" Q
    /*check the type of pickaisle.induct(i), for your last problem.*/( R$ ?! q% f6 E5 u5 X

' \5 b( G4 g7 O% V2 u" t+ F: B0 V    while A_i<=30 do begin5 K# ~+ i# \7 R0 `2 b+ R0 D
        travel to pickaisle.con(A_i)5 L9 K% {% W' w; |# n3 T( l, c  d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 J0 S3 j6 Z: d
        else wait for 10 sec
% z, z: S5 S( X+ \" T        if A_i=A_leave then send to die0 a3 c& Y8 [9 a$ K2 p# I9 X
        else inc A_i by 1
; J( U" |/ i& |7 @2 E/ r    end2 x# j5 k) C% e4 e6 a
end: W6 [# m7 G! \0 e9 m: Q6 T* ~$ j9 _
  `, c/ u1 f6 @3 a* }  E
其中的procindex为整形,代表当前process的序号。
# o7 Z$ F5 {  K8 h0 qstation和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-5 10:56 , Processed in 0.017752 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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