设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12140|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. ^7 b. N' |# i; c0 ~
, d. y5 p4 h; ^0 x) |* ~  Q$ |
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 e6 P' U+ E0 w7 f1 C" s: i' Q! W) N! t' |, q/ d+ H" G
begin P_read arriving9 S) z  ^1 \& L# J
    while 1=1 do begin" W6 G* j+ E- L, ~# W1 f% Z
        read A_tote from "data.txt" with delimiter "\n"3 N/ K3 L0 \, X5 w1 o
        read A_time from "data.txt" with delimiter "\n"
! u. E7 j0 P' {- B# M' {) ^5 Y; S% Z        read A_leave from "data.txt" with delimiter "\n"
$ Q$ r' t0 W. y! z/ U5 J* P1 s/ d        read A_picks from "data.txt" with delimiter "\n"
2 C/ ~6 S0 N% R) v) e        set load type to A_tote
1 t; {7 H# L9 T% I# }4 O        if A_tote="tote 1" then set A_induct to 1
$ a# A$ H3 }9 ]        else if A_tote="tote 2" then set A_induct to 23 C" s- z9 @; A3 U1 P) l. C4 u
            else set A_induct to 3   
+ M8 |9 i) v' W$ \0 K$ X        set A_i to 09 G$ f, `9 [8 s
        clone 1 load to P_induction* Q, k' Y( d1 a; `# m0 [7 M
        wait for A_time sec/ e$ r( u) }4 o  u% s5 L
    end1 x2 t/ ~" Y( j0 g
end
' |8 T: f+ k! D) ]. ~- N1 r) s# Y% M# l
begin P_induction arriving
6 a% |% Z# E  H    if A_induct=1 then clone 1 load to P_pick1
: S, a3 I. v! a. ^3 r+ h    else if A_induct=2 then clone 1 load to P_pick2
& \3 o1 ?& u: l# _        else clone 1 load to P_pick3* F, [7 z, |! C6 e  b3 d
end' Y( S( J* j, k6 X
% ?! O; p4 f- z6 q
begin P_pick1 arriving8 z( {) w* K% o, f7 @0 s, v* x
    set A_i to 1, E+ J5 G+ Q4 Y) E0 G
    move into Q_induct1
5 Y# T2 X5 |4 Q3 Z! w8 t5 S5 G    move into pickaisle.induct1. O( C8 P/ f( @; [% b& h6 n5 F
    while A_i<=30 do begin( u$ P, _6 x0 p  n) e
        travel to pickaisle.con(A_i)' j" m# Y3 x$ H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 X: Z0 V% {2 U        else wait for 10 sec6 O/ J1 m  n' b2 O9 |% ]: {
        if A_i=A_leave then send to die
- H8 d4 s- A- e8 n$ z        else inc A_i by 1
. l* O6 t8 g8 H( q2 W6 \    end; k- D& J& O$ H& d
end. |  Z$ f  v0 f; P) r

) J" H- K$ w& Z, Y* o) h5 }' F6 cbegin P_pick2 arriving0 n1 H- v! f( ]) L' j1 p
    set A_i to 11
3 |9 B$ C2 X+ _+ ]! K: ^) Y    move into Q_induct23 L( ]0 F- D  J) v" ^
    move into pickaisle.induct2
- o( l) n8 a' V4 H# N7 R" s- ?    while A_i<=30 do begin
9 D0 g$ w+ M8 O4 v2 n  o2 F& [        travel to pickaisle.con(A_i)( z& Q, K; A+ i5 t' {' j- ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 M7 r# Z, Q, H( k* h        else wait for 10 sec2 l+ D" x0 d+ c9 B$ e6 {
        if A_i=A_leave then send to die1 w: r3 K2 D% l5 j% z
        else inc A_i by 1
3 G) a/ A6 C6 t( [8 E* C8 U    end4 u! H; S6 C$ t9 i& c; _1 S
end: P2 [% O7 M2 V9 T7 k+ h9 j5 D

% e9 ]) v5 M+ D, V. Fbegin P_pick3 arriving
& I/ {, x; c( E6 G2 d    set A_i to 21. T0 [5 s) F6 g" {
    move into Q_induct3
2 V2 {* _, _4 d4 a$ B4 }9 j    move into pickaisle.induct3+ h( t0 l" n4 I& ]" U5 o% Q  E
    while A_i<=30 do begin
. G8 n0 g' Q# Y4 d" X7 X        travel to pickaisle.con(A_i)
$ m& j/ L( s6 Q6 A& `. r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ X! S! t- E: b/ i# |
        else wait for 10 sec
. S' S# f9 {1 Y4 E2 I, l        if A_i=A_leave then send to die- i0 A# D6 ~" G( P" S  u
        else inc A_i by 12 j3 Y% \5 B  k+ G
    end
- F  r7 D* ~  C; b, o4 Uend

最佳答案

查看完整内容

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是个什么东东?  R+ X8 o6 l6 |# J; m& u
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
8 T$ w$ h, a6 v! u% l$ Z) _! \: k' h! y8 h( N4 ?! Y9 a- z) u' ~
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
3 b& Q& ~. u, u0 ]
/ C# v3 g/ f8 J& N& x& K  R7 i( l另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:1 j( d/ Q' Z+ b( E
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# G7 b% N) x0 W; P( ?: I
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 A6 r& X& `, ?8 ?( v
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; [( N/ n4 [8 M' _
begin P_induction arriving* {2 ]. y7 O7 M! H$ W
    clone 1 load to P_pick(A_induct)7 A. `6 y% M) W6 Q2 j6 V( e- a9 K
end最大的系
% \, y+ U% f7 e. d% B
4 i, ]! d. ]; @' Q& o' kbegin P_pick arriving0 q5 T( }# s- ?
    set A_i to procindex * 10 + 15 Y$ \/ w; D+ W4 I/ `' e
    move into Q_induct(procindex)
$ O) a1 T5 }! I2 z) b9 b( w    move into pickaisle.induct(procindex)
/ T* @! T5 m  }! G$ {! X    /*check the type of pickaisle.induct(i), for your last problem.*/
9 q! C+ I3 L# s, f3 l; F- n4 y9 K- E* g/ p4 v
    while A_i<=30 do begin" J! ~/ j- j% l/ l0 G
        travel to pickaisle.con(A_i)
. I8 E( B; G; W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ T, d, ^" G  W# c0 r        else wait for 10 sec
1 {' ?8 D) C+ H( X' t        if A_i=A_leave then send to die
. K) H/ }# s$ j# Q        else inc A_i by 1- j7 z: d7 t- u+ r! c$ o* x
    end0 y6 Q0 \) @9 d" w/ J, V
end
+ o: C; H4 x9 H& Y1 _/ C% O+ m. x6 U% {' H) O' T0 f5 z/ Y" ^. j
其中的procindex为整形,代表当前process的序号。
8 C/ d( X1 @3 p* d9 u8 Mstation和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, 2025-12-30 16:51 , Processed in 0.015431 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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