设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12612|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 {6 k* \! G! X5 ]& Q$ ?

) l# I& A; v" m1 U( C7 u9 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中的数值,不知道会不会有什么不妥。
. a1 x; b9 p5 Z8 U, _) L3 }6 q4 S8 m4 `0 k5 x
begin P_read arriving
' y2 p8 {$ x6 @# E    while 1=1 do begin
' H: _" B- p2 a4 C: I1 L: V5 l1 U        read A_tote from "data.txt" with delimiter "\n"
0 k& o3 j5 i5 u        read A_time from "data.txt" with delimiter "\n"9 y' E! K; b2 r
        read A_leave from "data.txt" with delimiter "\n"4 V  d9 l4 G  s$ v  t2 m/ O
        read A_picks from "data.txt" with delimiter "\n"
5 B4 r' N; {6 _2 K8 ?        set load type to A_tote: ]+ h. c" s' |/ n$ p
        if A_tote="tote 1" then set A_induct to 1
2 k% F' X% @2 W( q: P$ r        else if A_tote="tote 2" then set A_induct to 2
, b9 D' w8 ~: n+ d            else set A_induct to 3    7 e% u* R0 M/ q7 `1 M6 Q) d( S* k
        set A_i to 0
, e3 S6 P5 U/ a" u2 _        clone 1 load to P_induction+ C) b; W- c! D  d1 X
        wait for A_time sec
9 G0 D3 N  c8 F  _7 p    end) p* {6 L! H$ m1 Z- q# r. N9 \
end
: Q8 k* |3 l& D8 s4 t; [9 E7 `. E1 }2 c; b& V" z. F7 j
begin P_induction arriving
: @& R, B' `6 Y, M' b0 y    if A_induct=1 then clone 1 load to P_pick1
# s: I" R: @2 m. P6 p( |    else if A_induct=2 then clone 1 load to P_pick29 Z; L) L8 y) b+ [/ v9 I. ~
        else clone 1 load to P_pick35 o$ B5 y& W8 X4 A0 d
end
4 ^; ?, D& U9 `* W! H7 V5 e
+ E0 l" c: `0 u2 ubegin P_pick1 arriving
& C7 m0 a3 m" a    set A_i to 1
" N) h, I$ R2 K" ?; L# ~8 ]9 X    move into Q_induct1
- Q8 q, P! c* t& u( E1 B    move into pickaisle.induct1
% t! \1 L& p9 E3 ?1 N! ^2 a; ~    while A_i<=30 do begin0 U! N8 D9 d7 g
        travel to pickaisle.con(A_i)
- T9 {) m8 b5 ^! J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% |" u4 ~2 n9 P( \3 }
        else wait for 10 sec
' |$ a+ S6 r& O        if A_i=A_leave then send to die* `) B8 u% p3 D, o1 C! L, r
        else inc A_i by 1
" G2 ~% m) T/ W) @, e- G, Z    end
" W9 k4 I: Z" N  X. ?2 vend2 o5 X7 q* I" W' {( h

1 F4 ]/ n) ]7 y' \, ^0 Gbegin P_pick2 arriving
& T) ^8 G6 o& ~" E- h; O% ]  W" w, k    set A_i to 11
/ t% l; I6 C. v0 S. J; B    move into Q_induct2
1 [! ?$ `% e+ A% f    move into pickaisle.induct2% o& J: \5 s' r0 s/ @, b
    while A_i<=30 do begin
$ Y8 j; S, Y* _2 x* c" [        travel to pickaisle.con(A_i)
) X, m- |# E. Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' d. }# r# M! q5 N        else wait for 10 sec
; S/ H3 {. ~* P4 ~% `. k8 _        if A_i=A_leave then send to die% g+ T  p$ G% n$ j
        else inc A_i by 12 g% ?/ l9 I: K4 g
    end- A" K4 e% r$ U
end& X% t6 l' O1 s/ d
  o6 B( H5 K5 H" f0 {1 I
begin P_pick3 arriving
7 u: `, z# q2 ]- x; k    set A_i to 21' H, ?- F+ Z2 H5 t
    move into Q_induct3
! X; l# t8 ?2 t+ S4 X    move into pickaisle.induct34 L! H7 O# S( N# D! e
    while A_i<=30 do begin
/ u. f8 D4 M2 Y& x: _$ q        travel to pickaisle.con(A_i)% }  Y( k" R& N8 ~  F/ F! Q5 S9 R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( t9 ]5 q3 D# f0 t2 \
        else wait for 10 sec
5 y/ G* ]5 r! o/ E$ T        if A_i=A_leave then send to die
# b8 o0 P# S3 K        else inc A_i by 16 c# x' n, t: C0 k1 [
    end
9 M$ r% @$ B4 T: c- U. z1 Qend

最佳答案

查看完整内容

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是个什么东东?  X5 D# O9 i0 n! W
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?' f% \7 P7 c3 j

& i+ z8 A; q" o' XAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
1 E* ~% A# k- R; L2 U6 p, ]8 V. R/ p
6 @2 c0 O2 Q* B另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:" t$ K) i/ p6 T" ?! a0 l
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;/ U  s3 p$ Z* z8 z2 L7 D% e+ \: {
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
& ^0 B; ?0 |( o: G& y: O( |2 {3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ V, q5 c1 s0 k% p) \: S+ I5 h
begin P_induction arriving
4 Q8 b/ O6 X5 N' y0 X' K5 M    clone 1 load to P_pick(A_induct)
! I( U, t9 H4 j1 ^end最大的系: I7 z& S5 F- C4 N3 o

; Q- W. j6 X1 _3 M% f+ N5 T- E6 Nbegin P_pick arriving
5 v1 {# _! S  _+ J    set A_i to procindex * 10 + 1
! b( F/ J+ b6 M- n% @, t9 v5 {    move into Q_induct(procindex)8 u1 c' f8 o; P; N9 H
    move into pickaisle.induct(procindex)# X: G- B  D$ {6 K, y' ^8 t
    /*check the type of pickaisle.induct(i), for your last problem.*/9 q9 _) e# S- k* M# F" M' S
. p% p$ c$ F$ j. O; T3 ?
    while A_i<=30 do begin
! s$ S' h% {* Q5 f! V) l6 B        travel to pickaisle.con(A_i)
8 V2 g! U# M/ Q1 m) X  W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% N' |* Z/ H$ N$ J        else wait for 10 sec
  M1 I1 K3 i5 }+ w% d        if A_i=A_leave then send to die: ^& u9 c" H3 W8 \3 H& e  D9 ]2 v
        else inc A_i by 1; y; G' Q& S( N, V. A; y
    end
7 s% y  d! D. [4 Y* rend
8 p4 f4 x  V! u; E2 t
8 b8 K' C9 H( V# S5 j其中的procindex为整形,代表当前process的序号。& n' v$ k- Q4 D. t9 E
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-2-4 17:07 , Processed in 0.018186 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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