设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11513|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 a% E" D" i* _7 R* b3 L. N7 m' u- C: h8 k
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 L2 o9 K3 k0 j6 d3 y3 M) \$ S3 ?7 V& ?' j' R7 F! q2 Y# O
begin P_read arriving* e" i, _7 ~  ]% z% X! D' Y8 h
    while 1=1 do begin! M' c  u" V" I' L& \2 z2 F
        read A_tote from "data.txt" with delimiter "\n"
4 f- ]3 a  q& k- A        read A_time from "data.txt" with delimiter "\n"
7 r1 V4 \( {+ a        read A_leave from "data.txt" with delimiter "\n"2 C2 G& A% V) U
        read A_picks from "data.txt" with delimiter "\n"
8 ?0 E  m2 `7 B3 v        set load type to A_tote
' i! u1 A. L1 e  n        if A_tote="tote 1" then set A_induct to 19 `0 {4 Q; |* }; u6 K. L/ [' U
        else if A_tote="tote 2" then set A_induct to 2
9 O& }+ v* x0 i% D! e6 }' a            else set A_induct to 3   
1 S  c$ @0 h9 B% n2 D        set A_i to 0
! D5 r; \4 F' y2 @0 i0 |! x        clone 1 load to P_induction1 U  y' C: f: [, i
        wait for A_time sec. ~' F$ g7 T2 ~/ }! \
    end+ E1 n4 {/ S8 k, E; H. z1 \0 K6 P
end
$ w" j) f) ~$ z( K1 I* ]% T9 y5 C" O, \
begin P_induction arriving
. {# ~0 O( K. Z' H, n* \  X    if A_induct=1 then clone 1 load to P_pick1
! g2 ^6 U6 c5 E( e    else if A_induct=2 then clone 1 load to P_pick2' [5 y1 F! M$ C2 a( L% v
        else clone 1 load to P_pick3
4 Y6 b8 o& `' @% [end, y' n+ {1 `! s
2 d# n; }  V+ l
begin P_pick1 arriving. F' f5 X% e" c, G
    set A_i to 1
! i! n! i, x) M: c" `    move into Q_induct1
4 o# F. K# N' ?7 T    move into pickaisle.induct1) g) i' v$ R0 x2 N
    while A_i<=30 do begin# e2 b9 u9 b$ h# t1 z" G- @7 D
        travel to pickaisle.con(A_i)
" _+ V. u3 v% D0 E# {1 j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" X5 x+ w( ^2 O& ~8 `8 Y% m7 @        else wait for 10 sec
- u* t6 V% T7 s$ t4 `        if A_i=A_leave then send to die
, Q5 B' ^0 W- {. H& Z        else inc A_i by 1+ V+ p" Q! ~% p( @9 ^
    end
4 k5 j# r' M) [$ w4 K5 r( eend
6 D+ K, {& S' q
/ {/ E: M2 L- q, w3 x+ @begin P_pick2 arriving
" F# G. c) J+ B- Q6 Y: F8 w    set A_i to 113 x3 D! R0 H7 A% j' Z
    move into Q_induct2
$ X/ _8 m0 D! P7 I" Z5 {5 Z    move into pickaisle.induct2' \: f- X8 p  g' j2 v
    while A_i<=30 do begin  z' {# Q% _9 s% C5 d! e/ _
        travel to pickaisle.con(A_i)' j' d) A: ?' j' Q5 Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. ~( c# e+ a8 u4 v4 ?& s7 @: R' s( C
        else wait for 10 sec
. V4 n- d& Y. H& H) H+ p5 g: I; d/ r        if A_i=A_leave then send to die
0 Q0 ?2 e' d/ E* T5 D2 a" ~        else inc A_i by 1
: b+ X) a$ H- c6 N, W. P    end* X5 M7 V% Q$ F1 ^
end
) ]  L% Q, m1 ]+ o; s5 q
9 C- `5 ?2 ?7 u1 H& L( h; n2 G9 Hbegin P_pick3 arriving
, t  _5 J8 t, X6 n' Z; V8 G$ J/ F    set A_i to 21: e& W  f0 r) a* v: x& A
    move into Q_induct30 ~3 w$ ]- V( y" S; }6 O
    move into pickaisle.induct3% {2 }/ ]" ^( J: Y3 u$ Y# m# v
    while A_i<=30 do begin) o9 h* J, Y: l4 X9 F0 b2 W
        travel to pickaisle.con(A_i)3 f8 e7 \; p% [. m( q) |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# Z- c) e) j! a5 \  ^3 m        else wait for 10 sec
' c6 K' x( j8 L! n2 v* D( _* L        if A_i=A_leave then send to die9 x7 p: d4 x3 q5 i) c
        else inc A_i by 1
9 e+ G8 R1 C; r  C9 C    end
' _" V, g3 o* _; T# `# l" C6 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是个什么东东?! n1 g7 Y4 Z2 j* p3 D' k  b4 U3 A' |
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ A3 X( s+ N3 P$ G; v7 O5 o% z6 t0 ~: t
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ a; k6 H9 o/ S* Q) u$ t

5 z! I  |7 M- u5 \/ G9 T另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:* V  O  q. T/ H3 N
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' I* M8 ^- ~8 o, X6 E$ o; C/ q
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;% l0 c: _/ M/ f5 E7 d# p
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- {# Q" x8 d0 t& P+ D( T( ^4 H1 c
begin P_induction arriving+ H. s# V4 o; G9 Y$ g0 ?7 U
    clone 1 load to P_pick(A_induct)7 A* n% o" K: D
end最大的系6 D% Y7 e' C5 A

! ~. w8 K$ z2 ^! abegin P_pick arriving
9 a. {% X- Q4 _    set A_i to procindex * 10 + 1
# K5 D6 Z; m4 y* b    move into Q_induct(procindex)
  O( T. e8 S/ G% k' L    move into pickaisle.induct(procindex)" Q$ Q. g* g+ ]
    /*check the type of pickaisle.induct(i), for your last problem.*/5 X7 w% ?9 b# c5 d4 z4 _4 `

7 Q4 I7 l$ V% c% E    while A_i<=30 do begin( O( c6 b0 n1 A# `. i
        travel to pickaisle.con(A_i)( Q# D4 c1 W" M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% F# n2 \, v! B  d2 {
        else wait for 10 sec
# N4 C( b" Z# X, Y        if A_i=A_leave then send to die; g" `( N- F' U$ K
        else inc A_i by 1
: r! F9 f$ y3 y% D* Z/ f    end0 z. \  O9 v; Z* @2 b$ D. @
end  `$ c0 @2 P, J! J# c

8 J2 b( a1 y' P+ [其中的procindex为整形,代表当前process的序号。
* H# k1 f6 |9 \: E5 Xstation和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-11-17 21:24 , Processed in 0.016058 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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