设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13543|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* C# `' U$ m. f, E0 E! U/ c2 I) Z  M9 K1 E% w7 t/ N* D! |8 Q* D
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 w6 D& \! T( m4 H: b4 Q3 m! w% w" G! B2 v
begin P_read arriving" I+ V7 e  K/ Q% x; n# {: W
    while 1=1 do begin6 G$ a* ~/ o- v0 A# x) \
        read A_tote from "data.txt" with delimiter "\n"
2 t5 R( \3 K" `" W        read A_time from "data.txt" with delimiter "\n"5 F: u3 b8 f% j) s& ]( d
        read A_leave from "data.txt" with delimiter "\n"7 w( A. ^" D# l' a" M6 C) \8 p
        read A_picks from "data.txt" with delimiter "\n"
6 R  R, O/ C* t0 v% b9 o, }, F% Z/ u        set load type to A_tote5 k7 B$ n" O/ D! t# g
        if A_tote="tote 1" then set A_induct to 1
2 {  C. F$ M0 P* b+ V0 ~        else if A_tote="tote 2" then set A_induct to 2
3 j% {- k' T; M' A: r5 ^% I            else set A_induct to 3    . q) d  V- Z  [9 W' k, O7 r
        set A_i to 0; Y" |0 u' t1 L0 U2 S# p: L
        clone 1 load to P_induction( i9 ^/ c1 G# g3 Y
        wait for A_time sec& u7 u  r- E. x: ~% C4 f
    end$ J) z" J7 G% x5 }: o; i3 c9 v
end
* o% U1 k4 l3 ]/ W9 E6 [, n8 a! {4 ~& U) `; t" q9 L0 u
begin P_induction arriving# y. Q+ X* c- G3 t
    if A_induct=1 then clone 1 load to P_pick1- p' y( V9 u- g- G* K
    else if A_induct=2 then clone 1 load to P_pick2, P# {" n8 I+ W
        else clone 1 load to P_pick3% y) m/ ]4 l* u7 k1 [( V( a
end
& \/ [0 f2 u1 X3 M
. D$ H. `8 X, B. ?( I% Zbegin P_pick1 arriving; t3 w" P) }. z
    set A_i to 1% s$ S3 d8 x9 U2 b$ n
    move into Q_induct1
. h# g. B1 k" P$ l5 u1 ^" Z% _    move into pickaisle.induct1
" D* @! ^0 r" F- \1 b8 S    while A_i<=30 do begin
# x- A7 E1 ~, u) V        travel to pickaisle.con(A_i)8 R+ v1 o  H4 t/ \3 b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 X$ q3 U, e" l) k, P% y2 P+ S* |% K
        else wait for 10 sec
' {' e" n9 x7 U9 F        if A_i=A_leave then send to die
. J: x" z: p7 Y* r* l& y) D        else inc A_i by 1
1 O: {3 b. L2 g, N! H0 m+ v3 U    end
' o! w  }- N9 j" l4 xend5 r0 `7 i5 ~. b2 j: l: V; F. A3 _
0 d4 c8 Q% m# B9 ?
begin P_pick2 arriving
& N8 W, g4 \" ~5 J5 t    set A_i to 11& ~" X, y6 t/ J, ~
    move into Q_induct2
; T' e) S0 \5 @9 C9 {% M; t    move into pickaisle.induct2* i. E2 l7 j. A
    while A_i<=30 do begin
) h9 F/ p% s: K4 F1 H        travel to pickaisle.con(A_i)
( j3 i2 S2 E- t+ `% ~8 d1 L2 k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ C1 u+ R; u. b: b7 x- e
        else wait for 10 sec
: M4 H% l* ^/ R0 d% n- q. G' E        if A_i=A_leave then send to die
- s, |" [3 ~4 P3 x; i        else inc A_i by 1" _. [# F3 s, s, J) k. d
    end; r$ L4 Y! t5 W: p/ }
end6 o, `$ c' q+ q9 r
* P! @1 ~3 U0 R) P
begin P_pick3 arriving0 t+ F# S5 O  ~$ Y! \1 {
    set A_i to 21% g, F7 I5 e2 ?* S* e
    move into Q_induct3
2 {8 p  [- g. D9 U+ p    move into pickaisle.induct3
( S# e& L- t4 t" r! x& [    while A_i<=30 do begin
$ J& T* f8 k3 q, y& `& ~* ^        travel to pickaisle.con(A_i)
2 ]* s& M& b8 @" i- ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! t5 o, g% s6 L9 X- X& [
        else wait for 10 sec  C: @1 q3 B6 ?; D7 i1 o# s0 t
        if A_i=A_leave then send to die% _$ \, p: \& d/ L+ o
        else inc A_i by 1; L0 f- \: ]9 B( K% T3 i
    end
9 m0 B/ h. K9 _7 U6 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是个什么东东?
. t" o3 E$ N: G0 Emove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
% P/ L6 c6 L; A9 M' I. t  s! p. |/ T% {" a  i# `
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
+ U  ~6 I( P* I2 L" C* t! t/ [: b( }8 \5 d. r# U
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:! Y% P7 B4 b; l6 |% u8 n- ~9 i1 W& A( U
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;+ q+ J( J6 m4 u- q( k( T
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
! N* S6 a. ^) d, C) H- K' U3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:9 _7 s: Y4 N6 @! k, k
begin P_induction arriving
0 E; x2 y8 Q& S0 V    clone 1 load to P_pick(A_induct). D3 q: z( }: C+ i3 l3 k) u4 u
end最大的系
. u, o5 [2 f( {7 g. o' i" n
; t7 P: Z( M4 F8 J. B$ Q1 @7 X+ ubegin P_pick arriving$ T$ l+ g$ f$ |! s
    set A_i to procindex * 10 + 1+ \# P; u7 s) n- J! [5 N
    move into Q_induct(procindex)7 y/ y) |! Y0 H; ?& `: r3 ^: @
    move into pickaisle.induct(procindex)/ d6 P. m; p9 X. f
    /*check the type of pickaisle.induct(i), for your last problem.*/  ^/ r7 [; \) n4 r6 A5 [' H
! A! T- `4 m) W( L6 {5 `* r
    while A_i<=30 do begin1 Q. v; R8 s. d
        travel to pickaisle.con(A_i); F( T. |7 x$ e4 o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- A, x# S: d% l: v* {
        else wait for 10 sec
' x$ f, n, v' N( F8 N$ M! c        if A_i=A_leave then send to die0 y8 t/ \+ S& o1 i; E* A/ J9 {7 R
        else inc A_i by 1
2 N1 K" C9 K* v! G/ P    end- ~& E' [: n8 N1 u5 b7 @/ ~$ y& r5 c
end
! r$ L8 R1 x, r  S  g
! h4 x' L1 E9 a" |3 k5 b+ N% t: P- U其中的procindex为整形,代表当前process的序号。1 i( ^- 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-4-20 16:54 , Processed in 0.016229 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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