设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15549|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* s9 A7 C& ]! u) A+ ]( N2 R
: N% C! a; Z0 ~5 a+ C
我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 U) F8 \# j3 j, q' g# c, k0 m

" X4 N% t; ^! ~" z( ^3 y* hbegin P_read arriving7 h* P# P1 @9 b) ^" h- Y% P
    while 1=1 do begin
7 U  v- V( ~5 T        read A_tote from "data.txt" with delimiter "\n"" m4 k' k) r% w8 U) f9 _
        read A_time from "data.txt" with delimiter "\n"7 m. l7 C9 n" U0 K* R3 x$ ?! h3 T
        read A_leave from "data.txt" with delimiter "\n"
% ]8 S( X, J& }        read A_picks from "data.txt" with delimiter "\n"3 R% J, d7 v% R0 d, C! `; L
        set load type to A_tote* |) A$ h8 g. y2 |/ X
        if A_tote="tote 1" then set A_induct to 1
3 N2 e$ G  ~& N% U% \# m$ V        else if A_tote="tote 2" then set A_induct to 22 }7 g% y; y5 a! m# K
            else set A_induct to 3   
3 X% J6 a+ Y3 S7 @: U% |$ T2 j# _        set A_i to 0
0 S0 l; Y6 H3 O! `8 l        clone 1 load to P_induction
, c, V8 X7 |& @4 Z2 }, {5 e        wait for A_time sec
4 e; K$ M7 N* ]  k    end  d: [! Z) V$ t: {
end& D' v! X- ?  Z' C  c

8 n# s4 ?, J  f: R1 j3 _( wbegin P_induction arriving, O) s& m7 G; S9 S
    if A_induct=1 then clone 1 load to P_pick1
" \( n8 I0 }* N+ p# U, E5 G    else if A_induct=2 then clone 1 load to P_pick26 m5 S  ]/ E) M& o0 b
        else clone 1 load to P_pick38 }4 o" C1 B2 o* H) a
end+ F6 D4 e( |: [& ~, ?! Y

7 d0 J+ Y" `6 x) j3 G6 F6 Lbegin P_pick1 arriving/ V7 T4 L/ m2 A' }- |
    set A_i to 1
9 ?) g. D+ U, X0 @    move into Q_induct1
2 W3 z7 g# E, S7 `    move into pickaisle.induct1$ E# u, s. o6 h9 q* K, @8 N
    while A_i<=30 do begin
, C' P3 x; o/ ^% }! _. P        travel to pickaisle.con(A_i)6 u4 `# [0 g, b  B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) H) ~; u& p# z4 k  N; d        else wait for 10 sec! ^+ g, d9 l3 ?) W2 O: x6 z
        if A_i=A_leave then send to die
% ]' d* Q% t0 Q! N' V        else inc A_i by 1! p6 {" `# ?  t* Z( A/ W
    end
, }  d# d6 v6 m' F7 cend' Z) _: n# J* ]
6 `% x/ O4 q" H* v  [: c5 r
begin P_pick2 arriving" Q3 e7 d, n  H: W9 H" m
    set A_i to 11
: x7 N6 @8 U9 \    move into Q_induct2/ i  f7 o3 R/ _. d
    move into pickaisle.induct2# {0 f2 g5 o3 Q' q1 J2 G9 ~
    while A_i<=30 do begin
8 T7 Y7 U" Z, u3 A7 L: _, F        travel to pickaisle.con(A_i)# e7 P- z) K- I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 x$ l, D+ }9 M        else wait for 10 sec9 U7 w7 e  P% F% O
        if A_i=A_leave then send to die
8 W0 ~; D: m) X        else inc A_i by 1
4 i+ V* M" \, Q. c. p    end* c/ L! O1 z& w9 @" Y" x
end
' ]0 o8 c% C1 @2 S5 Y# C7 |
3 ~0 ^% H8 u% g! C& L# Ubegin P_pick3 arriving
- Y$ H0 E2 z5 M8 ~    set A_i to 21
( H7 ?( S8 t0 ~! t* K    move into Q_induct3, A$ Q- i7 r) o% W9 o
    move into pickaisle.induct3
' P* O! y* N; {" M5 H    while A_i<=30 do begin
/ N  a. V) b# s! q        travel to pickaisle.con(A_i)9 u. A3 [9 B+ f: r7 q* j4 ~! y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: n4 J8 w% Y! W, n2 i& ], g# H+ \
        else wait for 10 sec, l) L0 u& E4 U$ q4 R2 D# u
        if A_i=A_leave then send to die
4 A! b! d0 S& }% N) _/ y        else inc A_i by 1
. o9 f0 _( g( C' M5 {  ]* G    end
7 |- Y5 D" G4 `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是个什么东东?! B7 I" i6 }0 P. s$ v* X3 X
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
) m2 P* Z0 b/ J% Y- S7 J' C! |4 Z" O1 n) {7 c
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
" H7 F% r. _' k" D/ Y. K6 F* M
; ~, N. `/ o" t' R$ {- I/ V4 i1 u/ o另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:  c2 [) t1 C! o' r, k+ {8 E/ V
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;  e3 ]) J; q8 S7 x! }. [* K4 o
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;/ Y8 p/ \5 C. d2 E5 P1 ?5 t9 q0 }
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
# \' f' A! a& N1 H, j4 [begin P_induction arriving* _7 y3 L6 S: q; m  k
    clone 1 load to P_pick(A_induct)- M# [8 Y6 k  s+ i
end最大的系' F" t" R) k" w- C

2 T' X& ?: F- N5 c- }# P4 |* obegin P_pick arriving
8 D1 \7 A( B( H( P6 j) n/ ]    set A_i to procindex * 10 + 12 |& M7 B/ g- S4 v) f7 o$ ^) P0 {
    move into Q_induct(procindex)
: @, {" m1 y7 i* B' S1 R    move into pickaisle.induct(procindex)
1 ?, z/ @  p8 d: ~* }    /*check the type of pickaisle.induct(i), for your last problem.*/7 b! |7 }2 c% z

! A* {; O; F1 q* l3 V0 M3 O; |    while A_i<=30 do begin+ `0 p3 |& W5 V
        travel to pickaisle.con(A_i)
9 f" a* F# l2 m' D3 ~# g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 W1 y, O# G# N4 L: A' Y+ a1 J        else wait for 10 sec! G# L/ W5 e: w' u7 `/ Z+ F
        if A_i=A_leave then send to die
) z3 V' \/ r# f( s" A- g        else inc A_i by 1# G  ]  |( {7 ]0 a) G: f2 e
    end
5 T2 n" H" E" W: m9 U& [( cend  I( b* N; n" t, B" f2 `

0 p7 |# q! ?% ^7 }' s其中的procindex为整形,代表当前process的序号。
9 s: i7 p; s0 B- z- Y4 @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-19 19:30 , Processed in 0.029070 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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