设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11548|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- M$ g1 H4 h) i$ M3 y' `8 L
0 |8 ]9 c4 U5 p( M! M& }我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ u0 p0 Y( ]% M, o
9 A( h# d: n! J1 K: p, A3 D2 Jbegin P_read arriving  F. S, S3 U& e& ?, q% O% s+ v  }
    while 1=1 do begin
* H4 M1 P& V, S+ O1 E1 C        read A_tote from "data.txt" with delimiter "\n"0 B$ R+ G" Z0 q, }
        read A_time from "data.txt" with delimiter "\n"* l+ D! I% P; m& Q
        read A_leave from "data.txt" with delimiter "\n", ^) b2 \0 G& ?0 q
        read A_picks from "data.txt" with delimiter "\n"0 t( E; K! @( \* S; U7 r0 m
        set load type to A_tote, r; {- i: P8 o7 k* p. s
        if A_tote="tote 1" then set A_induct to 1
- I6 S# `( M) |/ k: s* S& \  r$ P        else if A_tote="tote 2" then set A_induct to 2
3 K3 d5 s) s% V& O, R7 F            else set A_induct to 3    1 b/ N' z' Y* |; ~' o' o  r
        set A_i to 02 F5 o! m: W2 {+ u/ C4 F, J% B
        clone 1 load to P_induction% A+ s* ~1 V* @
        wait for A_time sec
+ W. Z9 H6 m: |# S  v    end
+ H; f$ C4 j2 b) }9 ?end
0 u" y9 D3 G3 _1 g3 L
, e( J6 e$ @$ Ybegin P_induction arriving
+ d# G& H: s7 n4 X' f6 Q    if A_induct=1 then clone 1 load to P_pick1
6 \2 U6 b: B# y( ~8 [5 q0 d2 D    else if A_induct=2 then clone 1 load to P_pick2; `: p1 \# ]! s$ ~, U4 M
        else clone 1 load to P_pick3( [/ X' T7 }( i& F" @
end
$ G( o0 ~5 _# b& e9 u
" o$ Q' O$ a2 B( |begin P_pick1 arriving
0 d- F# _- ?9 f( m! ~7 ]/ z6 m: ^    set A_i to 1- n# e8 v) `; o( D
    move into Q_induct17 o; B& r' S* L: ?* y. ]
    move into pickaisle.induct1
4 N/ L' J+ _! E) ^+ m    while A_i<=30 do begin# H7 j$ H& R" B3 O
        travel to pickaisle.con(A_i)) |" o8 W" g3 |$ J+ e3 f) v% H, n4 E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ O# X; U  v5 V* l7 S
        else wait for 10 sec
5 I9 v8 Z/ o% l7 W2 g  W" I        if A_i=A_leave then send to die
- V5 \) n; j, f, C/ D" P. S        else inc A_i by 1) {' o: X/ z* c
    end
( t# a- X2 P+ Iend
, x) U- Y# f% z2 |* g* k
' d! Z. `) f7 w& A0 i0 e: zbegin P_pick2 arriving
( J( \' b6 U! V% Q8 k    set A_i to 11# ^1 ^3 b. D9 L' c& ?
    move into Q_induct21 i- `8 ?' b) q3 ?3 p
    move into pickaisle.induct2
! a; J6 w) D+ Y$ d7 N    while A_i<=30 do begin
0 [1 u2 [; R6 \: r4 l        travel to pickaisle.con(A_i)" x) [2 q- u( I/ _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! h0 x% B$ u& P1 l* \% F# b- }  d        else wait for 10 sec
( F0 \4 O; U1 ~' G: _& I        if A_i=A_leave then send to die
  R2 X4 n' J: _0 R9 n        else inc A_i by 1
3 H: b/ f/ ]% K3 @! `4 i    end3 v. E2 ]# Q) y. {% @' z7 ^
end0 y8 e+ Z9 L. Z+ J5 u
6 D! C# G! r! |- F- x0 b6 G
begin P_pick3 arriving: b1 S+ o; q, g: c9 q
    set A_i to 21. V5 w4 G+ A3 I$ ]
    move into Q_induct3# f% `- e' w' A+ G
    move into pickaisle.induct33 _5 g3 C- ]  X, m
    while A_i<=30 do begin
5 ~! Z: V* b  y" d) ]        travel to pickaisle.con(A_i)
' B  {. e4 [7 T2 p$ d  N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: H7 \- m) @/ }3 ?( g
        else wait for 10 sec
/ z+ x$ V. Z4 V+ R$ n        if A_i=A_leave then send to die
& k+ a/ ~. h- C+ U6 X! ^        else inc A_i by 1. d% @% A) W9 y* q3 t0 v
    end
5 c3 M+ u: W1 p+ ?! {" n4 Z. Kend

最佳答案

查看完整内容

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是个什么东东?  c- p" b; x6 {) e3 a" A1 {0 Y( R
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
4 r4 G3 Q* b9 z* i
9 `+ l: F) p1 a& dAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 s! L# B. O* C# {* [) a2 N; f  h2 K! ]" I3 c3 v
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 M! R+ G6 S* c8 H1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! ]7 b+ E( I9 }, V, A0 S5 F
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! V2 Y8 f' T. @3 o2 p: `0 i4 f
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
8 w1 u- x' d* r8 l( l; v% f" [, qbegin P_induction arriving  v& [% V7 l5 u7 \( B2 r
    clone 1 load to P_pick(A_induct)
+ ]1 |. k! B# Y9 P  `end最大的系' K' h$ _( B# l4 Y: F

# q9 p# i/ x7 x& M4 r# obegin P_pick arriving
0 H0 l. _. {. T7 _  W- e7 e0 h    set A_i to procindex * 10 + 1
5 m7 ]8 Q! T' Z6 N: _# ?    move into Q_induct(procindex)
  N( q) [) |5 Y9 }; J    move into pickaisle.induct(procindex)
& l4 q4 I+ U0 Z! I! S( }    /*check the type of pickaisle.induct(i), for your last problem.*/
% d1 W* C: u8 Y' @( k0 n) w, J/ R7 m" l( h" g- N* F! y1 k
    while A_i<=30 do begin& S* n1 ~' R4 T. |# o% s6 b; y
        travel to pickaisle.con(A_i)! L' o, f5 {6 J  n! R; n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; m% P+ b9 K- y" M
        else wait for 10 sec+ i1 @3 B0 u. u+ c* Q
        if A_i=A_leave then send to die
  P* a) F" e; N7 s- a0 p. {9 i        else inc A_i by 12 a" n8 L0 x; v& V" T: v" y
    end
, d  W3 {2 X- s2 U- Fend
; |9 \& E5 y7 v% A
4 R8 r5 i5 ], g) W: b4 f1 @其中的procindex为整形,代表当前process的序号。
3 n/ v! @" |. t& D; _+ R. [: w6 }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, 2025-11-20 00:54 , Processed in 0.021542 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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