设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12261|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& Q( ?% T- ?1 Z5 ?: R8 U
- }2 o6 g# O* a7 y: 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中的数值,不知道会不会有什么不妥。
8 K+ v& b7 T8 D$ b. Q
) O4 i: w6 U: y1 R3 h- O+ ]5 B) ~begin P_read arriving: w$ {* p' f# [; y& D7 u5 N
    while 1=1 do begin
) X8 p7 Y: N0 [# [1 q! \6 i        read A_tote from "data.txt" with delimiter "\n"8 }) {/ f  y6 k, \+ |
        read A_time from "data.txt" with delimiter "\n"
9 W6 v$ R7 T0 b/ p+ ^        read A_leave from "data.txt" with delimiter "\n", d5 i4 d8 a9 H( p6 M. T0 u
        read A_picks from "data.txt" with delimiter "\n"
) \7 c: ~* P/ [. k        set load type to A_tote* P; }% F+ W. B9 t1 c4 A
        if A_tote="tote 1" then set A_induct to 1
7 p/ l  G2 d4 s) }1 F: }        else if A_tote="tote 2" then set A_induct to 2
6 Y! t) U5 |' [) t            else set A_induct to 3    * k8 P% [+ [; i
        set A_i to 0( A# D! W" X: ?& l
        clone 1 load to P_induction3 G8 \) {% C$ |, V: m7 {- F' q7 X# T
        wait for A_time sec
5 [- u+ X( E' y- `, @% x9 @1 v    end) d, J8 U5 X. @) M9 N" E* \- Y
end
4 {# Z8 H! u2 Z6 b, I  P
/ H6 F6 t# E" m& ~: ~1 wbegin P_induction arriving( j$ c: _5 I0 y1 o( c# i* j0 w( B
    if A_induct=1 then clone 1 load to P_pick1/ k' d0 [! M& I- e0 o" [
    else if A_induct=2 then clone 1 load to P_pick2
# g0 I: y# a; B/ K- }        else clone 1 load to P_pick3
7 g! P4 t: F3 hend
! i( @4 u( H( l% M
3 {$ d' E) u; _: B/ b, t2 Xbegin P_pick1 arriving
* m1 ]- _! O& U+ X/ f/ x8 D8 W# o    set A_i to 1
8 b: s( R( ^; e& J0 p4 Z    move into Q_induct1
& l% b7 Y6 b/ z5 V! a2 [+ ^    move into pickaisle.induct1( _* v$ d, @, X8 Q# ~# C7 t9 }
    while A_i<=30 do begin
9 K4 G/ K* @- ?2 q1 i  V* I1 j        travel to pickaisle.con(A_i)
$ f$ h" D& t* A2 X$ F" Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; a6 f6 N/ e' x7 i8 a
        else wait for 10 sec
* f1 K: K: a9 ^( p" x; ^        if A_i=A_leave then send to die
. a  @! }: P2 L+ y6 u" h# r; e        else inc A_i by 1
! g5 K% |2 F# T9 k    end/ |( g) e' m2 L: _- ?1 l5 v0 W) z  x5 p
end
4 g$ ^9 ^# U: ?1 Y
/ e; }/ `# q( J  q; {3 d* a0 U& abegin P_pick2 arriving4 m* A6 |& ?, {. i% j
    set A_i to 11
; x( f& Q  f3 B# R1 Z    move into Q_induct28 B9 k  _  k- s3 k
    move into pickaisle.induct2. H5 g4 o* m3 m, y. \; H- c' J
    while A_i<=30 do begin
- b) `$ K; i9 H* N        travel to pickaisle.con(A_i)
6 m  b2 I: @' Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: y- P* h! k2 M" i        else wait for 10 sec
8 f/ C2 t2 y& C( F0 w        if A_i=A_leave then send to die; p7 J; Q; C1 _) |" L
        else inc A_i by 1
% v, U" I* x6 J$ m- t* d/ m) X    end9 t% ^, u5 k! q; @! F
end
' _$ N+ @2 o! \5 Z
' m5 ?9 n8 B: `: F: _' f/ kbegin P_pick3 arriving
' S; S5 T0 T! g, u6 [* T    set A_i to 21; E+ K0 f" Q, @% J$ f
    move into Q_induct3% e; `# z3 o3 p5 J/ T
    move into pickaisle.induct3( z1 ]4 a3 j) l5 ]! p
    while A_i<=30 do begin
, }: Q: I7 A3 H/ W2 e4 g1 `        travel to pickaisle.con(A_i)- N5 Z: J$ n$ C4 F1 x# h: o# }/ r# s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; R3 B4 p- D" W& E3 Z: N- P( E& I        else wait for 10 sec
5 z$ t7 Y, U5 v5 g2 P# f! k: c        if A_i=A_leave then send to die
4 A' p' u) A' e3 F5 L7 W        else inc A_i by 1& ?3 y, }4 g' {- X& O
    end
3 u( b% U# J6 Z3 Pend

最佳答案

查看完整内容

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是个什么东东?
+ B$ O7 c3 Z% @; ~  Q. I; k6 mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 T8 g2 N- `7 s! `3 j

* h7 ^5 S9 m" q1 pAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
. ], I% i, @) }; z, D+ S: D  `( J. I9 J  s, p
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:. r) p: l' u7 ?
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# u9 T# {8 F" _: A3 N. A$ B
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;( o3 c4 Q# R4 t, p, S# G
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 B( L% S7 W: D" ebegin P_induction arriving
: x$ |# `! Q2 X    clone 1 load to P_pick(A_induct)
9 T- Q" r8 ^2 qend最大的系3 P1 Y) I  b) J' i. L' [+ L
9 Y  U$ i, s! F# O4 z7 u
begin P_pick arriving
) k/ ^6 R5 H- Z) K7 e    set A_i to procindex * 10 + 1
, n# U4 K) y# b6 b; D' ^6 ~    move into Q_induct(procindex)- i3 p2 `# X2 X; {; b" C* U
    move into pickaisle.induct(procindex)
5 i, v! r7 L( F' o+ Q. ?. M    /*check the type of pickaisle.induct(i), for your last problem.*/
9 B2 [& I, [9 R. l/ T
3 q* P/ {* B( P    while A_i<=30 do begin
; D  H+ P3 e0 U4 ^        travel to pickaisle.con(A_i)
+ ]8 j% Q# J% Q# N. |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 J: L& Y4 W* J) M9 f4 X* h+ p        else wait for 10 sec
# j* k8 K" n! F% R6 _4 Q        if A_i=A_leave then send to die
" M, i8 F' V9 Y6 C0 c7 z) k7 p        else inc A_i by 1
" @  F5 z$ d, O1 r2 y0 |; y    end
! h* T+ {1 h0 c0 |3 @end
9 E* {; L6 ?3 \! D$ p, \1 `, X! \* z* t* S7 n  E5 I8 g
其中的procindex为整形,代表当前process的序号。+ P% z5 N% M1 S5 b! L' v: 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-1-9 01:37 , Processed in 0.020320 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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