设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12614|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& K- G* V6 H! b; d
0 J& C) b" D- _
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 G2 E6 u, M1 k9 ]' w, {4 H* Z& F4 W% e( S0 y
begin P_read arriving9 Z6 Q; P6 j* o9 j' w' C1 D, F
    while 1=1 do begin# h; J6 C3 D7 z3 S' i0 d1 v7 B1 G# G% f
        read A_tote from "data.txt" with delimiter "\n"0 G, o$ P$ X  i# q+ A9 K
        read A_time from "data.txt" with delimiter "\n"
; t0 }2 _7 y8 R( v) M9 N; I  ]( i        read A_leave from "data.txt" with delimiter "\n"& U2 w7 o; D; O/ P, t1 b$ v
        read A_picks from "data.txt" with delimiter "\n"
, ]- V6 ^+ t: g& m6 F. z3 g2 _        set load type to A_tote
' z! Z6 _5 T) N7 V) P        if A_tote="tote 1" then set A_induct to 1" b4 w/ g1 c/ h# E7 e, x; {) `0 z
        else if A_tote="tote 2" then set A_induct to 2" k5 Z) q7 N7 j, U7 g& ^3 ^/ X
            else set A_induct to 3   
! Y7 W* g  D+ E& M9 ~        set A_i to 0$ r# G9 k, t0 |
        clone 1 load to P_induction
# M' V, s' }5 p. O6 I/ M" ?& H* ^        wait for A_time sec2 e1 I! ], Z$ N1 r, s
    end
' `$ r9 V% y  c' b' _end. q/ t2 y3 g1 j' f

/ A6 A) z. `* N# {begin P_induction arriving
, G  ^; T- `7 B5 J2 K    if A_induct=1 then clone 1 load to P_pick1
* z; z5 E" [. {. i3 t2 F    else if A_induct=2 then clone 1 load to P_pick2
+ f& D8 f; w! e4 s        else clone 1 load to P_pick3
: j, h: m4 p9 S1 b/ s! Yend- X& Y) l9 e& @1 R# G7 o
# b4 ?& f) B" f4 L5 h
begin P_pick1 arriving
3 Y9 n% u3 p! F$ P. q$ v" k    set A_i to 1) ?- K9 t# F8 l3 p- r
    move into Q_induct1
6 P3 L5 E" V- D) m6 C( r    move into pickaisle.induct1
5 B! M5 A8 K1 [* f, y1 ~" T    while A_i<=30 do begin8 T0 g( D2 U' m8 e- [% Q# L
        travel to pickaisle.con(A_i)
& O- [$ O* e( T' j7 g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) S5 B2 P" \4 q5 |0 l        else wait for 10 sec+ w5 [" Q8 C9 n: M* e
        if A_i=A_leave then send to die9 o$ p8 q2 F' n% ?, w
        else inc A_i by 12 D+ Z+ V7 F: k" R! V9 W
    end
2 L% w6 a. m) H$ ]4 Z2 c0 Yend
+ M1 |- p8 `4 C0 c
: F) A4 `! h, N- i  S: R& }begin P_pick2 arriving
; ?3 ~" |% g( W, F5 k    set A_i to 11
0 l3 v4 H& |5 _3 X6 U    move into Q_induct2
/ Y, f! P% B  ^7 w( O    move into pickaisle.induct2
3 p( M  k. ~7 X( X# ?7 L$ _    while A_i<=30 do begin$ \, K, M6 W  }8 t4 ~. U
        travel to pickaisle.con(A_i)
: b$ q4 A( h5 ?) I; i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 N& q4 B$ c- U# w9 S4 \; R4 w) s, {        else wait for 10 sec: K2 O# u! ?& {. ?3 `: i8 s
        if A_i=A_leave then send to die5 h  y  d' p3 N
        else inc A_i by 1
  _3 |% n( t6 N; D. k7 Q( x7 \# B    end6 a9 f" D, o1 Z; I
end- y  U. N+ \5 i) Y; E
% o$ |( k' ~9 u
begin P_pick3 arriving9 v7 C" ?) }8 s) k/ k" ]9 v
    set A_i to 21  j- L6 e  x; Q. K: l
    move into Q_induct34 f0 k; n% T5 o
    move into pickaisle.induct3
# W2 E8 N8 p$ H( m" d    while A_i<=30 do begin
" \+ p/ _8 D$ l6 j        travel to pickaisle.con(A_i)! q8 I/ o( I2 t- Y4 ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 D3 l. y) ~' h0 r2 q, {# V
        else wait for 10 sec9 K7 f* u6 c# h* s+ j6 y; N4 T
        if A_i=A_leave then send to die
( c9 X  `: W7 Z5 j        else inc A_i by 1$ f$ E3 H0 d( J2 `7 {
    end: U, g- j. L- ?" m+ u1 K4 n2 \; E
end

最佳答案

查看完整内容

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 j' K; A9 p" [; xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
; W4 x- S" Q) f  B( S) j( Q; i. i3 C$ B; Z* m5 K
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) }4 c+ v* u* H- G9 g2 `
" F% y( j& G' l0 L另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  E3 T& k4 R( C1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;6 d4 S- K: Z- \  z; m# ~0 b
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) ]% t- y! E. I. H. `: J- a1 Z3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
9 n2 V& ~* Z% U' D- \0 Z/ Jbegin P_induction arriving9 r1 k! D. W; `* ]7 i4 w6 k; i+ s
    clone 1 load to P_pick(A_induct)
/ e. M( l- O$ Iend最大的系
! @8 P) E: z* b- v  }  l  f: e( Y7 \0 G$ ^
begin P_pick arriving
1 o& d* ]& P* k5 x: R/ r% p    set A_i to procindex * 10 + 1" g# A6 `) E8 Q! v' q* o0 X: \
    move into Q_induct(procindex)6 x% h/ ~) u8 v7 H& L/ k; w
    move into pickaisle.induct(procindex)$ [4 G# G: W5 c! M$ i: e% R& ~
    /*check the type of pickaisle.induct(i), for your last problem.*/
; K" g7 Y* A/ y: v4 S
& r9 n4 z8 M/ V    while A_i<=30 do begin
. c; \* ~- a  ~0 A) |6 D" @/ [2 L        travel to pickaisle.con(A_i)
$ h4 Z8 K7 C4 v" l3 u- X& k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' w: q9 i1 Q) K" g$ _( t        else wait for 10 sec$ L3 u  v% n' O5 u2 ]
        if A_i=A_leave then send to die/ {, R  _. L4 ~/ k" x$ _7 i  e( [# P
        else inc A_i by 11 y# a+ X# i8 U
    end
5 H7 Q/ w& M4 i! [/ Y7 O0 o. K; g% send
  f! K; L5 v% [5 }, a2 J0 e1 R- X. p/ n" L  n
其中的procindex为整形,代表当前process的序号。
% d0 Q" l& \5 \: u, D2 pstation和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-2-5 04:40 , Processed in 0.015822 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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