设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13808|回复: 2

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

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

+ M4 {4 M* Y! }' R! e% B8 i我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ n, t9 b( G0 d1 a9 s. k. P  I2 u

$ y8 q; C, [' D+ s% Ibegin P_read arriving
- Q7 ~2 [/ T. g. z    while 1=1 do begin
8 j; w5 ^: |. w  w" m9 K        read A_tote from "data.txt" with delimiter "\n"
6 X3 j" q; Y3 C        read A_time from "data.txt" with delimiter "\n") ]( F8 g5 m9 x+ U
        read A_leave from "data.txt" with delimiter "\n"
* J( ?7 h& v- Q% F. b$ P        read A_picks from "data.txt" with delimiter "\n"
% [& u, y6 [( r; j# w        set load type to A_tote
2 \2 ^- v& b" T- ~        if A_tote="tote 1" then set A_induct to 1
( y- K/ ]1 Q* Z5 a2 T        else if A_tote="tote 2" then set A_induct to 24 z# ^4 W+ j& {9 i1 q% H2 k1 G
            else set A_induct to 3    ( m$ k8 Q1 |8 t% s8 @; T/ |
        set A_i to 0
8 g. N! h, T% @. K        clone 1 load to P_induction
3 Y* L3 b( B, v2 `4 G1 h        wait for A_time sec. V) b3 h1 n6 e  s* R9 i2 c+ }  b) l
    end
$ H0 Z  P) ?. P$ `end3 O  ^% I* H5 C( T7 R9 @6 E

) I- R# K7 m3 ^; Zbegin P_induction arriving
% @9 s* r- X$ Z! |  n- w% }( f    if A_induct=1 then clone 1 load to P_pick11 g1 r8 R  }% Q" ^9 R8 U
    else if A_induct=2 then clone 1 load to P_pick2! @1 l! ~; h6 n0 o
        else clone 1 load to P_pick3
% f- r, u/ T4 e" W+ Lend" T5 `2 q4 y, d4 x) Q  b4 C+ f
; m: O, y. Y* M/ w
begin P_pick1 arriving
+ i4 Z& V1 i; R; L3 m    set A_i to 1) t! f+ u4 o7 G% @
    move into Q_induct1
; K, S* v. u  v' }% ~    move into pickaisle.induct1/ d- Z# {4 w9 V" L5 F
    while A_i<=30 do begin
7 Q* X- j# J* |        travel to pickaisle.con(A_i), R- P' r$ @+ z7 s  ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 W( V) ]$ ]9 {        else wait for 10 sec
3 }- m  V" t1 a) W! M; J; |        if A_i=A_leave then send to die
) Z- s1 N  E" `% V' q        else inc A_i by 1
9 ^' S0 A" I, h4 y4 j    end1 h0 g% o. L6 F0 \+ K! h
end' c9 U/ N( q! o; q4 P0 p; b
/ e! u7 F' v( Z  u) }, |
begin P_pick2 arriving
1 }/ x5 S/ \  T( t    set A_i to 113 T% c3 C" z% T& g( N
    move into Q_induct2
: c2 G% y* b; D+ l  H    move into pickaisle.induct26 r8 {, q; j9 _. g# ]" N4 Q
    while A_i<=30 do begin
- A! |, G9 `# W        travel to pickaisle.con(A_i)) r6 y; C7 j8 \1 J9 `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; v+ ?, D/ W" p' a
        else wait for 10 sec) H% P2 S- I3 o# y# P
        if A_i=A_leave then send to die
" X9 Z2 D6 G# v( T7 A- `        else inc A_i by 15 P  C6 R6 G6 a8 R$ R
    end
% \! X# }- u$ |7 \( I6 X. V8 ]end5 j4 V7 h$ c6 Q; Q* D5 a5 z* b. O

7 E* r  ^/ V% ]& z' J: nbegin P_pick3 arriving
, `: J/ ^2 j7 @( g2 {    set A_i to 21
9 e1 t- ?$ ]' d6 \1 ^    move into Q_induct3: J8 e! B) v! s
    move into pickaisle.induct38 Z9 `2 o* S2 @- L. i0 w
    while A_i<=30 do begin
" S- e$ {+ E& s+ L, B" l" {" k/ p: g        travel to pickaisle.con(A_i)$ G3 ~$ L2 e* v% S3 B0 d# I" c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) X& E0 v& ~1 E        else wait for 10 sec
1 @. o7 a  M0 B+ Y" I  s' e        if A_i=A_leave then send to die
  ^. Q' m9 I8 B* m& S0 R8 t% P        else inc A_i by 1. u/ d" ?: P( e) M7 a7 b
    end
& V6 @5 Y- u) p3 bend

最佳答案

查看完整内容

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是个什么东东?
# l9 v( u9 }* h  r6 Fmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
4 ]8 L5 u7 ~9 v( Y, G! O+ O: j# u' v: L4 Y0 Z6 j' |1 W
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% C" O2 X5 `. r% Z3 l, j, z
7 T+ ]6 f+ R# b, ?" U% d另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:0 E  X+ M- N2 S! V* F+ T# p
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# Z# b7 h! d. T1 Z
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ O! }+ w7 }9 h- @6 u& A
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:! N8 Y: ^/ i3 ^2 U7 `7 j* U1 ^, G
begin P_induction arriving
) J9 P* |7 E6 j0 V* M    clone 1 load to P_pick(A_induct)
; c5 t& ]( z: J$ uend最大的系; H! o7 w" X( q1 e0 ~/ s  J

: \  J9 U# p$ \2 c+ Lbegin P_pick arriving
+ o! u/ B2 z: d. C: X    set A_i to procindex * 10 + 15 O& D6 F$ B  e
    move into Q_induct(procindex)
0 P3 [7 S* O; W8 _- |    move into pickaisle.induct(procindex)
+ n7 \1 T/ x" G& k6 R  G! I    /*check the type of pickaisle.induct(i), for your last problem.*/
6 o6 b. B/ _; C. B/ p0 u0 I( ?8 \7 n! D" L/ J( N
    while A_i<=30 do begin
, H/ A) ?0 @, ~4 m$ ?  T( F! J        travel to pickaisle.con(A_i)8 q4 i3 `* |- U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ G. L0 h* g( ^$ M- I
        else wait for 10 sec: {; _) V) j, q
        if A_i=A_leave then send to die: f. g- B3 q* U" w
        else inc A_i by 1
5 M! ~, x7 i8 [# `    end
" o. n0 R; y: e+ H' d5 q8 ]end5 M# ^$ a+ `6 n2 q3 ?6 Y, B3 k4 d
" z, k6 C4 P7 ~9 O# ?
其中的procindex为整形,代表当前process的序号。- s% T1 k, q4 a! k' l
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-5-6 18:53 , Processed in 0.014887 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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