设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12869|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# t% t1 [9 O" Z) k& o% x) c8 S* s  s7 |$ 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中的数值,不知道会不会有什么不妥。3 ~, p% i9 c/ |+ N' _* R! [

0 p  ?. L3 N3 u3 j! `( n& `2 ^  n8 Lbegin P_read arriving+ e2 h$ J. X& p" I  X. u5 A
    while 1=1 do begin
3 E' I+ Y6 E- m        read A_tote from "data.txt" with delimiter "\n"4 t  Y# N" u5 I8 ?, K# a3 {! h8 j8 m
        read A_time from "data.txt" with delimiter "\n"' P1 r+ K/ o7 ^( Q) E- ]
        read A_leave from "data.txt" with delimiter "\n"' z3 Z2 Y$ x, K) r8 y4 J( t- K
        read A_picks from "data.txt" with delimiter "\n"4 w' x# `- V6 f7 i# G% q' H: G  h
        set load type to A_tote7 ]. f% C: O: d* w0 T+ e
        if A_tote="tote 1" then set A_induct to 1
3 u" P  ^  U5 C1 ]2 u0 e9 j        else if A_tote="tote 2" then set A_induct to 2
1 a, T! t6 J  M            else set A_induct to 3   
3 q7 Q; ?& i) K2 v' I( q/ X        set A_i to 0
# u9 ?/ g% l* C  d        clone 1 load to P_induction2 ~1 Y3 u. s4 {' J+ }
        wait for A_time sec7 k; L; v* |# e: _3 ~/ D
    end& |& G+ U2 _+ ]# p% |* B
end9 P2 M6 e" w$ {- G* ]
5 n( G: ^. L* h
begin P_induction arriving
: h. N- o4 n8 ?    if A_induct=1 then clone 1 load to P_pick1/ ]6 `! A. D* V  p9 n
    else if A_induct=2 then clone 1 load to P_pick29 u" o( g8 |5 l# t
        else clone 1 load to P_pick3
( J7 ~+ U( R  ^2 h: Lend
0 h/ |3 |/ l/ W/ B* C/ L! n& ]- {0 e3 a2 I" z7 \! v; ]4 f' r! I
begin P_pick1 arriving. w* c' A* V! f5 y1 _* v# y
    set A_i to 1( v" @2 `: C0 j  C. v  S( ^1 c6 o5 v
    move into Q_induct1
0 a, }# `0 h; V- Y) {/ o    move into pickaisle.induct13 }; Y1 P9 u# Z" Z0 ]: Z9 H8 B( s
    while A_i<=30 do begin
, Z. _7 H" I+ u2 |( i        travel to pickaisle.con(A_i)7 d" n) g1 X2 R9 T/ n9 d9 x- z2 v8 V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 X1 ]: w7 M! U0 l. O        else wait for 10 sec
$ J$ U5 f) Q" H* s6 d9 a        if A_i=A_leave then send to die3 O, n1 S2 x( d( R
        else inc A_i by 1
. |' T  C7 z* E& i/ S6 k$ E    end7 c( A$ [8 O0 \: n7 d7 g0 y+ Q
end
1 h/ `- K" W  u7 N7 e& @6 `5 r# U$ c- ?" y8 ^. m8 G+ y3 U: X8 N; x
begin P_pick2 arriving
& o2 d( f) p$ \( @    set A_i to 11- N$ l9 ]) u2 m4 z
    move into Q_induct2
. w7 f: i" r6 ^! I# W: o    move into pickaisle.induct2
' M5 M$ g; V$ h7 z6 r    while A_i<=30 do begin
5 ~0 R* v1 E( K- f, B, j        travel to pickaisle.con(A_i)
0 g# |2 b* V- l( N! N9 {1 u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ ~7 [1 _9 |7 Y- f; b& W) V0 C        else wait for 10 sec
% d) Q! Q8 h7 ~$ q        if A_i=A_leave then send to die
) N) a6 U9 q4 P7 ~- \) A+ U& C        else inc A_i by 1
/ G/ W& d' E2 w8 [. ]    end
+ Z7 b/ G# }& z6 ?. T& }, kend5 \  d# u  @5 u% s" Z

/ Q$ Y2 r; }# k% I$ Pbegin P_pick3 arriving: _. ^5 Q3 x# `& V; ?+ R
    set A_i to 21/ Z& p; K$ S: T6 C( u0 M
    move into Q_induct3- ~) L4 g1 \) R+ p2 H% r, f
    move into pickaisle.induct3
5 V: B- Q8 S3 X    while A_i<=30 do begin- s( ?4 c: Y% r- A( P
        travel to pickaisle.con(A_i)7 h. A/ h2 B4 w+ o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ x% W1 `! u. f5 E  ^: ~        else wait for 10 sec
) c( y& R* g: c* N* D9 B* X        if A_i=A_leave then send to die
$ M2 q' J4 I$ J2 B6 q3 p2 I7 v) q        else inc A_i by 1
& [, V/ B, o6 w4 ~0 U- }5 A0 j    end# @/ j5 G2 O, X7 m( K
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是个什么东东?5 g, B: T3 E! B7 ~: H
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?# m4 M: v) `9 H4 q& x, D3 j/ y$ t

( ]9 X; z7 d# d" e3 ^8 J* G# k; _AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* Y! t( X+ b% n: W0 e8 ^; p7 F# f2 V3 y  u8 z: `8 B- O9 v" e
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
# r8 }, \3 ^# ^/ l7 C; r8 N1 r6 U1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;- S: R; ]( T3 c5 i; S
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;1 Y% z+ r* j. D" `' K" F/ m
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) a" g0 `/ [3 W+ F" C$ z
begin P_induction arriving1 s; t7 a$ V  g% c4 _
    clone 1 load to P_pick(A_induct)
0 L4 T, }- I- y' Cend最大的系
8 |: j0 k3 Q/ w9 ]7 i! Q- D) L2 w5 o: Z) w4 E1 p; @. j' M( V9 O
begin P_pick arriving1 ]6 C& V, q8 R9 ]/ _! |+ [
    set A_i to procindex * 10 + 1' v$ {0 u/ d' U3 _; g8 M' \2 f: t7 U
    move into Q_induct(procindex)8 }' v4 ]/ y* T! C
    move into pickaisle.induct(procindex)8 n. u, c) B& }- u, r, e5 o8 Z" P% e1 S
    /*check the type of pickaisle.induct(i), for your last problem.*// u/ |3 \; h0 U

; X- S8 b2 n) d& V    while A_i<=30 do begin% r9 @& z7 A* Y( V
        travel to pickaisle.con(A_i)
: x1 m: L' q: R# w! D2 |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, n3 P& A. N$ u0 c  R# O+ b- S$ a% x
        else wait for 10 sec2 w- w" |# k( V' h4 H
        if A_i=A_leave then send to die
6 F; n* p% h/ a3 p9 y/ D8 V        else inc A_i by 1$ o3 H( |3 c* Y9 i
    end: q( _3 h# [6 Y" x6 \5 K
end3 B1 |5 {' `5 C' |
4 U) g$ k+ U( v# Z. B, E
其中的procindex为整形,代表当前process的序号。- z; h8 P# ?; g/ T8 O; a
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-2-26 03:06 , Processed in 0.019861 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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