设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15281|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! z9 o, i1 m! L8 s: X" Y! Z: _

1 t# `1 X, Z4 E  Y7 U5 G) b' a我的问题是,在每个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中的数值,不知道会不会有什么不妥。& B. {3 {) Q: D/ y9 P
2 D8 D- r: ?. J6 k
begin P_read arriving
/ ~# Y( @* O& c% K8 i    while 1=1 do begin
, A6 P7 E5 J4 N' q        read A_tote from "data.txt" with delimiter "\n"
0 w; S4 G1 ?( ~  O! `$ u1 }% I        read A_time from "data.txt" with delimiter "\n"5 E2 S  u7 Q# h& ]8 q2 X, B
        read A_leave from "data.txt" with delimiter "\n"7 t7 V; [3 @4 ?& v
        read A_picks from "data.txt" with delimiter "\n"
& [# d# p0 Q) T- r1 n) `, {        set load type to A_tote
* W7 R2 Z4 Y  C. J6 T        if A_tote="tote 1" then set A_induct to 1; F2 S1 V3 E9 Y) W, L* y
        else if A_tote="tote 2" then set A_induct to 22 G9 X0 c8 N/ ~8 g' `
            else set A_induct to 3   
, C* n- I) D; l8 l6 [8 c. y: R        set A_i to 01 l6 k6 I0 I: U! F2 k4 _
        clone 1 load to P_induction! z. e) D4 u8 m% H. c; i4 Y- n# ^
        wait for A_time sec
; j- B/ [2 U' I    end
4 ?& r' V, A* q) R$ g) }, yend% ]5 B$ i, ?0 c

( z: F+ q# J5 c9 E; q! m4 W' W2 ubegin P_induction arriving4 N" A& p- u8 ^4 {( X; p5 f- f
    if A_induct=1 then clone 1 load to P_pick1
+ b2 H2 P- V4 T2 C$ J    else if A_induct=2 then clone 1 load to P_pick24 \2 }/ c) B# P/ B( x7 q
        else clone 1 load to P_pick3
2 a" J* Y: n: _, b, d7 Send
) Y) E4 B1 p7 a+ K+ ^8 D" b4 Q# x: H
begin P_pick1 arriving
6 h# J/ s' K6 F& G3 @  `6 R# ^! ^    set A_i to 1
# M* G- o$ u1 a9 `" ?  Z3 y- S  y    move into Q_induct1, F( V+ z7 E7 W4 z! h0 e8 R
    move into pickaisle.induct1
. {! n4 Q! h* M3 B* C    while A_i<=30 do begin0 _! s: _. W/ E0 i: i- V! P7 ^3 j$ R7 O
        travel to pickaisle.con(A_i)  T& |0 G: Q& z9 n) k+ }: t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! z0 L& |8 m7 Z8 e/ ?' w        else wait for 10 sec
" K" @$ M, W$ a3 v" R        if A_i=A_leave then send to die' r1 t  m* C! s" G% D8 j7 A9 u
        else inc A_i by 1+ S, y- z2 T% a: H
    end
. I  {* A" M; |; }8 [; G7 rend
3 m$ W* ^( w# k2 A+ i& {2 H6 d1 h  {5 l- K* q5 r" U  B. `0 F1 n
begin P_pick2 arriving7 _* {. Z- ?. v" L( S
    set A_i to 11
5 k* G0 Q& M0 b& n2 b    move into Q_induct2# d- r, }' I7 L2 V. d
    move into pickaisle.induct2
- P7 q8 c4 B( }  }    while A_i<=30 do begin6 p7 h/ r# h1 l
        travel to pickaisle.con(A_i)% `, j+ I* j- {: m, x7 R0 {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 m9 f% T! u8 }, ]  ~
        else wait for 10 sec
( ], [: |& B; ?: l        if A_i=A_leave then send to die
' h7 z/ i( N# t. U9 M. [        else inc A_i by 16 u% U$ J1 r$ c" o! Y3 s
    end' {/ S+ _( R0 K9 c) |2 {  w0 q
end
) D9 n+ K" t2 l6 U" |) S5 `7 o: n  u
begin P_pick3 arriving8 Z! y, L! f' Q$ {- B
    set A_i to 21
  @9 V) S5 T* ]6 q: S+ ^. |: \    move into Q_induct3: Y5 ~. S0 s! y
    move into pickaisle.induct3
& K. W: {& o3 W% [$ D" _/ d    while A_i<=30 do begin
' C7 P8 b5 G# n( v# K9 k8 d9 w        travel to pickaisle.con(A_i)
0 u: t8 |( C3 K7 B: T+ d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# z% \1 T' L" @& F/ m' {        else wait for 10 sec
: _: }4 j: ~: ^$ r. U& l( T        if A_i=A_leave then send to die# A+ n$ z' E5 z2 F6 x
        else inc A_i by 1
1 T* h. H- ]. J5 X4 Z% O    end
: X& x  Z  ~/ g) q4 Q% u0 aend

最佳答案

查看完整内容

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是个什么东东?8 h1 [7 Q( F1 p2 g/ @
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, N' ?% q0 G/ \5 |$ p8 K1 j; v! U) u- `, g4 J+ N
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* r9 l) m* O1 {% |2 I1 ]# D/ ^% k2 y, I, T3 _
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, B+ A3 U2 K/ i, E1 h1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 ]2 I& V. z4 u8 I& Q
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 U) [8 ~2 C, }- C3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 a8 @9 s3 B# F" `7 D7 bbegin P_induction arriving
' S" b) E& y% a3 Y0 k9 F( e9 A    clone 1 load to P_pick(A_induct)! H+ d( `# h* t# s
end最大的系
$ G* b+ A( a$ ]. O
% f! Y4 n2 W+ I) bbegin P_pick arriving6 S/ P: I# V% n( F! }
    set A_i to procindex * 10 + 19 I! M2 J* x3 N/ g7 D- |
    move into Q_induct(procindex)7 |; y, T  _6 N) c" z, I
    move into pickaisle.induct(procindex)
5 W/ W( C3 u7 w, U2 m4 X    /*check the type of pickaisle.induct(i), for your last problem.*/
: u( S+ l2 {  ~6 W) S( {: I( E6 N* L+ y5 L, `
    while A_i<=30 do begin+ G& P" h  n# Y1 J3 m
        travel to pickaisle.con(A_i). b) |) i  Q/ y; l7 B3 b) e  L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( w$ J: L( o! N% N" _; r4 r3 \$ E
        else wait for 10 sec
2 D) r8 q3 S8 t/ C, h        if A_i=A_leave then send to die3 V6 U* Z6 q) `( K: R) C
        else inc A_i by 14 Y3 ]9 }: D5 j
    end- G8 e  o+ W4 X# l! Y9 N
end
9 I: H, O8 E: z4 o# J8 e2 T2 D
& o+ |) r6 u' o. `其中的procindex为整形,代表当前process的序号。
* u3 i! v" ^' W' u/ Mstation和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-8-29 20:37 , Processed in 0.019744 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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