设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11613|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 m- n) ]! ^! w9 s7 \9 s7 x1 w

- `- c, C& A/ q" i; G- |9 K5 G" c我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# G9 Z7 t3 @+ C6 \# p; K
0 ^- F; r. c8 D7 m9 ybegin P_read arriving1 `% U; G9 r3 |6 n1 D4 l* I
    while 1=1 do begin+ f1 l' \! t+ y2 {' E
        read A_tote from "data.txt" with delimiter "\n"7 Q, B' w% o& Y; W; I' m1 i
        read A_time from "data.txt" with delimiter "\n"
$ c* X, n) O$ h! s$ o6 w        read A_leave from "data.txt" with delimiter "\n"
( @: d" B! u0 }! I$ M        read A_picks from "data.txt" with delimiter "\n", R: E$ o0 f5 G( S, \
        set load type to A_tote
/ `: ?& @. l0 q        if A_tote="tote 1" then set A_induct to 1' K- A) A4 s- O% D' [9 \3 F
        else if A_tote="tote 2" then set A_induct to 2
5 s+ w6 B* g3 t/ y5 o  u2 w            else set A_induct to 3   
7 m, V  n6 C+ _1 _, R( |. g5 m: G        set A_i to 0
; ?& l, z4 k8 C- @        clone 1 load to P_induction
0 g  h2 A$ J2 B- Q: r2 e/ I5 }        wait for A_time sec
+ Z/ w: |" e  j( Z    end; \1 Z, M* N0 i7 l- @* @. L5 [- E0 M' w
end
" U2 X- n/ D$ k" Z
& |9 g- y. d  S4 Cbegin P_induction arriving
7 e2 A( Z3 G9 Q" Z    if A_induct=1 then clone 1 load to P_pick13 O4 u4 l- b. T! a
    else if A_induct=2 then clone 1 load to P_pick2# _1 ]5 |+ C1 y' C$ k( U
        else clone 1 load to P_pick3
* E2 @: e5 \" }+ y% p, m" Kend! [5 k. ~( R0 Y3 e9 q: ^
1 W+ q" L# v9 J5 T
begin P_pick1 arriving8 Z) j* \/ @$ q
    set A_i to 1
  n! ^* F) Z  l1 V. i5 s    move into Q_induct1( }/ x  L( }) T/ H, }' f2 `
    move into pickaisle.induct1" a5 J9 F. m" A
    while A_i<=30 do begin
; h) m  d" j% {7 E: ]0 T$ v        travel to pickaisle.con(A_i)& U/ d* m1 B: ^4 A4 q. ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 x* S; ~1 H; a% Y4 K
        else wait for 10 sec
1 |2 x6 a9 ]3 \, n        if A_i=A_leave then send to die
4 s1 v) v9 _7 [( E) [2 W6 J        else inc A_i by 1
: F( j$ V8 I; B    end
& [! F% y+ c1 e( W4 lend
0 [0 V5 u# Z* O
# O: E. Z9 W2 u) ~6 Z" Zbegin P_pick2 arriving* W! _6 M; b; a2 S/ P
    set A_i to 115 A  V' J, T% M" p. V7 u: o
    move into Q_induct2
: U: f( e# a9 x& V: h( P    move into pickaisle.induct2
' a/ {) @9 y0 e/ k$ r" G* q) d! \    while A_i<=30 do begin' ?. G6 J4 Y1 y+ G* M
        travel to pickaisle.con(A_i)) ?* c/ ~# ~. s$ @" c* t2 Q1 O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. {- \& h4 l6 \& b3 o1 Y        else wait for 10 sec- `! s* |1 }0 ~: `
        if A_i=A_leave then send to die
( v. O: ]! M; G, h( v4 |- P        else inc A_i by 1
( h* ?; k; R* [. H    end: O3 g! _. H# p) W9 P' \/ C
end
8 L/ d6 @# n8 k( d. Z7 T7 Q% E- {9 r6 `4 u5 M
begin P_pick3 arriving
7 Y' l) u3 ~) u! U6 G    set A_i to 21  y& H$ ?, E. T2 h: |/ s# N
    move into Q_induct35 U' u( O5 K: ], {3 V
    move into pickaisle.induct37 u5 ]3 m4 `- S& u4 h$ L
    while A_i<=30 do begin9 W. m/ l: u- l7 t$ w; Z9 s& J
        travel to pickaisle.con(A_i): y" Y# g8 ?, M. @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 u- [3 R4 B- D" I! ~
        else wait for 10 sec
8 g% z' [/ v0 V        if A_i=A_leave then send to die1 C  n5 `% O7 T% M  k1 G0 |% I8 }
        else inc A_i by 16 ]1 i  c1 \( v. e5 ?
    end
$ D' u/ m! w0 M, o: O3 Y6 Vend

最佳答案

查看完整内容

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是个什么东东?8 M2 ]' Q4 S( q1 \2 J, a
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?5 c# s$ y0 m: Q" w  \* \, A8 S" X- M7 U. \
0 M  X" w. Q0 {& U$ {
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。$ F  V4 ]; ]% o

% e$ l. t- D, u5 {$ x1 r另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
6 g# a7 S1 X1 |1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;) l6 W1 M. a5 J6 [3 Y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
& W; V* V  Q/ ]; g3 T& C. @; h+ g3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
. \* x8 D" X- e4 Hbegin P_induction arriving4 z4 q) \  g4 h% w7 v+ d. Q
    clone 1 load to P_pick(A_induct)
! V7 ], e8 S  e, [6 wend最大的系, N* [! n) f/ O# e; r5 }; n4 E
1 `- o- M+ Y1 Z" ^2 A7 @& Q+ e
begin P_pick arriving
, q6 h- I$ [" T3 J5 h& b8 J, F+ H    set A_i to procindex * 10 + 1
' T2 N2 ^/ g3 }) X    move into Q_induct(procindex)& g1 x9 X7 q) A* d; S, K
    move into pickaisle.induct(procindex)
9 p' \4 v, H/ p+ `4 H( K% y! }    /*check the type of pickaisle.induct(i), for your last problem.*/4 s; j+ R1 q) a8 y" B, |8 {
. Q1 M/ O+ \" s
    while A_i<=30 do begin
. V) Q+ S4 M8 ]+ I  A        travel to pickaisle.con(A_i)
# q; e2 T3 ^) P4 r2 s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. Q$ G3 r- n3 F/ Q, t- b$ Y4 H- g        else wait for 10 sec- v- e: o: x, ]& f7 B4 n% i# `8 J
        if A_i=A_leave then send to die
1 Q. @, C% _7 K) a        else inc A_i by 1
! T5 T3 L/ g' W: ?- m    end
8 ^/ {. W$ M! k% j( Uend) {& W3 `2 X3 A% e4 w  g

4 K, v; H0 f3 F其中的procindex为整形,代表当前process的序号。4 L' t# A- k8 O! [( x
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-23 16:45 , Processed in 0.014570 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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