设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14065|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) C2 u. l  l, y1 m. q0 d

; [& n" F# @1 \我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% v# K* a8 v9 i8 V9 ^# n9 s
1 o# B) B2 m! b- ?9 H2 \4 o. U- xbegin P_read arriving
- \+ Y! w( B% z- U- K7 F9 B/ n    while 1=1 do begin2 t( q$ h- @/ m
        read A_tote from "data.txt" with delimiter "\n"* B; ?& t; s6 M' D! S
        read A_time from "data.txt" with delimiter "\n"
- Z; ~+ q! t) A% |) b( q        read A_leave from "data.txt" with delimiter "\n"4 ]1 U( y" g3 r6 j
        read A_picks from "data.txt" with delimiter "\n"
8 X8 h! F" ?+ g0 U5 }* N        set load type to A_tote& a+ m; o+ k) {# t
        if A_tote="tote 1" then set A_induct to 1
5 V0 L' Q" n/ B3 @; ]9 Y9 _        else if A_tote="tote 2" then set A_induct to 2
0 A% p; D  x, [7 E) l" o* Y            else set A_induct to 3   
: K, j5 m8 S7 [1 w7 L. n; V, E7 R        set A_i to 0
( C9 e+ [% @" ~5 G+ G        clone 1 load to P_induction1 w& d# D+ |% e1 k2 O7 r, |( H
        wait for A_time sec- ~9 w3 W. A5 R/ n/ M
    end& i7 g' d# H) f: o
end( U; y9 G  [7 G% r( g% P
8 b7 [- |$ i0 ]4 c$ F( q
begin P_induction arriving
8 X; E& b/ [# j7 A! T    if A_induct=1 then clone 1 load to P_pick1& F' f2 c. ?9 v; E
    else if A_induct=2 then clone 1 load to P_pick29 s# L# M3 W1 w/ p1 M3 q  P6 N
        else clone 1 load to P_pick3
! V- \, g; n5 ~9 ]  Lend
3 ~, O- X( H/ A& o( Y; s; T: k! v) Z0 K; x  q6 D
begin P_pick1 arriving
, V; x- p' ^: L5 x! @' X  i6 w    set A_i to 1+ k' e& b7 U( ~  Z
    move into Q_induct1' K  H  j5 w# b4 ^1 n2 j  u
    move into pickaisle.induct1
! ^! l4 }6 j% m2 a* P) \    while A_i<=30 do begin5 L1 p8 }# i. Z
        travel to pickaisle.con(A_i)* P" w4 Z  Q- p% k* m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 ~0 ~! q( h' w" {  R+ Q        else wait for 10 sec6 e& l2 m4 @; Q. I/ T& m
        if A_i=A_leave then send to die
$ Z; g9 u5 `" f' z. L. P        else inc A_i by 1
* J7 ~0 C' ]4 n' ]    end8 L# \2 s7 T3 T3 M- |
end% T# t. t% |9 M* F! `. Y

7 ~) |1 v) C/ q% i6 M8 fbegin P_pick2 arriving
1 F7 K( k' P+ @5 d# C    set A_i to 11
- t$ U& y' t) c. ?    move into Q_induct2! x& T: p4 q* a. g
    move into pickaisle.induct2
+ K  d3 A- G" w$ \* x0 q    while A_i<=30 do begin
1 n9 Y( \; L% [! X0 B4 z        travel to pickaisle.con(A_i)# u5 \* c1 x( W1 ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 E6 ?( R# P$ z( ~0 V
        else wait for 10 sec$ p! n% x/ S6 T# I& A
        if A_i=A_leave then send to die
1 ?% `" q) _. A/ o        else inc A_i by 14 c; c: Z# q1 e2 Q9 m
    end* u) B6 }: `" l% ^7 g6 o
end
4 i, O3 |5 d; f5 T" B( M9 b+ G1 \2 M$ B1 n' h. T, {
begin P_pick3 arriving& n/ Q3 u9 Z0 a5 |
    set A_i to 214 d, U9 P/ z  \2 W, o2 M( S
    move into Q_induct3( v- w' E. m1 I8 Y0 O
    move into pickaisle.induct3
& X$ l7 C8 O$ I2 L: F) O* U    while A_i<=30 do begin" h$ s; H7 w' S% f# g4 }. ]# |2 f
        travel to pickaisle.con(A_i)
# ^( P  Q+ y  f" E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& G9 c8 c( D3 n8 t        else wait for 10 sec
5 \6 V  l) A* y' t4 }        if A_i=A_leave then send to die
4 G, Q" l5 v; k        else inc A_i by 1
2 m+ H! _) s1 ^! `    end
: `: g- ~$ r% t  F) q0 `" Rend

最佳答案

查看完整内容

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是个什么东东?6 ^" E% V# Y! t2 ^$ F  I) m: b
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& i, \+ M: h! R% J% X7 [! l9 t; L" u0 K% F% j0 j" o
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
4 F$ h3 Q7 D- N* B9 @. c, S: H
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
. T. K: n: ~8 m! M5 x) i" q1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* d6 N, [' ~8 L2 ]& S
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;7 H6 P7 b- H  \$ m+ W+ P
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
4 h( M/ x0 l' ?begin P_induction arriving% p* l' X# m7 Y! u7 n& W1 j/ P) x
    clone 1 load to P_pick(A_induct)
5 i! A4 b9 ]7 \- \* r: T7 U: T' Y, }' @end最大的系$ s2 t3 R4 M# B

" i( t5 }3 z1 C0 hbegin P_pick arriving6 _, A) Z! A0 ?; |, m- ~
    set A_i to procindex * 10 + 1
$ ]# O, g! X. s8 `    move into Q_induct(procindex)5 b0 J- G; f4 [# d' C9 j
    move into pickaisle.induct(procindex)
& P* K2 ?7 x+ f" E2 Z7 s2 B/ X! T, u    /*check the type of pickaisle.induct(i), for your last problem.*/
- Z$ T8 |6 t4 ~. e4 V) P
3 z6 h. f$ e2 E- g" |" w    while A_i<=30 do begin6 [2 A$ r9 A1 @/ Z' D+ W/ ?3 q
        travel to pickaisle.con(A_i)% X1 G: X! w  M: t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; A0 y0 U; x9 s4 _( y4 y
        else wait for 10 sec
) [; d# G/ n: J" v; [6 S5 y; X        if A_i=A_leave then send to die
3 Q, ?4 E# ^, \; [9 `+ \% j        else inc A_i by 1( s0 ~$ ~1 W+ C$ q: z
    end
( ^) |6 _: ?5 c0 Eend/ y2 S+ U: U3 d! E+ e5 J

8 h. c1 V9 _* v- q2 g  ~其中的procindex为整形,代表当前process的序号。
" P8 j& c; @3 ^$ X% W8 H! [+ Estation和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-6-5 00:27 , Processed in 0.016301 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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