设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13428|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* Y2 i$ f! g+ J' G. x# {
  G! B0 v8 d, _2 G; L! {- Z# 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中的数值,不知道会不会有什么不妥。
2 F. \; j3 l! Y6 H6 C( C2 p) p
& x2 {  k9 h! Z- n* Abegin P_read arriving
% s1 a4 _7 B  k0 N" A. X8 u    while 1=1 do begin
& ?0 x' l6 X5 I) b0 B" Z, _        read A_tote from "data.txt" with delimiter "\n"" Y5 Z6 E2 K5 L5 t% V4 [
        read A_time from "data.txt" with delimiter "\n"4 Y6 a/ ~6 N6 L1 S  W* o& B; l$ v; e9 U
        read A_leave from "data.txt" with delimiter "\n"1 Z+ \% H0 o: v. H, j
        read A_picks from "data.txt" with delimiter "\n"$ L- b/ I- d. P1 a
        set load type to A_tote
! ~$ Q. k0 l: m8 h, q: E        if A_tote="tote 1" then set A_induct to 11 L9 l) z3 v) w3 Y0 p5 K
        else if A_tote="tote 2" then set A_induct to 2! _( L! D7 s8 Q0 b+ s# E
            else set A_induct to 3    $ ~# t2 R1 {, [, ^
        set A_i to 0
  a% k3 r; |/ Y, l5 H        clone 1 load to P_induction/ V! G8 L) Y, {3 k
        wait for A_time sec. {" D: c. e/ J5 v5 ]4 {0 R: r
    end$ K2 D" f# d+ {; `+ V1 B
end: d( u9 ]  g6 m3 Q$ T

+ o7 T3 t# Y& y2 r2 B9 l# Dbegin P_induction arriving' g2 z2 b' _; A) e1 K* I4 L) d
    if A_induct=1 then clone 1 load to P_pick1; N: s! u2 p" V
    else if A_induct=2 then clone 1 load to P_pick2! a6 ^- i* x- [6 h) N& a
        else clone 1 load to P_pick3
7 y5 [% l' J9 t. u" J0 s! {8 Tend- @0 M* B+ f) |+ y7 W

6 w. g/ Y9 `! O0 I. Mbegin P_pick1 arriving+ j- {" O% f5 l" M
    set A_i to 16 O1 w4 Q- T4 H: N, U
    move into Q_induct1
+ `$ j3 L1 B2 t    move into pickaisle.induct13 h2 e+ w( O$ @+ `4 p6 @! ~
    while A_i<=30 do begin
. i) Y% E: D3 t$ X2 G# q- \        travel to pickaisle.con(A_i)
. H! m! L0 U0 e: W4 B' m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" A1 Q, F. J$ Y) ?% n# e
        else wait for 10 sec2 n. ~; s! W# u" _4 x6 r
        if A_i=A_leave then send to die  h) e) q/ V" y6 Q+ g1 ~
        else inc A_i by 1
- N- e- T! M- ^' q    end5 C% Z9 O7 d1 ^- B
end
2 q9 C$ w$ Q( D2 ~7 S/ A
& }/ J2 Y3 T: g) u3 kbegin P_pick2 arriving
' Z5 w. b. R4 X& h! W. u  s    set A_i to 11
8 H0 H( I7 [3 }) B0 @    move into Q_induct2: ?  j6 c, \1 l* \' r
    move into pickaisle.induct2" |* a5 c1 r$ o/ k3 e
    while A_i<=30 do begin
- W  M9 F! f: r1 K+ c& Q) k        travel to pickaisle.con(A_i)
1 T- ]" f, d" }; x! k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, ]& D9 J/ }$ B  q2 }  C1 P
        else wait for 10 sec
1 F; e2 Y7 n2 E, j' V7 D' H! |        if A_i=A_leave then send to die4 N$ C( J$ U" l
        else inc A_i by 1! I% i+ I: D2 I& f/ p8 g
    end
9 m; y5 e% F! F2 ]$ dend
/ ~8 X% n- n3 F! e& z" K. p: W, s7 Z  i
begin P_pick3 arriving
$ t4 m( U6 |) I) n8 P- H. Q. u    set A_i to 219 C$ E! H& v; D& T
    move into Q_induct39 H) g! U, |; E' j
    move into pickaisle.induct36 J# M& @" R3 o* S1 D) e
    while A_i<=30 do begin0 s" c8 x5 S. l0 Z
        travel to pickaisle.con(A_i); G- F' H6 d" W. i& p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# s2 ~- B2 J- U( E        else wait for 10 sec+ Y. k6 l/ N" ?7 J- r
        if A_i=A_leave then send to die
( e, _, b- j3 s0 F1 l/ g  a        else inc A_i by 16 a7 R. f- T2 Y
    end
  c) a1 J# L. [% ]. v: S/ yend

最佳答案

查看完整内容

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是个什么东东?
* x  k+ a) S5 `4 y9 M4 wmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
: U" z2 J" m$ Z* ?  |/ }' B% i9 a0 o: ~  t# d5 H
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
# |* {8 k* Q/ B" h2 C1 z- Z8 Q
2 S/ Q0 ]: p$ ^  u( s" K另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
+ n0 {1 P5 a& z2 O& X1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
: Q7 A  E+ R) A9 l) C2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;  H% Q! j2 }* c' i4 s# g- @& z5 i5 T
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
9 ^; p# a# y. j5 A0 G3 Tbegin P_induction arriving) e9 F2 m" [% M- L7 @
    clone 1 load to P_pick(A_induct)7 P  n& K+ X5 s9 q# C3 b
end最大的系
9 Z) r2 d- J* k' h; k/ E+ J) S- w5 e' E6 L1 c
begin P_pick arriving
# \7 P0 K9 |. s( k& v    set A_i to procindex * 10 + 16 I# p9 S- r6 E1 t
    move into Q_induct(procindex)
. U8 a1 n; c+ P( |4 g0 m4 L. P    move into pickaisle.induct(procindex)/ q" ]; i& C4 y
    /*check the type of pickaisle.induct(i), for your last problem.*/# p* i( Y3 f: u6 ]% c8 j( c

+ U1 e( u: w, r+ D! V( q  \$ A    while A_i<=30 do begin2 N: d3 U7 R& l( t0 Y( d  L
        travel to pickaisle.con(A_i)
5 C: V9 o0 \6 [" {0 ~3 J6 @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 Q8 f, p' S" O        else wait for 10 sec
3 |3 f1 ~- v" @        if A_i=A_leave then send to die- u# U9 O3 T. s' X
        else inc A_i by 1% X0 V) C  n8 q1 Y8 q( M
    end  y; h6 M2 _) s+ S
end
' J' u: B1 G% h$ m# P  U& I7 O" L' M" B3 O+ r" o% L1 g5 D
其中的procindex为整形,代表当前process的序号。
6 K) ^1 w: |* ~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-4-13 11:03 , Processed in 0.023996 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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