设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13572|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ Q4 ^7 \6 m$ i  G" @, E% Y
- F. v" l0 Z9 M+ C
我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 P) \: a, y6 l% c- t/ ?0 H

! J6 W$ [+ Z! J! [6 [9 t; _/ c6 Ybegin P_read arriving
6 T6 @  H$ H! ]1 S$ ?- o    while 1=1 do begin$ z: U( J1 N9 `: u
        read A_tote from "data.txt" with delimiter "\n"
9 _: c) w7 R. N& d, G; O' w        read A_time from "data.txt" with delimiter "\n"# Z  v) U$ p- m4 B) u
        read A_leave from "data.txt" with delimiter "\n"
/ S. [4 n6 g7 w4 b- @" y        read A_picks from "data.txt" with delimiter "\n"$ I, N$ _* i5 I& m! I
        set load type to A_tote. |" O/ M- H9 x. B$ W( C
        if A_tote="tote 1" then set A_induct to 1- ]: _' ?- j  Z& C# O
        else if A_tote="tote 2" then set A_induct to 2
. M/ m! v* j; \6 r            else set A_induct to 3   
- x3 C0 J2 h- W+ @; Y/ f        set A_i to 04 N! _2 B- Z" Y
        clone 1 load to P_induction) V/ a  n0 P2 p+ |; s8 J, U0 `4 u
        wait for A_time sec% ?9 T+ {8 ]4 B8 ?- S
    end
. w0 |! T- B9 v5 x) l6 G& t6 w% Tend: y8 x0 ]. s* q. F

7 W9 d5 i- j# l) }7 Z7 m. Gbegin P_induction arriving9 G& J5 E, O6 G0 l4 {
    if A_induct=1 then clone 1 load to P_pick1
0 C! Y( t6 o' n2 `$ G+ O# B/ L* N    else if A_induct=2 then clone 1 load to P_pick2; }& S, l. {% s/ j
        else clone 1 load to P_pick3
# c& h0 d; z6 ~: n. [4 G1 ^end/ Y4 z, W0 n. f9 I
, M! p4 R8 k* T
begin P_pick1 arriving  @) N6 ~4 f4 i* l4 @( n& h2 Z
    set A_i to 18 [% [3 V0 c3 D. g7 I- o" V
    move into Q_induct1  Z# z: m. Q+ |5 l: _8 @# i9 i
    move into pickaisle.induct1
$ C- c7 w/ @! F9 `& _) T: S    while A_i<=30 do begin2 s( @# ^. C3 [3 z  h% {! V6 _" X
        travel to pickaisle.con(A_i)
9 D7 }) [/ j# x, w0 Z1 F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 X8 c9 L( |  o0 j
        else wait for 10 sec
7 [+ J- M5 Z) k% B1 }        if A_i=A_leave then send to die
- j( i( ^, ?* R: `% a1 C        else inc A_i by 1
% C# y5 L2 J, T; F1 a    end
0 X" r( g3 I9 U5 Qend6 M7 f, v" `7 ^  U" Q2 r
; [" d: ?) T! b, ?! I: b7 R* _
begin P_pick2 arriving
& b# j/ K. y6 h+ o# j7 y& Z    set A_i to 11, @& c: S, R" M8 n& r
    move into Q_induct2$ @; F" D1 D$ \2 K3 g7 }
    move into pickaisle.induct2
+ P  `1 y9 H* X" [    while A_i<=30 do begin
8 N% V" M  O+ Q- \8 J% C' }+ P* _        travel to pickaisle.con(A_i)* f; |5 I* F' e' a. b2 ^, f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 ~, F4 S1 A" Z" {  q: O        else wait for 10 sec4 u8 ?3 n' W/ f$ m
        if A_i=A_leave then send to die
/ n5 h9 L- [& s& N3 {" H        else inc A_i by 1
: i- _- P& t9 ^" ~1 H2 z    end
+ Y9 \( ^. ]9 Y+ v5 kend; _. U+ h: C0 W% ^

1 z2 _; i/ P4 i# T0 D7 W4 Fbegin P_pick3 arriving; N. I- s( @/ l
    set A_i to 21& q) n$ l) M# j( |
    move into Q_induct3, v" d5 c2 Y; k, ~# f
    move into pickaisle.induct3: {4 @  o, C2 p1 a
    while A_i<=30 do begin
* Z0 F1 v- E7 S) r7 _) E        travel to pickaisle.con(A_i)
4 w# E/ D. G9 d9 d: o1 n/ l$ p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ b: h, u0 R4 u! X; X
        else wait for 10 sec
$ O' Z1 U) c9 P3 d2 i4 E5 j        if A_i=A_leave then send to die
  M  \% J/ p  U( X        else inc A_i by 1
2 \( S. `* T+ t, r& _$ i, S2 I    end
: Q7 Z- O4 e: w* v  }# Send

最佳答案

查看完整内容

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是个什么东东?( p* n+ b: _" y+ V: f
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( w! g/ R3 ?8 J8 P
4 w& Y# {, _' I+ SAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 }2 T: l* k7 o
" l% R0 u5 B' m4 c" m1 E
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 e& E. A0 L0 I  h0 m( i6 M
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 m& Q6 N- W! ~2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 V* P- r$ j3 [' o
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
- X) C% C; Y. k' ^6 xbegin P_induction arriving
; O; ]1 j3 [4 x9 S, N% T    clone 1 load to P_pick(A_induct)
3 C' l0 |9 \. Pend最大的系5 @, C; X) d; _, i. X* m

. g# K9 u0 D2 L. b- x% i1 ibegin P_pick arriving- H3 M- K2 m& z+ L
    set A_i to procindex * 10 + 1
4 L# w5 R$ U4 F/ @$ l. p    move into Q_induct(procindex)" U' F. s0 Y/ _$ s: S
    move into pickaisle.induct(procindex)
. Z- Q: j( ?9 q    /*check the type of pickaisle.induct(i), for your last problem.*/+ L9 M8 Z5 G) \3 L7 t  V" [( y
8 P( {& C' W0 x% Q8 M
    while A_i<=30 do begin7 D( ?& d2 b' ?6 R+ F. k9 U! ~. i
        travel to pickaisle.con(A_i)' N" M4 K; \$ ~0 ?6 o8 w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 {- U+ o9 g# w1 }6 t* P1 p- _        else wait for 10 sec/ g! p- s6 U: v* ^4 q: K* Z
        if A_i=A_leave then send to die# y& z: G8 K  H- D
        else inc A_i by 1# q! f2 O& X# i4 ^7 g3 A! j
    end4 \4 F/ J9 b) `7 ]$ W; i( x5 z
end' i. V2 s. @' f6 I% S8 I

1 E0 k8 U/ D' a% b其中的procindex为整形,代表当前process的序号。) a4 a  L2 h/ u
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-4-22 03:49 , Processed in 0.023663 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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