设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15332|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, _; x9 q9 L# V) R  n7 g( Y/ f" D. A* [9 G- w1 V
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
1 m2 R* t1 x' k9 h8 \! Z, X
, Q' h3 f; A8 m6 l* Ibegin P_read arriving
! h, w8 y& F! ~# T. v    while 1=1 do begin
8 y2 W% e$ J$ ?+ k1 |1 w: n6 j        read A_tote from "data.txt" with delimiter "\n"/ z' _( S2 [5 ?0 F5 b
        read A_time from "data.txt" with delimiter "\n"0 u$ i. W- t- G
        read A_leave from "data.txt" with delimiter "\n"
% ~& S* R1 D# ^$ ?- M# I. B$ v- w1 f        read A_picks from "data.txt" with delimiter "\n"
5 I0 L7 z6 R0 r& {        set load type to A_tote2 O# z9 Z  e! {4 F0 C
        if A_tote="tote 1" then set A_induct to 1
  b% F2 Y2 E8 o! N8 T: o6 [+ u        else if A_tote="tote 2" then set A_induct to 25 s; S% f* I. w& m9 \
            else set A_induct to 3   
/ |4 ]. z' Q6 d* s        set A_i to 0
2 {7 }% `8 j# g7 y6 ^$ J- F        clone 1 load to P_induction
/ K" I) h# F* e6 a  z' h% h- F0 _        wait for A_time sec
9 L) ~  D/ x6 l2 j    end4 _# _9 X. o2 E4 n& t2 J2 W
end
6 [9 a3 f# o& j4 u
- ^# p1 R& `! }7 V" j7 B( Hbegin P_induction arriving
3 b  x: s* {3 H  v! Z* U    if A_induct=1 then clone 1 load to P_pick18 a6 u0 k" I$ [, S6 Q2 I
    else if A_induct=2 then clone 1 load to P_pick2. V3 n1 m4 Y5 F; i7 q( H1 _
        else clone 1 load to P_pick3! |! D$ w  B5 h! `- v" }
end1 B& t3 B/ I2 y* f( g" S8 h5 H

- E1 [+ |9 C0 M7 o' ]begin P_pick1 arriving4 m4 `& G7 n( w5 @& D) Q! [+ {# x1 A
    set A_i to 1$ Y7 o- i: Y8 k+ `
    move into Q_induct1
" [0 U% O# J& x0 w( @+ f# f    move into pickaisle.induct1" e9 t. U( E( Q* V
    while A_i<=30 do begin* p) ^* k* l  y% \# r6 C' H& N% t
        travel to pickaisle.con(A_i)/ P5 p, {# D/ S% W7 @* F& D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; |% e0 q3 k  a' b& _- w        else wait for 10 sec
) N1 O( b' u+ J' _6 _        if A_i=A_leave then send to die
2 ^. U, D5 n1 d        else inc A_i by 19 Q! b( E: H4 w8 q, O
    end$ u- p- E9 _8 V! y8 \
end
8 Y6 ?8 n6 n& U7 l. S9 A" R* p" r( x4 T: V' N+ u7 q" @6 |
begin P_pick2 arriving6 z3 K8 {0 M1 J/ _+ W( I
    set A_i to 11
! f* o$ C/ C" O6 o+ [( l    move into Q_induct21 a; s1 j; t7 `% ~
    move into pickaisle.induct29 [" S& F+ L; h  x, ^& ?
    while A_i<=30 do begin
+ p- M6 |% u: r. W8 c% d! q        travel to pickaisle.con(A_i)
: \# I& C3 z- k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- ]4 U5 P  b8 X% A0 K6 y! [9 s7 S9 l        else wait for 10 sec0 R  {1 Q) {3 g# V) o' j5 c- M
        if A_i=A_leave then send to die
2 y+ [: Q, D& W/ s3 \0 `6 s        else inc A_i by 1
8 ^9 c. [2 O# _, h    end
1 R& t0 C" A; Rend
; L/ [7 p( ]- }: u$ t0 T+ f) _
& B* M3 n4 }0 T  j7 Cbegin P_pick3 arriving1 T3 d2 P4 g) i  t! e$ ]
    set A_i to 211 L7 m. X+ a  d, {; ]
    move into Q_induct32 P; c5 n1 y, C
    move into pickaisle.induct3
% `) {" W6 x* P( E0 x& W    while A_i<=30 do begin( n3 L% \- p8 r$ C+ q: t5 d
        travel to pickaisle.con(A_i)
" S5 L$ r/ X. C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. [0 w! m8 |2 H' m4 y
        else wait for 10 sec
" y' u! Q+ N4 r        if A_i=A_leave then send to die
* B7 T  r/ |) F5 y% ~/ A& q/ S        else inc A_i by 1
: o$ l- k, q/ A% z, Q9 E    end
2 R+ g: d6 @9 ]6 h& Y/ i# send

最佳答案

查看完整内容

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是个什么东东?
3 `! A4 W  V' G9 q+ I4 |7 jmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( s" K- z" p$ C4 F5 z, Z) Z
7 F" W- h% [- }9 f1 E1 c8 qAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" u; J$ o1 |: A2 _6 T
' K. S( `2 n- n9 r
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 @* X" ^6 ^1 l9 r, A1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% n) b' d$ ~2 `" ~1 I6 ?
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;, I* ~7 Y8 r  r1 N$ \' R1 R
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ t3 j1 ?* S7 Y& c$ \4 wbegin P_induction arriving
4 A- s* L! E" F    clone 1 load to P_pick(A_induct)
5 a' q, q, \2 K. G( Rend最大的系
: u- }, c8 D  @
4 j8 i5 F; J* y% d9 R* ibegin P_pick arriving
9 c% F- y% X  a  V" \" K    set A_i to procindex * 10 + 19 m+ u/ y: `( {0 X
    move into Q_induct(procindex)
' R1 C. @$ Z) g    move into pickaisle.induct(procindex)+ L7 s1 P/ p- ^% [+ _
    /*check the type of pickaisle.induct(i), for your last problem.*/8 ], ~4 W: p* ]9 u4 I
' s1 a7 b. |: L
    while A_i<=30 do begin
( [* }5 ]) e# K. {        travel to pickaisle.con(A_i)
9 Z8 `: m; n$ t# q0 A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ z+ f5 N5 V5 }8 r8 L, Z
        else wait for 10 sec$ D2 {2 ~: B" M4 t2 x& K
        if A_i=A_leave then send to die
+ j  [6 x  `3 L9 X* t' x        else inc A_i by 1
" w; B0 s- B6 ^6 C/ L0 J1 N( v) }    end- G. e' j$ ]  \1 ~
end
; H) Z3 ?6 X" y+ R  \; u' z2 t' Y$ s" l# {
其中的procindex为整形,代表当前process的序号。
& z5 A* J* @& gstation和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-9-3 10:08 , Processed in 0.017969 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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