设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15648|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, Y5 P; t  V7 K! F4 V4 U  y
; n* K$ {+ g0 X' n0 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中的数值,不知道会不会有什么不妥。
8 V) @; ^/ C9 y! w. q7 [, w
  t& J, _0 n# O" D* Fbegin P_read arriving: w# f" q( y/ D% \
    while 1=1 do begin6 U5 [4 m; P0 N; ^5 D3 F
        read A_tote from "data.txt" with delimiter "\n"7 f' ^' G! @# e' e0 [) e+ m
        read A_time from "data.txt" with delimiter "\n"
, j- g  @) G* N6 [. s        read A_leave from "data.txt" with delimiter "\n"
, S! y( \' d2 `  u7 n1 U+ j/ [# ?: k; v        read A_picks from "data.txt" with delimiter "\n"( h, c* Q$ ]& z) ~
        set load type to A_tote
/ k! L2 J. m. S4 |; S' N        if A_tote="tote 1" then set A_induct to 1
: o) T% q; v; {% g  s, Q        else if A_tote="tote 2" then set A_induct to 2
5 h5 _7 v* N3 ~; C% x9 ~" ~            else set A_induct to 3   
5 B% {& S% k# k1 ^        set A_i to 0' p# O9 p( J2 b4 s' H
        clone 1 load to P_induction
( K: f9 M: p- D: ^9 ~$ v        wait for A_time sec
, `4 v! H. C9 Z: e& @  s    end; B0 ?: K6 {* v1 Y
end
9 j* y8 t5 Z/ D9 f% a, P7 T" G: z. a* {3 Z4 R" o
begin P_induction arriving+ m* }" |, q2 u/ M' m  T
    if A_induct=1 then clone 1 load to P_pick1( k& ]2 d( A9 P0 y. t; z/ |* {
    else if A_induct=2 then clone 1 load to P_pick2: b' ~7 \: N% w9 Z( k
        else clone 1 load to P_pick3+ T6 e" Y2 Z- W  U# Z
end; m5 z) e4 c; t7 R7 k+ X

0 \# c+ S7 H/ W- V% @9 s! ^8 ebegin P_pick1 arriving
1 }# j# M6 H# `% @( {7 U    set A_i to 1
- `6 s/ Q# u9 J$ V# B    move into Q_induct1
& G7 ]5 L. X8 z    move into pickaisle.induct1( {; u0 H9 `$ D9 n! G& s
    while A_i<=30 do begin
9 U, F4 u% M( a( S# r* ^. p        travel to pickaisle.con(A_i)
# L$ A4 q. X7 s0 S6 p. ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) p' y6 p. }2 C: ~6 _; f
        else wait for 10 sec
! m/ h4 ~' \. c8 b' m0 {& C( L        if A_i=A_leave then send to die% U0 I; Q5 k. V! \8 a" H3 d
        else inc A_i by 1
: O( b/ s& G4 w5 j9 u( T    end
" w; D, p0 t$ @end: _) r- W( q8 k5 A$ m
# x" H# u6 A6 s: t
begin P_pick2 arriving) s, `5 f! Y8 E& ?* D) ^& F
    set A_i to 11
) K8 T! |7 V# s/ {: X    move into Q_induct2
( N( w* a) b' C& K& Z1 D: `    move into pickaisle.induct2$ {4 a2 y) x( z: D. o
    while A_i<=30 do begin
: f4 H! e4 T! m7 [7 c        travel to pickaisle.con(A_i)) Y: a9 C/ Q- P/ \9 T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' |, q) z8 p& {- ?) Y+ |- J6 c8 i        else wait for 10 sec- t# g- D+ t- n+ G* S
        if A_i=A_leave then send to die, k8 }: V" O0 v, S
        else inc A_i by 14 G7 C+ l3 x5 }" `! U
    end
8 Z) Y% v* c1 x6 N9 w- D# m9 xend
, g  u  j/ q- `
  ~+ }8 W# m6 m3 }: V2 abegin P_pick3 arriving- R; `" t5 O; t9 @8 F& @2 \
    set A_i to 21
+ G# a0 n% R6 G. B    move into Q_induct3
6 `* V5 x) M+ y/ B% K    move into pickaisle.induct3, w8 t* j- z1 r
    while A_i<=30 do begin+ _# C8 f3 h' |$ [/ g6 v
        travel to pickaisle.con(A_i)
$ B4 s$ X; S. [3 P  q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ _# m+ J+ Q2 d! q        else wait for 10 sec1 l/ m# H, c; Y2 A  M2 U
        if A_i=A_leave then send to die
' J' E  m4 x3 @# J8 H        else inc A_i by 1! @  V( w4 K$ G& ~. e
    end
8 A" `. i7 y3 v1 T  _6 S1 Kend

最佳答案

查看完整内容

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是个什么东东?. O* _( z* B6 t5 g$ s( S
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?+ U2 z! L2 M1 C! p0 J3 b& V

0 L$ I+ p1 X1 A0 B$ h! ?: BAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 n5 M0 B- m) O5 s! k
8 Q: O. [8 m- x. p: K+ n  x另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:6 `# c8 g+ O3 h% O( ~1 f
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
* t9 a+ V$ C3 d5 v, E: w9 Z/ l2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 a" t# d. r# [9 D" D3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
: a* D  U0 Q+ O) U3 R  R0 obegin P_induction arriving( C, L1 ^6 D' B; L
    clone 1 load to P_pick(A_induct)
# j# G7 ?. ^$ v5 ~( @6 a5 q& M% z3 `end最大的系! j$ M' x# j" `- G

+ F/ a6 U; R, W0 S6 [9 pbegin P_pick arriving( a$ R& T/ v* Z5 F# F4 U- N7 Q9 Y
    set A_i to procindex * 10 + 1
9 \* a! u0 p& G    move into Q_induct(procindex)
6 d; m' ?# [2 e    move into pickaisle.induct(procindex); e, y; m) J  s6 u
    /*check the type of pickaisle.induct(i), for your last problem.*/
: L  R) o% i; v3 a$ u1 ?% U& m7 U' K& t7 O6 ~8 B
    while A_i<=30 do begin
0 \+ @1 D8 p, h1 A# A! a/ d1 S5 R        travel to pickaisle.con(A_i)% Y* Z, E0 i9 a" p3 T4 I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- d! ?* P/ B! W6 `' m) t% N5 D" m        else wait for 10 sec  E7 f6 x, c. t0 s7 E
        if A_i=A_leave then send to die
: Q% d4 n- {: C  `& B7 q: j        else inc A_i by 1
4 \4 n- g# c4 Z6 K1 x    end
2 P8 Q0 p7 B* N% Y; {2 s. C+ Gend  y- a! D+ W  e1 B3 n# ]

8 p+ G8 p5 [6 i* v1 L% v( a1 q其中的procindex为整形,代表当前process的序号。# c2 ~" A, W9 Y% h
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-9-24 02:53 , Processed in 0.019674 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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