设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11749|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; l5 Q+ L: Y! w0 ^: p% j" {# N: |  @/ `% l
我的问题是,在每个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中的数值,不知道会不会有什么不妥。- g0 p8 {. J/ @3 f% j% X* f
/ U+ [+ w7 a$ o; B
begin P_read arriving( Q# c' I6 E. Q) P3 z& j* e9 d
    while 1=1 do begin
, M: m: Q! `* T        read A_tote from "data.txt" with delimiter "\n"4 ~! z) t* H6 h8 J  {
        read A_time from "data.txt" with delimiter "\n"
) [: s* m3 ]* m3 {& o1 P* e        read A_leave from "data.txt" with delimiter "\n"
) i( z; ~. M4 z: K' {! v& @        read A_picks from "data.txt" with delimiter "\n"6 F! F. p, R' b8 o9 y8 d) `4 @6 Q
        set load type to A_tote. [, P6 R) b7 ~" [! _
        if A_tote="tote 1" then set A_induct to 1
" M( b0 E; J3 d/ i" |        else if A_tote="tote 2" then set A_induct to 20 c( H; \+ m9 @* c5 V
            else set A_induct to 3      e) j/ _  J& Q! _
        set A_i to 0/ H! J  S& i; r- g* ^  Q/ V8 U
        clone 1 load to P_induction
" P2 g/ a' i  h! k1 h        wait for A_time sec
2 F6 e3 }$ v4 a& b- p" }  }5 L4 K    end
: ^) `6 M+ U0 _1 zend( V" E9 U1 }- `: M, I

+ `) H* }# s4 t/ d" j* o9 Kbegin P_induction arriving: f+ e6 V% }( Z: ~/ z* M$ m
    if A_induct=1 then clone 1 load to P_pick1* n: C* V, z$ l" }1 U( {$ o
    else if A_induct=2 then clone 1 load to P_pick26 g! \- A, P$ X1 G1 `( n6 s
        else clone 1 load to P_pick3
' T: V! ~5 P0 ], }) Nend; P9 q& g. s7 W: z/ L
$ a- l' [) @$ z) p8 v5 m5 T3 D
begin P_pick1 arriving
8 n; J" ?) d: y) }/ D3 o    set A_i to 1
  H$ L1 n  ?- G# i    move into Q_induct11 a4 L% C& a% W. o
    move into pickaisle.induct1# k6 R6 C* j7 }7 F
    while A_i<=30 do begin
6 S/ v' o8 s1 X1 i' H" G' T8 U# A        travel to pickaisle.con(A_i)) [4 c( O; V7 Y' C' m% c! X, x# ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 Y8 Q1 }9 X6 e' b1 ]! g/ Y
        else wait for 10 sec
  j% T' s3 o/ g4 e, P$ T: O        if A_i=A_leave then send to die2 s- @3 @0 v9 z) J$ w9 E. A, M
        else inc A_i by 1: i' W& N. d1 x' ?
    end. Y# b  S# \7 @- g! Z! h# y
end
1 Z- L# \) ?5 |6 E3 m' Q* ^# ~# ^4 x. Y9 R( k' @1 C7 |+ E
begin P_pick2 arriving: G3 @' `: l: x5 @) L9 Z
    set A_i to 11
0 u' z- R+ M! k  C4 g0 E' N    move into Q_induct2
" K2 c+ V7 p3 C  H    move into pickaisle.induct2, Y; o5 e5 {- H- p1 [) k
    while A_i<=30 do begin- {8 V: G% `0 V
        travel to pickaisle.con(A_i)6 {  w) a# ~$ h2 |& }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 Y' l. O7 v8 e+ J3 H
        else wait for 10 sec; B4 S. s, Y* D! A& \# {7 o- X3 W" F
        if A_i=A_leave then send to die$ ^$ h% ?- l6 n4 Z/ b
        else inc A_i by 1+ z  \2 c& M  O! p
    end
5 L! ~' L: J# kend7 Y9 Y$ C6 l' S

0 T" p6 O& W$ _* e! w7 K  ~begin P_pick3 arriving
0 a( {2 Q8 v3 a+ m( r    set A_i to 21& r/ o1 `* R- |' ^7 m  X3 m
    move into Q_induct3
5 n' R( M; d; L) G( P; Q    move into pickaisle.induct35 J- W$ y3 T1 o- @
    while A_i<=30 do begin. M6 V1 I9 V0 ?, I8 _/ R
        travel to pickaisle.con(A_i)& m5 B6 z* ~1 }0 s+ H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 [6 s8 T6 t' R: Z5 z, @) r0 W5 d$ |        else wait for 10 sec; t" t9 }6 K: Q+ v! Z1 g
        if A_i=A_leave then send to die
# T5 s% K6 v1 Y1 K9 j        else inc A_i by 1
% y# e, X* }& K8 s/ |, H    end
  Q, d+ Y' [% fend

最佳答案

查看完整内容

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是个什么东东?
: S  U, L$ I  u6 l7 r) k' omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 |; v0 B: N* c4 ~: |4 @& a$ P7 G
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。! u7 C; K; }. |, f0 H

; `" r& U* g  m8 ?0 R: L* A另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 V( Q! p* y+ }( f
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! H0 G7 {2 m' H" Y* G7 X# E
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: ^2 y. ~4 J+ T. Z3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
- W1 d4 E5 ]! [- gbegin P_induction arriving* }# ?4 i5 v8 O
    clone 1 load to P_pick(A_induct)
2 J0 D: P1 w* Q* Bend最大的系
! A3 `8 i% i# k8 Z8 N/ M% z3 @' Z4 \6 a
begin P_pick arriving$ N, P; k0 f! @% I
    set A_i to procindex * 10 + 1, a7 w3 D5 J: W! _
    move into Q_induct(procindex)! _4 S# \* o* B, f+ M
    move into pickaisle.induct(procindex)1 f- s/ d! B6 Y& s: s* L5 C
    /*check the type of pickaisle.induct(i), for your last problem.*/, ^+ d1 z' X, T8 z8 Y  t

* q; o6 v8 x! A* \    while A_i<=30 do begin
0 _% H; V8 g6 P2 j1 }        travel to pickaisle.con(A_i), Y1 B' d: W( z) H  x8 q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 }$ r! D2 w0 T! i7 a8 d# u        else wait for 10 sec/ W8 G9 h. s3 S/ U
        if A_i=A_leave then send to die4 O) R' E) v- ^* Z# p
        else inc A_i by 1
' _0 X  z* z1 f  _% J    end
) M! H. |5 F1 }( Q* iend% \( Z8 z% R' [0 u& Z' l- T% }
+ S# e! Y1 Q0 Q+ {  d2 A" b+ v
其中的procindex为整形,代表当前process的序号。
3 w: P& |5 b* |2 M) E. hstation和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-12-2 08:38 , Processed in 0.021608 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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