设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12157|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& U# F  L' u6 ~3 X( l; z+ G
! Q+ d- r+ W/ E我的问题是,在每个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中的数值,不知道会不会有什么不妥。% D; A: n+ [" Z; A- y0 N1 T
; ]4 B+ d% e  U/ C, `# C
begin P_read arriving( \- c) f3 R7 B" v% h. D
    while 1=1 do begin
# V+ r& U; Y0 J( }3 ~: J; R" s        read A_tote from "data.txt" with delimiter "\n"$ X$ C0 w* N/ ~0 K3 J, y  @
        read A_time from "data.txt" with delimiter "\n"
  p3 @  C8 }9 C  Q  P        read A_leave from "data.txt" with delimiter "\n"
2 H3 M' z$ _& W; t, b3 k        read A_picks from "data.txt" with delimiter "\n"
7 I, _/ a( E7 L+ K        set load type to A_tote
9 o  n( ?; X! O9 E        if A_tote="tote 1" then set A_induct to 1% _& y* ]5 |0 K& d
        else if A_tote="tote 2" then set A_induct to 2
! E& ^2 C- X# L: _9 e: E! r            else set A_induct to 3    % y4 U: U  R  R) s
        set A_i to 0
& K/ X/ x: `: @5 W  D        clone 1 load to P_induction; g  k, H" U, ]8 C/ C% a; a
        wait for A_time sec6 I, q) `* i4 E; ?' }1 E' W
    end
& v2 G9 E! Y* G. j/ Bend: [1 F2 ^9 t1 {' P& r4 F1 [
+ n  o" y( O# P, H. \! G7 O
begin P_induction arriving
: ^: x9 K9 @2 X& H    if A_induct=1 then clone 1 load to P_pick1
/ }  j8 j- w: x6 ^8 t! z    else if A_induct=2 then clone 1 load to P_pick2
- U6 T3 \6 `3 n+ K8 {/ C4 m        else clone 1 load to P_pick3
. L7 |. }! ]6 d1 p4 Cend
8 E1 I; |( M& z$ Q- W7 Q) s" ^, p: ]2 V$ U3 S
begin P_pick1 arriving
9 I  e0 g, V+ U    set A_i to 1
: b( X( S$ L3 C2 E$ G& s5 L+ k    move into Q_induct1
# U& j/ }  p9 f  }* K9 q    move into pickaisle.induct1
  I' J* |; U5 V    while A_i<=30 do begin
! n- \' f/ ^) u. J- k" u        travel to pickaisle.con(A_i)/ [* F, g6 E- E( C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" ?$ X6 s/ z! ?( A8 z
        else wait for 10 sec5 `9 o- V3 t6 f5 @4 Y
        if A_i=A_leave then send to die
  n, u3 q  x* b' z/ l8 J        else inc A_i by 1
0 t# M9 q2 |0 Z0 a    end5 ^) Z- M( f% x0 `# Z
end5 d' L3 U4 n8 W3 R& ]

  k" [2 b$ `; ~begin P_pick2 arriving
2 x5 R. F3 |- b/ p    set A_i to 11
1 ]8 _3 U3 Y! |8 X& Y" c8 ]& A    move into Q_induct2/ w% n/ m4 }( A& D2 E6 t# c2 j0 Z  |
    move into pickaisle.induct2
3 f% L# \" @  G9 u8 l/ u- u7 }    while A_i<=30 do begin( j  i5 W8 ^( e8 S
        travel to pickaisle.con(A_i)
6 o. Z4 |$ x' j# Z9 ^6 Y4 K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ c; v( S5 B4 d; V) U        else wait for 10 sec
: O' L- E  l$ s% E8 Y        if A_i=A_leave then send to die! |# \- D# y* ~" I5 I" @
        else inc A_i by 1
2 d2 L* N  ~1 \8 [    end
, C- L. [5 b4 gend0 K/ `+ C: }5 X2 x3 Y: B& D6 m

9 n) {4 Q% {0 Y" `9 i) [4 B+ Sbegin P_pick3 arriving2 p7 L& h! V7 \( F" d
    set A_i to 210 t( T1 |! H8 |0 @
    move into Q_induct3: K8 S( }& h: N( z
    move into pickaisle.induct3
5 A$ A! p9 j0 w! q: i2 T* @" S2 c    while A_i<=30 do begin% D, W. F  H- z
        travel to pickaisle.con(A_i)& B' J6 F& ^5 y1 u. Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 l' t: d. ?6 s" o6 l! C! z        else wait for 10 sec/ e: p7 r. e8 a" `" ]
        if A_i=A_leave then send to die
4 g, ?- w- }/ i$ Q, B% k! [        else inc A_i by 1# G- Q7 u( w, U
    end
( g! `9 i+ Q. \) M0 Q$ A' 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是个什么东东?/ K  _% u; a3 s
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
# f( p8 ~6 [7 b/ d
: B0 \' O( D8 h; ]AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。( y% U' c- l% q9 X, ~8 T. \& x

- q; A: U& A: M: ]- H另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:) A  Q) B! [, e
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;6 O! H3 B' B* m6 U% X) Q! @
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& g5 v/ X8 f4 r/ j# }' J( p
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
# k. h0 g) N9 [0 s4 B; p$ jbegin P_induction arriving
- c* t2 {2 X. M" w    clone 1 load to P_pick(A_induct)2 y. H% e* d/ w! a+ C2 W
end最大的系
" ~5 I4 t$ a7 R! T0 l
. x% _9 T' c( {begin P_pick arriving
4 C! q6 K: B7 U    set A_i to procindex * 10 + 1
1 u! I5 A2 }+ I+ O    move into Q_induct(procindex)
8 l- I+ T/ b: Z1 @9 b+ C0 W2 D    move into pickaisle.induct(procindex)  J+ t$ }) x( h4 T
    /*check the type of pickaisle.induct(i), for your last problem.*/- P  F* c. Z$ ^  r( B2 h

4 f/ D& Z5 z; d7 D* D) t    while A_i<=30 do begin+ b5 w5 e+ T" M6 I9 w
        travel to pickaisle.con(A_i)3 }  g2 g* \' b/ K6 ~9 v- i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) K$ A6 j7 S0 E        else wait for 10 sec( _, Q* ]: y' h% |; m" |# Z
        if A_i=A_leave then send to die
5 R9 u4 [9 I" `* a* \; \. Q& k$ |        else inc A_i by 1
* {/ c0 [* T% i4 ~    end
, C2 T/ y$ S6 h/ I& y0 D8 Qend  R( b" l5 ^/ p( D3 \! w% J6 {8 ^& g+ Z
. w# g8 |# r0 h$ [& ^
其中的procindex为整形,代表当前process的序号。( y7 I! k% c4 O1 _! d
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-1 05:35 , Processed in 0.019115 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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