设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13364|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ ?: S1 q  t5 L9 O1 d  d; J! e' N3 a# F  y0 x
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
1 f, V3 B: H1 ]2 ?4 Z. Y/ Q2 C
5 L: \/ \& H2 q9 Qbegin P_read arriving
! h$ i' D/ N: ?    while 1=1 do begin; l8 H9 _9 ^! l' @7 J7 m
        read A_tote from "data.txt" with delimiter "\n"% }3 G, u# N+ Q: F5 [
        read A_time from "data.txt" with delimiter "\n") h, K6 z2 V; X4 z3 c) S; y
        read A_leave from "data.txt" with delimiter "\n"! V1 p; r4 Q# k" m, r( \8 K
        read A_picks from "data.txt" with delimiter "\n"8 G' M: g% l. U2 B: N: s9 A
        set load type to A_tote! J9 `7 F8 d, J1 b
        if A_tote="tote 1" then set A_induct to 18 z; Z# G+ I/ P$ ?
        else if A_tote="tote 2" then set A_induct to 2: P( `" e; O' {/ o+ X3 W
            else set A_induct to 3    # h/ A& e% m9 c# e
        set A_i to 0
$ t; X& e! D4 ?% d8 K% s" N        clone 1 load to P_induction2 r2 z3 r* |' D) `/ V1 P
        wait for A_time sec/ \1 V/ S; s- n( O
    end
. n. N/ H& }! X; a' Rend! e0 [0 A) O5 x% U7 }! ~8 E

4 F4 D* E4 a/ n) ybegin P_induction arriving
5 G$ J7 ?! D3 A: r1 k1 V2 z0 `    if A_induct=1 then clone 1 load to P_pick1$ ~1 _# j  L% V( x
    else if A_induct=2 then clone 1 load to P_pick2
) B' }7 v4 T( c        else clone 1 load to P_pick35 ~4 _$ L  C) ?  U1 [" |' a+ F
end' _: [( j8 s/ ?. P0 i. _; x* O

# }# _: _9 N4 ybegin P_pick1 arriving
& _5 k: Z6 M7 H8 d4 \3 x, ^( t    set A_i to 1
+ I( M' |$ b+ x1 q+ \3 y' j3 N    move into Q_induct13 r' w7 _7 ~; y- Y0 F
    move into pickaisle.induct1
* y! i6 z, {; [$ H- I9 f    while A_i<=30 do begin
/ H5 h  V- O! q8 S  b2 o        travel to pickaisle.con(A_i)
& @5 T- M2 O5 J* e% {7 F# l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; K1 I6 E3 l3 h+ s/ k        else wait for 10 sec- s  d* @8 y# `( D9 z5 g
        if A_i=A_leave then send to die
+ y# b/ a& ^6 S, i- e+ V        else inc A_i by 10 X, }6 b" {5 T  D  @+ V
    end( j! m5 i) Y9 V# u9 Z
end. {8 k4 W# t2 V. p
+ j7 j" X( p+ r5 z
begin P_pick2 arriving0 I; C4 e4 n% ]4 v" _6 `
    set A_i to 11
  X, H! V5 g$ q0 X1 P& M3 M    move into Q_induct2
! z' e' Y/ |- @8 ]    move into pickaisle.induct2
# Y# O2 [( c- T4 X    while A_i<=30 do begin& l2 j2 l8 k9 \2 `& T1 A7 n
        travel to pickaisle.con(A_i)0 ?" }- L0 `" ^) A$ H7 f+ b) f8 \$ z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 g2 f- Y. u/ [! r  c2 J; M" l0 B        else wait for 10 sec- x. I( {9 i" V5 Z7 t% Y( B2 b
        if A_i=A_leave then send to die
  x! S8 Z! J9 b/ I5 s) v, x        else inc A_i by 1
: n) P6 A% G% F0 N5 @$ `, i    end! f6 x* x) V- N/ ~+ R! P
end
2 F3 J% T9 Q6 E+ V! \6 W' T2 M  I& V
begin P_pick3 arriving5 i& ]/ N5 p' n) ?% R4 I5 @
    set A_i to 21& _8 q  \' p1 Z3 M% Y" H
    move into Q_induct3
  C4 O& o8 s9 a! X2 z8 n    move into pickaisle.induct3
* y& m: U+ L- q  w/ Q1 d4 n. f) m    while A_i<=30 do begin
; o& `/ P( r) ~        travel to pickaisle.con(A_i)* f1 K+ J9 I1 m5 ^, W6 C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* b% s$ z* H/ T! t' a. w
        else wait for 10 sec9 P+ f' K! g" S7 K) m1 o$ S
        if A_i=A_leave then send to die  _! I7 n7 b9 G1 D' V' ]
        else inc A_i by 1& V, L3 N* @: |1 v% @6 d. J5 h
    end9 A6 n0 K# m4 ~6 T$ o" J3 N
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是个什么东东?4 y2 K; Q) J. M* Z2 S* |
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?. F( j( ~$ k& q1 U: S. V; `
5 f4 Z$ b. V+ [7 q( v' p
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- N( W2 _3 x2 R. s1 a7 z. `$ J8 e
8 v* [6 T3 S5 w% r9 t+ K
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! T9 m7 @+ {2 E& y  C% `2 g. k1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;8 p6 O% B; ~% c+ L$ G
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;: H9 G' i) b( |1 j
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:4 l: O8 A: X, N& d  B
begin P_induction arriving( j& v' S# z8 K  i1 G
    clone 1 load to P_pick(A_induct)
5 k6 p# j  [  b7 hend最大的系: v- v- H* q/ ^0 n1 z
" d) n" Y6 z2 R3 {  t: W
begin P_pick arriving
# g+ u) I+ J& J% h) U1 f: Q    set A_i to procindex * 10 + 16 r- l3 i' k" p& _1 ?; l
    move into Q_induct(procindex)
2 d8 ?8 q  I% F7 D* G) k6 }    move into pickaisle.induct(procindex)
: C) l2 t8 S! _; Q9 Q* K' H    /*check the type of pickaisle.induct(i), for your last problem.*/. G$ O8 M# S) q5 w' ?* Y0 H
  N9 a' r! k  p1 L) ~2 p
    while A_i<=30 do begin% m2 M, J& l3 Q: v
        travel to pickaisle.con(A_i)
0 w/ u+ f# G+ p/ C1 a8 F% i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( Q  H/ N3 o4 {4 l' ~# N        else wait for 10 sec
0 c8 K5 B9 B  L% n8 X3 x( i        if A_i=A_leave then send to die, N4 C( W! b3 I" ?8 H0 r7 |
        else inc A_i by 18 u# C& j  p2 h2 [" G
    end
/ P9 }$ x0 T9 e( z8 l) Nend0 e8 b) \9 F9 t* C$ M% H7 c

* [# p+ Q9 h8 ~8 U$ O其中的procindex为整形,代表当前process的序号。
+ o! p1 E% E$ D6 x) F% n3 Estation和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-7 01:43 , Processed in 0.018904 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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