设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12998|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( h; g1 G9 k; y8 d* U

' N7 n- t5 O/ ?- m5 D1 O# w$ K: E我的问题是,在每个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 D" y5 a4 o4 v: ~, W0 `5 N+ `) h9 T4 M6 R# g. i4 A
begin P_read arriving  H8 E( D* h2 {/ p
    while 1=1 do begin0 V8 L8 j8 S+ {2 F" b1 c8 g
        read A_tote from "data.txt" with delimiter "\n"7 ?- e# B8 Q8 w9 b  u
        read A_time from "data.txt" with delimiter "\n"# d6 }# P  W3 ]0 X: k2 d) s$ C
        read A_leave from "data.txt" with delimiter "\n"& y& u# {! ^- ~' A2 C, W
        read A_picks from "data.txt" with delimiter "\n"
- u2 \, O/ `  p& ?! O  L6 ?! b        set load type to A_tote7 h, a- B. I2 g$ L
        if A_tote="tote 1" then set A_induct to 1
) Y6 K1 ?; T( d" g1 B# b        else if A_tote="tote 2" then set A_induct to 2( k" z1 r( y/ w, X9 t- `, ?
            else set A_induct to 3   
: \+ b# u+ m0 |; Z. O4 f        set A_i to 0. O: l& v  z. Y& J* Y6 M& l$ ~4 _6 n
        clone 1 load to P_induction% g" j* ?1 S* j2 ~9 a2 t
        wait for A_time sec
+ Y+ P& x0 j5 ^0 z8 O4 a    end: I, c9 o" l4 R, e9 n  _' o
end3 P6 ?$ g* Q" x; M
* `4 d9 W  B9 [* w( q
begin P_induction arriving
$ O# x3 E" X' c4 V; F) i; v    if A_induct=1 then clone 1 load to P_pick1- ?8 d0 f9 I6 d+ z
    else if A_induct=2 then clone 1 load to P_pick2
5 {9 Q2 }& c8 m% g3 e* K6 F        else clone 1 load to P_pick34 h2 V% z: f, N; ?0 G" z
end5 O, r/ J" i: F! B3 n/ i
4 M9 _! N/ n3 b; r" [( q$ a3 K1 \8 J
begin P_pick1 arriving
2 h2 u1 f) M2 H7 L1 _: U    set A_i to 1: J- ~. b( [2 b/ j$ e
    move into Q_induct1
0 ?! J  [. n& c+ v+ H! n3 f& A! A    move into pickaisle.induct1) I& v6 C; \% `: N2 j! H; g
    while A_i<=30 do begin7 @2 k; N, c! l  o
        travel to pickaisle.con(A_i)/ c7 l. N* Z1 v+ S- E( n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* f7 s- b- q! z% m" n) x
        else wait for 10 sec
0 h7 l4 H- \& R  E, G) D1 o$ m2 F        if A_i=A_leave then send to die
: O6 `$ j; v3 x! [( w# h2 [$ F        else inc A_i by 1- e% z1 d" S( @6 [" g2 o
    end
: `) j( j4 g' |end! Y6 C* A" o' f: R! B

% u9 Y  v) s6 C1 ?9 sbegin P_pick2 arriving+ n; k& f5 D2 W4 u% E7 T$ ^7 M
    set A_i to 11' I# G# i$ Y& E% H) r0 n; U
    move into Q_induct2+ e$ h. Z' h# l. j2 `* }
    move into pickaisle.induct2
+ p0 z( g) o* J3 @: ^1 r& q. a& ~, a    while A_i<=30 do begin( r8 Q0 B* E8 u% B) P' N
        travel to pickaisle.con(A_i)1 s- ]% |0 [; h. J3 o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 K5 }6 m0 X4 v        else wait for 10 sec$ B4 G% \; o. F1 v3 |, ^4 ~
        if A_i=A_leave then send to die
* d8 T( y0 |8 Q- X8 U! G$ P+ f        else inc A_i by 1) x9 x. i6 h1 d) [  s# T
    end8 R* }, C$ k8 \. m; h6 z% o
end
1 f0 R2 ~/ I; n7 X# u; K- P
* Z4 w% R& f0 k% U7 v( n) _0 I0 _begin P_pick3 arriving
; t! n, B- t# c! ?6 t$ `    set A_i to 21
6 o9 }" Z! D" K5 N    move into Q_induct3# y# t4 c1 p7 f' \, N
    move into pickaisle.induct3
' i4 N0 j7 O2 W; S9 h7 u( |    while A_i<=30 do begin5 x2 X5 H4 g# D$ t9 S
        travel to pickaisle.con(A_i)# a8 x/ w9 Z2 [- R6 q, Z5 x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( `0 _0 f$ L1 G, A
        else wait for 10 sec
# N* j" S2 ]" O/ W# e- N+ ^% V( Y        if A_i=A_leave then send to die
; [6 B! y9 Z& Q0 ~! J5 r7 G1 H        else inc A_i by 12 W6 o0 K% T, D8 {+ S0 C% @) H! C* N
    end
/ Y- V1 @  j3 d" ^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是个什么东东?* d6 t* G7 t9 O$ L9 [& o  ^1 I" q
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& S. a) X" V2 I& f

$ z3 U3 K0 t& u$ |( z4 U8 uAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ {# s2 M8 v: S2 V' n0 N5 {/ t3 r3 O$ E: W$ g2 q
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
9 q1 L) f2 _1 E& N1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
' d0 A# q6 p8 B2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;1 J$ A* f5 B9 ~: O2 }+ i
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 _5 f: h/ @7 h  K# m1 T
begin P_induction arriving
( J2 m2 P# U2 }( X9 c, A    clone 1 load to P_pick(A_induct)
; @; b1 y$ ~  n4 J/ r: o# l) ]end最大的系7 A" l( U+ x. s' S* T3 R+ y' f

; C- Z; [5 F% L# f% tbegin P_pick arriving
7 T, r& Y1 V( w    set A_i to procindex * 10 + 1/ z2 d/ ]& `$ n& P6 g( `
    move into Q_induct(procindex)
" n( n  ]' ]- `& D1 L! k    move into pickaisle.induct(procindex)
+ j0 K8 ?3 z  ?. d    /*check the type of pickaisle.induct(i), for your last problem.*/
5 Y* }" U4 L* r6 N9 w+ w+ z, F- F
8 ]2 G' b2 |$ u4 J% M    while A_i<=30 do begin
' U: |: S/ F6 R5 B* ~& P& p( A        travel to pickaisle.con(A_i)) y* p2 `! {. j0 q. k* c- t" C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 S( b: F0 O$ O5 S; ^0 n3 r. p
        else wait for 10 sec; A9 K* t" S& Z( @6 V& N
        if A_i=A_leave then send to die' m) \% {+ L" a$ F4 X( ^7 a9 e: O
        else inc A_i by 1) X# n; ]4 B9 {) U  d
    end
! D2 n( ~' Q; I4 oend2 b. U* N. {2 c$ y  M! R& i+ f

$ ?6 g* T( N/ T其中的procindex为整形,代表当前process的序号。+ g+ ^4 Z) l& z% e; ?# b* f6 A
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-3-9 17:10 , Processed in 0.018671 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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