设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13917|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) B, M: m3 e- ~* r& w
: s) c- k* Q: l
我的问题是,在每个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. T6 U4 b, m$ {6 }; f# B( i' v$ ^

* @1 G/ B2 G2 e$ f8 r8 Z4 H3 Jbegin P_read arriving5 K$ S+ v- O0 W7 ?, O2 U
    while 1=1 do begin- b6 E( H9 V# f8 x7 @0 b
        read A_tote from "data.txt" with delimiter "\n"7 j2 K7 o% p& Z8 i6 ]. ?
        read A_time from "data.txt" with delimiter "\n"
( I0 h' d# Q& J4 r' d" i; D9 j        read A_leave from "data.txt" with delimiter "\n"5 B* D( I" M- R6 F! J' n. U
        read A_picks from "data.txt" with delimiter "\n"0 A5 x1 s5 x% O9 b& x; b
        set load type to A_tote
  [) F2 z1 K+ g4 \" F& Q1 e: [- X        if A_tote="tote 1" then set A_induct to 1
7 Z5 z" I  T6 \- j2 v. ]' Z        else if A_tote="tote 2" then set A_induct to 2
+ G7 G) Y6 h1 H+ B6 @; C  B& |            else set A_induct to 3   
& D8 O5 o1 N2 R) E2 e4 q% N5 w        set A_i to 0- s2 ?; U6 `, r! z% Q5 \: c' _
        clone 1 load to P_induction( v1 W% l- @0 `6 X; e. ]- C, X
        wait for A_time sec% F- V! a' E9 i* z, _+ ?
    end" L5 U1 J5 {* H1 m7 a
end1 o$ ?$ m, j1 o& G

+ \9 Q4 Z5 N+ P& ubegin P_induction arriving
4 B4 E) v9 n( Z    if A_induct=1 then clone 1 load to P_pick1; y8 ?$ V; S, u& B( y* I9 A
    else if A_induct=2 then clone 1 load to P_pick2
5 V8 |, |; t0 @0 A; b" A- ], {/ Q        else clone 1 load to P_pick3
! m& c6 w4 L/ cend+ m- g2 ]" y8 j

" _* G# `3 ~# a. Sbegin P_pick1 arriving
1 V/ P8 w  ]; L6 N# V0 q    set A_i to 1
1 y2 A( Q) ^. I4 A& x$ A    move into Q_induct1+ C0 x: p2 [7 |7 p8 S+ E6 `
    move into pickaisle.induct1
6 U" l' v- y  Y% a8 \    while A_i<=30 do begin
. n; c  y4 s  d! A' c2 ~# ~; h        travel to pickaisle.con(A_i)
" z+ [  t8 V5 b/ |  ?8 s; {0 X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 i& {( q6 {( l' z- t( Z" Q
        else wait for 10 sec/ V% E/ L' Z$ w
        if A_i=A_leave then send to die, k8 {; R. ~! m, l- P. p
        else inc A_i by 1
4 L& W- k+ a! o    end) d2 u& l& I8 M8 D
end* _) q1 _) u. j

# M5 q9 p/ P. \% U- Dbegin P_pick2 arriving
8 P& }1 T. D1 L: a2 X( _, d4 U    set A_i to 11
# v# l8 ~4 L! l8 _    move into Q_induct2
7 T8 L! _' O* a2 D+ y5 B    move into pickaisle.induct2
4 G  ]0 z* i  B$ U    while A_i<=30 do begin/ I1 E4 [1 p% A8 e8 \2 Y8 m3 s+ x, J
        travel to pickaisle.con(A_i)# T% j3 m* r; N2 _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  i. D* j4 F" M        else wait for 10 sec
( {% U8 K! A+ P/ E7 o+ [5 L        if A_i=A_leave then send to die* w- G' s  }5 H" y8 l( e! `
        else inc A_i by 1
' n" E9 @3 D1 A, Q! m  ]" n( K    end
2 @  ^0 d' C9 @, G+ N$ P7 |0 Vend: h+ `! `; f3 q; N
: N, {. s: g1 v8 e
begin P_pick3 arriving( P4 c% U, K$ ~$ `) n
    set A_i to 21
- t; A( r& j. ?    move into Q_induct3
1 U4 y6 r0 t3 ]  c1 a+ n7 o    move into pickaisle.induct3% ^$ x  B3 g( q! a. B9 p+ S
    while A_i<=30 do begin
% i4 r8 q0 d2 [. B        travel to pickaisle.con(A_i)! ^  p" l& @+ R0 y1 _' _# ^6 z, [* {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 F* B* k# m' H' h        else wait for 10 sec
1 g. `* g) Z& f3 ~8 G0 a1 K        if A_i=A_leave then send to die
' ~/ J( Q" b# E! M- g        else inc A_i by 1
* W# c) `$ v7 s; b( Q    end
0 Y$ S6 B5 q) ], V. `6 g( g6 d. J6 Qend

最佳答案

查看完整内容

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是个什么东东?, z- e2 ]& R! K4 [! ^
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?7 D+ R: P" B6 v4 e

, F% s5 n0 T( y# V* xAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
1 _4 k. s  V( k7 t' ^( k5 P
- H( }  _+ _* [  H+ q) e1 ?另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ _# M$ D8 u$ H! n: A1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ m4 ^9 n7 R5 x; P
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;  a) E" X  o* K0 Y8 u$ p0 D1 \  K
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
2 |! I+ Z: }- g. xbegin P_induction arriving6 V. z4 e) A- x
    clone 1 load to P_pick(A_induct)
2 y) v  W7 W6 r8 S) Z6 Dend最大的系
- s7 f! U$ ?9 |2 R* h: ~" X) b7 q, q1 p
begin P_pick arriving3 J3 {  c- R2 h* W4 S% T
    set A_i to procindex * 10 + 16 \5 t$ F6 R# o% u
    move into Q_induct(procindex)
( C" n' F) J0 y. w4 F% D/ E    move into pickaisle.induct(procindex)6 P& w% f0 W: z- ]/ r# @/ Y& Y
    /*check the type of pickaisle.induct(i), for your last problem.*/
; g% l. O6 a: c/ Z% |" H$ ^( @- x2 A9 y
    while A_i<=30 do begin
# p7 m4 h) w3 x. n/ C  z0 N, D. H        travel to pickaisle.con(A_i)$ }. w& f6 z( M' A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ j. ]6 b7 e. h$ l+ R1 b8 ?8 G: @
        else wait for 10 sec
0 X  B4 m* O: t, ^) T( b        if A_i=A_leave then send to die  f( r) j% n" X& l) t" j7 \3 s
        else inc A_i by 1% ]( @$ P( U8 F6 |
    end
) I% c8 I9 b3 i) ?end  {. \! F5 P& L+ g' K" p/ ?
" i9 y8 w* a# H0 r4 W7 y
其中的procindex为整形,代表当前process的序号。* ?& E- C; A5 k# X% K: l% f
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-5-18 23:32 , Processed in 0.025937 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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