设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13865|回复: 2

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

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

3 R3 y1 h6 R- J! i7 x我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 W. m3 _5 x& m* D
* C- e5 D! k+ n  `/ ~. X6 ubegin P_read arriving
" R+ V% Q# \' S2 B2 _* U6 G    while 1=1 do begin2 e' v6 Q! q2 B* o+ V0 h
        read A_tote from "data.txt" with delimiter "\n"/ m& S1 r9 j" l( m, P/ [
        read A_time from "data.txt" with delimiter "\n"
, E  I! A! e  C0 g! f        read A_leave from "data.txt" with delimiter "\n", O. C) n) L; |- v# p% p* N. d
        read A_picks from "data.txt" with delimiter "\n"1 z- i. J$ K6 H2 ^) G
        set load type to A_tote
+ [5 c5 ]! d) |2 R, [. M& b        if A_tote="tote 1" then set A_induct to 1
1 ~# Y3 c% V  M& I+ p* G% O        else if A_tote="tote 2" then set A_induct to 2
& ]* E2 m8 ?. t1 H* B/ f2 f            else set A_induct to 3   
7 f! Z1 g, u! G1 U/ r4 W. }        set A_i to 0$ T6 i! `5 a5 q$ a- a1 m
        clone 1 load to P_induction
& E3 n2 B. ]! P9 ^, k& J0 b        wait for A_time sec
  H7 j5 O% f1 g/ G    end1 t  F2 x3 R& ^* p
end
9 Z/ k9 h) a& ?/ n" A6 t/ P% O6 Z8 b6 W
begin P_induction arriving2 e" w( S5 l3 B# z4 x2 s
    if A_induct=1 then clone 1 load to P_pick1
# P# y$ l0 F. W, z+ L  Q' W    else if A_induct=2 then clone 1 load to P_pick2
- w' |8 [# k1 y* N0 l+ _        else clone 1 load to P_pick30 K3 j$ p( Y9 h# L% M5 x
end/ |5 O, t$ N/ J

/ b1 T, y- i+ a8 ~6 Ybegin P_pick1 arriving
7 z9 u3 A- ^4 i7 X8 e4 S) G    set A_i to 1/ y7 J  B+ w& Q4 q2 T7 M  Y3 h
    move into Q_induct1
+ S. s4 Y8 {8 @; Q, N    move into pickaisle.induct1* B7 Q/ d# \  e& P1 R& D- c) O
    while A_i<=30 do begin4 l4 }% K* W# Q) e9 ^) }
        travel to pickaisle.con(A_i)0 t( J% \; M1 f% J* y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 m8 I0 _8 {% c# E3 F
        else wait for 10 sec
: R$ h# r9 b$ Z2 x8 V4 B' _% @        if A_i=A_leave then send to die% K; {5 d) T& s; C/ o2 E5 C6 n
        else inc A_i by 15 p. O- l  H4 C' L
    end
: \! K  e* N/ Q$ y# D) J) Fend& p4 b" h7 e4 s; j6 l, x4 h9 S

9 j* }' z; {9 D& x' Nbegin P_pick2 arriving! C2 q( E9 }9 r, m
    set A_i to 11
6 ^  n; B5 x, I' P' I3 Z9 N% \& [3 T    move into Q_induct2
: b. K* o' G4 _5 |; t! D4 f    move into pickaisle.induct2
, w! ]( E9 z: Q" ~" A8 C& Q( f    while A_i<=30 do begin
0 V1 g  o% U" [+ J; W        travel to pickaisle.con(A_i)
. c6 N/ F) S2 j7 }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; P3 A  j  @3 m. o. R( [# E        else wait for 10 sec
- r* ~" Q! V7 t& f8 `        if A_i=A_leave then send to die6 ?4 Z8 f' O. u$ w
        else inc A_i by 1! T1 j, O' L) ?9 i
    end
; h) ]7 ^- M* \2 C& e" Q4 L- O& @end
1 a8 P' {% ]: s; `. y& p/ @. d  o' [$ B  ~
begin P_pick3 arriving* i( A; j) ^' _0 w3 c
    set A_i to 21
* i: P+ h3 @$ k( y7 r2 c    move into Q_induct3
2 _+ N9 M* s$ i% s9 ^/ r    move into pickaisle.induct3) A/ ]! t5 o1 D% o
    while A_i<=30 do begin) x, t6 }- D# L& a. _* ~+ X
        travel to pickaisle.con(A_i)4 T0 Z; W& q' Z2 N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# n. l8 Z* I- x        else wait for 10 sec' a6 `2 O  l* g
        if A_i=A_leave then send to die
3 \3 ?3 w3 W% Z0 J        else inc A_i by 1! e6 J9 K" v/ q+ U0 Z) l
    end
+ E+ |1 y0 i1 i! k2 S* X$ s3 Lend

最佳答案

查看完整内容

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是个什么东东?
; ?# D5 S' M1 amove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?3 B& `$ V$ m; L9 y2 m8 _7 x* ]
! [* B) w$ `$ ^$ n# R' d
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 X" Q, [) X3 u$ R! a5 \/ x+ E8 q
. e9 z* F$ w+ p( T7 F+ T* B3 M另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 T/ Y# D0 H; q
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% `8 C# }; ?5 |8 ~: T; q
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;  x0 i, F# b# r% N) a
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:! P3 b: R& L3 a" ?$ Q* R7 {4 G
begin P_induction arriving" h) B5 N$ C! R, D3 J2 L
    clone 1 load to P_pick(A_induct)4 u7 `. {) @. U# F) ]+ k& {( p
end最大的系
0 C9 v8 H- \- I; ?: q; c; I6 W0 d! \5 a6 L* h4 b  l
begin P_pick arriving6 Y' w6 V" m& i: U
    set A_i to procindex * 10 + 1( P- M8 r1 B% Q5 `3 ~
    move into Q_induct(procindex)
$ {( u: J5 ]& w9 ?% N    move into pickaisle.induct(procindex)$ T$ s3 l  }2 x0 D' n. U. p
    /*check the type of pickaisle.induct(i), for your last problem.*/7 x' J: c' [- H& w; I! u
3 H1 u; b; f! u; j" D1 A. M! T
    while A_i<=30 do begin
! M! g( k7 e/ C8 r        travel to pickaisle.con(A_i)
0 i) b3 Q5 o, Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 `  a) ]2 Q" U" b7 Q        else wait for 10 sec" K4 w/ D/ @4 x6 N
        if A_i=A_leave then send to die
/ f8 [# ^; y& O* x3 U4 {# M; W' x        else inc A_i by 18 v) L, S6 Q: `, `3 O6 Y# T
    end8 K# `4 {0 ~7 l: B5 h
end! q4 {; O  R& J7 c- d
( R! w: j) P* B3 j' k
其中的procindex为整形,代表当前process的序号。
' E. s9 T6 n+ nstation和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-13 12:40 , Processed in 0.014433 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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