设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14293|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 a7 G4 d$ D. k$ m/ ]( y0 A1 f9 O$ ^
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
: Z( D7 v% G$ L
0 Z7 W% [; i+ G: ]8 ^begin P_read arriving7 ~5 ?: J- {2 v" E$ b5 i4 J$ |
    while 1=1 do begin( {  f$ S$ p/ z# c7 v
        read A_tote from "data.txt" with delimiter "\n"
# E+ n% _  j8 K& o; ]3 x* s' C        read A_time from "data.txt" with delimiter "\n"  }- |9 F0 U5 J% H$ N( R2 T
        read A_leave from "data.txt" with delimiter "\n"& K. q' H4 W/ e3 O
        read A_picks from "data.txt" with delimiter "\n"
" A  u: c: o/ |0 G  {% \$ k        set load type to A_tote7 S8 e& e; D0 [
        if A_tote="tote 1" then set A_induct to 1
# i! K& x. |6 X6 q# i% f! V+ e        else if A_tote="tote 2" then set A_induct to 2; h3 s* ~& _% n" K
            else set A_induct to 3    8 _4 R+ C# q9 p  v' ^
        set A_i to 0
: N% }5 ]  u6 o, U        clone 1 load to P_induction5 a! R- v8 ]8 U6 O
        wait for A_time sec3 x( Z' x! b) m  m0 h6 _; z
    end
# f5 L! W% l: c- V* C: A( |end
$ i+ G7 Q" G. x5 A$ i
9 Z6 H/ c7 _! Q5 [! M) U3 c9 jbegin P_induction arriving
. M4 {, d. g. T1 {3 m    if A_induct=1 then clone 1 load to P_pick1
- E+ G7 {7 e6 w- `% _# z5 Y    else if A_induct=2 then clone 1 load to P_pick2
6 d+ Q: X5 g/ |& ?        else clone 1 load to P_pick3
2 C8 j/ V' T9 h! Bend
, B. ^8 _0 K5 f& `7 b/ ?5 K9 _5 q, E9 I# A
begin P_pick1 arriving. l2 n5 G' s2 Z5 ]; H# ]2 C
    set A_i to 1! O, B  i5 }' J/ r  t' |/ w
    move into Q_induct1% _1 @1 P! h- [
    move into pickaisle.induct1& y0 t; i; h9 f- ?% M
    while A_i<=30 do begin6 p' ?0 u4 y% Z6 G1 A$ D+ u" |, s
        travel to pickaisle.con(A_i)
3 ~' B* x6 X& I. @6 q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) v% l* w( n; }7 e  t. t        else wait for 10 sec% b, J# ?7 ]/ L
        if A_i=A_leave then send to die) J/ N% ]8 ]. L
        else inc A_i by 1! J* R$ N; q; I" y  Q7 W
    end
5 X9 _  z; m! J+ ?& Yend7 \9 q7 u. v" x4 ~2 |; N
& }* T; `% H! X# c( T7 n& e7 w
begin P_pick2 arriving
, h6 ?/ a- b1 R' F    set A_i to 11
" H3 s- Z  o. G  t7 Y    move into Q_induct2
. U. z9 C" e" E; c/ y' ], \. j* X    move into pickaisle.induct2
7 t2 @% O9 o: M1 J0 X, }* G% f    while A_i<=30 do begin
% x* L3 H8 f+ B3 _* p, c) u        travel to pickaisle.con(A_i)& O/ G; \& ?2 `6 p& d# s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' J* {% z, E0 d/ \" M+ \: G
        else wait for 10 sec1 E0 O9 l( y7 K* q4 }/ o
        if A_i=A_leave then send to die
, G) d* _6 [: h, J  X6 \        else inc A_i by 1
: a/ E+ X1 n  w3 f+ N9 w/ [* b/ ~; a8 i    end
  o1 I6 m# V2 u8 o7 s2 }; ]2 xend
& p3 h1 l- a9 u1 q. i
4 W! e5 b* g3 `* Y0 s" U# nbegin P_pick3 arriving
6 S) e/ y$ z) c    set A_i to 21
) b/ ?" k' x' ^% e% H% L    move into Q_induct30 `2 ^/ X. j9 F/ c, W7 h
    move into pickaisle.induct3
9 x: E# Q* B6 n5 q0 s    while A_i<=30 do begin; p0 A) d/ S: b/ w
        travel to pickaisle.con(A_i)
* t! p1 F- B% Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 k4 \7 I" M2 O4 u        else wait for 10 sec
, O0 n5 F) b& l( J  A* C        if A_i=A_leave then send to die( @* r/ r, P6 ?( z. N7 m  r
        else inc A_i by 1
7 A2 F2 _( x- k# L) G/ g    end: \! f7 H/ e9 V, h# B# _: V) Z
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是个什么东东?
; f4 l! W. E0 @* R$ xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
7 F3 c: F' x: f5 ~+ Y8 M
7 v# G1 q# j, C# f' }( SAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。! ^' O8 E! p3 [" u7 a

" K% A8 Q; f! y3 V0 ~! h$ E另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 ]4 D2 z* Q0 e" [6 K
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;& Q# E. a! p( z* V1 F% Y6 {9 ^+ u
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 `: e' f4 }) c. R0 M) J! ?0 k3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 m" _  e3 x# K! D) J# Y. z
begin P_induction arriving
) q" Z  i, u4 l$ N: s. `3 Q9 }    clone 1 load to P_pick(A_induct)# W% I1 j; r4 C- K3 O* b
end最大的系. x" Q" m- o7 j0 R
* v8 S8 M( C" v: ?: M: D
begin P_pick arriving
, N2 h# ~! f' m5 W. f& ]4 n    set A_i to procindex * 10 + 1
3 z2 ~( K/ y6 V9 h2 ?( D' D    move into Q_induct(procindex); _4 t/ {( M& z0 Q, p4 x: O- f
    move into pickaisle.induct(procindex)" @) ]" Z) e- K6 O  R$ d, @3 q
    /*check the type of pickaisle.induct(i), for your last problem.*/
1 d5 e5 s6 M- n. l2 `$ c0 y7 s3 U/ b' B) _5 W7 r4 I
    while A_i<=30 do begin
# D2 v* K7 M7 ^        travel to pickaisle.con(A_i)
- R. w! n9 |. T* _- }; _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 B/ h* u# W- y/ |& z% I  w        else wait for 10 sec
  e! [! l7 ^! [( A2 B) d4 B        if A_i=A_leave then send to die
3 T* B. z  n, \5 W+ B9 B- r) u        else inc A_i by 1
. M' j  D9 m! i; G( H    end- \3 P5 {# m3 [
end6 T: h. V. g) z. r

4 `3 b' X6 k% O4 @/ U/ `8 R其中的procindex为整形,代表当前process的序号。
4 {  {8 j$ Q6 c! ystation和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-28 19:56 , Processed in 0.015504 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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