设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14283|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ l3 d: b% g; q3 E* ~9 h- I3 G1 D1 g- h, O$ H" V9 s
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 E7 Q: n. n7 K6 R6 H% b* f( [
9 K" L+ V4 B# t. r* N! {; bbegin P_read arriving
4 r# j6 }) D: y3 o    while 1=1 do begin
0 j" ^% x6 [' x5 A; a+ W- w0 ?7 d* h        read A_tote from "data.txt" with delimiter "\n"
- ~' _* l1 ?2 D* c( v8 V7 b5 D3 D        read A_time from "data.txt" with delimiter "\n"3 h: \$ U; k, Z, @
        read A_leave from "data.txt" with delimiter "\n"
4 m% C% W5 q+ j% V% `1 r        read A_picks from "data.txt" with delimiter "\n"9 [) G6 p, n: f- i
        set load type to A_tote
, B5 z! Q: s% o+ c* ~4 O# i5 q        if A_tote="tote 1" then set A_induct to 1
+ u4 X8 S. w4 U! G( m7 V- R6 o        else if A_tote="tote 2" then set A_induct to 2/ T, A3 i, o: n2 S: v8 A
            else set A_induct to 3    1 K% p1 S/ I4 G; g
        set A_i to 0, k4 p( K( I: U3 W1 t
        clone 1 load to P_induction
5 n. W) n/ ]8 I, `        wait for A_time sec
) x) A4 U6 p/ |2 Q0 |, x    end0 Y, j+ X" H; U- a
end
3 X2 I% |) a2 q2 b
: D4 s4 j. b2 w3 N2 Zbegin P_induction arriving
2 C$ j( ^& \! x% x1 T    if A_induct=1 then clone 1 load to P_pick1# S9 K! X: o8 J2 o7 H& O
    else if A_induct=2 then clone 1 load to P_pick23 e2 g- E4 \' s6 G, M
        else clone 1 load to P_pick3
" [, H6 m5 I4 r# @, E$ Wend& |: a5 @; K9 ^/ S0 U0 R3 U9 N
3 q! f  s5 s% w" M( J. h+ Q0 g
begin P_pick1 arriving7 K" S3 x! F5 \
    set A_i to 1
) H( l% d' u# B: m) k    move into Q_induct1
& ?: T  z" M) _3 K: f' ]3 @: T! E    move into pickaisle.induct1
, f9 E2 E0 v+ j. ?' h    while A_i<=30 do begin
1 s1 A2 p0 b+ M5 L1 N: [1 N        travel to pickaisle.con(A_i)6 g, G$ e9 \2 V- ~! G* L. ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 H9 ?, D, v' m7 c% u2 A3 x/ m
        else wait for 10 sec
' d- e2 N$ K" A- n1 s8 _* u        if A_i=A_leave then send to die2 g$ D# i+ H$ b
        else inc A_i by 1
' }# T2 ?. B# q0 R8 P. g    end9 p% S& ?" L0 _# w6 H* s
end
) |5 S& x: j( N2 f5 E/ P- `  ~3 W6 \# P, Z/ U0 }1 z* ^! B
begin P_pick2 arriving
+ {# j; M" P  I    set A_i to 11" O4 E7 F0 y3 e
    move into Q_induct2
# ~0 X. t9 \" A& i6 m) a# b. `    move into pickaisle.induct2
2 w. ]5 _* |' |: L    while A_i<=30 do begin
4 C# m# ?! `' Y9 q! t        travel to pickaisle.con(A_i)6 u* t7 p. f' ]' }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 y" O! g; D* M4 w8 }+ a! @5 ~
        else wait for 10 sec# \' K" p4 b; a8 o$ N8 ~5 K
        if A_i=A_leave then send to die
* u7 q: a7 |. a1 e0 T, T: e- b        else inc A_i by 1
. D* d6 u  `! C5 ]3 |    end: |3 ]' L) Y$ @: C% H
end
7 w, p& k8 m  X9 |, f" v$ @) Z1 }5 f( n/ I) M9 ^8 G- `' j
begin P_pick3 arriving5 `$ B6 B. |" Q3 q# O$ d
    set A_i to 21, u4 S/ O2 j% u4 x
    move into Q_induct3
% w4 q2 x- C( W    move into pickaisle.induct3
0 r6 D3 _9 I! K    while A_i<=30 do begin  T; f5 A4 {$ i% Q5 v
        travel to pickaisle.con(A_i)
# F" ~8 V" F* o1 t$ e7 R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  w9 @1 ^: j$ t5 }0 l        else wait for 10 sec/ I/ V2 F* B- F5 F. J4 m
        if A_i=A_leave then send to die
9 X. c1 R* U3 z( {# k9 I0 c1 \1 L9 c6 @6 I        else inc A_i by 1
' |1 v5 `* K: A6 y, ~& i    end  s6 K/ L; y: ^) ~1 Z  o3 w. d& s
end

最佳答案

查看完整内容

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是个什么东东?
5 B7 l9 I! R. v/ K- Vmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?: `' A" l( R$ ]. `; o' L) m. |

: F0 l& f6 f" t: GAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" U, T4 p$ o& S; A2 @

9 t4 |( Q+ Q3 Q, }4 [另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% w6 p9 ?+ Z  M' t* a/ o! Z1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, q' W1 p7 H" J7 o* B
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;- S: U# @: B; i* k, r7 B# [
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, K7 B4 J) |+ A- P3 e
begin P_induction arriving
! s, f2 r4 s8 @0 G  y6 Y3 w+ [2 r    clone 1 load to P_pick(A_induct)
2 R; }8 f! j2 D+ C4 M' `end最大的系
& y' q$ J% d4 }# p) U6 t6 D: {6 X$ |  p
begin P_pick arriving
2 o. I! r* d1 Y2 T( Q    set A_i to procindex * 10 + 1* y" C5 \" J  j' i
    move into Q_induct(procindex)
2 ]+ Z( p+ O0 d; S& w0 Q" i    move into pickaisle.induct(procindex)6 T. m( Q5 h. y9 i/ f& M: V
    /*check the type of pickaisle.induct(i), for your last problem.*/
6 _9 s& D: j) {" Q2 ?+ e! T; t- \# ^1 Z2 y  S. H! Y
    while A_i<=30 do begin
3 v( ~3 C/ D% F1 J* F8 ^  K) j1 _        travel to pickaisle.con(A_i)' J8 c% B# G7 A# k7 E  b3 o6 ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 e# H% ~8 M' d# ]+ G* ?
        else wait for 10 sec6 X. O5 H6 W" V1 g) A
        if A_i=A_leave then send to die. `; L( h- w3 x6 n
        else inc A_i by 13 I; `% U; @! M1 a; i4 R/ [, K
    end: X+ ]$ z1 a; S: x0 r, A, [+ Y
end
' E/ n1 p1 q. ^) G; _3 ]
* I, B+ k2 @* b! |7 J6 q9 R5 N  S其中的procindex为整形,代表当前process的序号。/ U8 Q( L2 ^6 F+ H6 F; U9 `7 c4 [
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-6-28 05:05 , Processed in 0.013885 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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