设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11663|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" P1 |# R% z5 r) ~2 x' o
1 `2 }  {8 H  P: r" k$ a我的问题是,在每个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中的数值,不知道会不会有什么不妥。, j- D# x  |; O$ L% F" L  D# O

3 b- C/ N3 U7 Q4 D. b% S' I$ K7 ]" cbegin P_read arriving; ^& ~% r1 |) T5 M
    while 1=1 do begin
7 }+ O) _8 ~$ c( Y, b! f        read A_tote from "data.txt" with delimiter "\n"
: l2 Z8 k+ t  U4 d1 U6 c8 F        read A_time from "data.txt" with delimiter "\n"
- ~+ `- Q& ]3 ?, e        read A_leave from "data.txt" with delimiter "\n"
: i4 ]( ?! o: z        read A_picks from "data.txt" with delimiter "\n"% n) Z3 b; V% R9 G# o
        set load type to A_tote
" ~' p4 r: Y: ]: F        if A_tote="tote 1" then set A_induct to 1$ e  g* V* L, ?+ q3 A1 `
        else if A_tote="tote 2" then set A_induct to 2
% U: t0 Z1 \4 P2 v3 i            else set A_induct to 3    * U5 A$ a8 l  ?8 H4 C+ W
        set A_i to 0! ?; z1 Y8 C" J8 b* ~5 Q6 z
        clone 1 load to P_induction( K# I' e; F3 W2 H9 V
        wait for A_time sec
2 C' n8 \) p* Q2 N    end
: y9 W. M6 D* P! F: pend5 J9 O' Y% s4 r, k+ ^
, q4 }. @1 m0 F* H
begin P_induction arriving
- k. J2 a3 F" I5 c: E4 E. U1 [    if A_induct=1 then clone 1 load to P_pick1
  b( Y" x% Q, s" m    else if A_induct=2 then clone 1 load to P_pick2+ b/ A4 h( e2 X& o2 Z
        else clone 1 load to P_pick3: w# ^. L- |; Y- [# B
end
2 o7 C- d6 w5 b; n5 {  r+ s
& T# H+ t: ?! N) ]begin P_pick1 arriving
; v' T  K! `" @! n* ?: g    set A_i to 1
4 ?6 a  \* B* Z# k9 M+ q4 U" i    move into Q_induct1
0 u8 y8 h; ]2 n4 b/ p    move into pickaisle.induct1. a( a# ?2 E1 y- m
    while A_i<=30 do begin+ j9 G0 Z# a. Y% @; r
        travel to pickaisle.con(A_i): n/ m7 H3 u. Z6 K5 }: ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  r2 e1 _& z" U$ @$ S        else wait for 10 sec
6 m, v9 @5 z0 _6 E- ?' N4 l        if A_i=A_leave then send to die
9 a+ H7 K; u/ J- R8 T% r! e        else inc A_i by 1& E  I& N/ Z- H5 V- g/ q2 {$ g4 L
    end) q: E/ i) m" w. d# [/ L7 `# N$ Y
end: R/ B- K$ |  D0 m2 Q  V: Q3 C

0 I/ S: z1 P% l0 xbegin P_pick2 arriving( i4 O& h1 ~$ M  z0 `4 A. w
    set A_i to 11
& @8 `. r  A! a    move into Q_induct2
3 |4 w- ^( R+ a    move into pickaisle.induct2) y- E. s$ Z1 O$ \) Z) T
    while A_i<=30 do begin
/ N$ b# d9 c8 J$ Y& }        travel to pickaisle.con(A_i)
7 y3 P" M* i, w( j9 _, Z6 X, R$ B+ X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 `: d5 T( V& ~8 j        else wait for 10 sec
3 b" J; ~# M5 N        if A_i=A_leave then send to die
0 ~) b) l* O" ~& I. s, B        else inc A_i by 1% y  M& P8 I5 h+ U$ r! b, V
    end
- I, W, G3 a( j/ h' Jend6 f5 m+ E1 v* {! A

4 N  j8 O5 f; lbegin P_pick3 arriving( |+ E6 Y& B9 ]- X1 E6 w6 e+ ?2 s! {
    set A_i to 21
5 ^  E& W6 \  z3 c3 F    move into Q_induct3. P2 N8 b/ ~' m$ I
    move into pickaisle.induct3
$ F% e" N- R; G2 t* r& a- b5 G8 d% u    while A_i<=30 do begin
* e! J$ c4 z0 D  H/ O- @        travel to pickaisle.con(A_i)
3 d" H$ R  d$ b1 C' O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  h) Y8 @. I( P" _' H% V        else wait for 10 sec
9 g# P! v- C# m' C        if A_i=A_leave then send to die$ g, e' X# X2 h1 W8 D
        else inc A_i by 16 Y. M7 D# ^2 U% P
    end5 m. k4 s; e0 f! p
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是个什么东东?
' W8 G! P- g" b! e% xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?' n0 l1 Q) w6 Q: H( {+ G3 `

! `( e- e; C8 v/ UAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。4 q6 T3 m$ I( ?1 _* w% k
7 o( S7 c9 n% S. H- i5 z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! }* b+ \$ C* r1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. ^; k6 I0 h5 V& L8 H2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) e! S7 A7 D( K) A0 O6 u9 p$ G, F3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:5 J  ~3 D3 y  ~
begin P_induction arriving/ E# ^/ q6 r/ r6 K8 @) I5 I
    clone 1 load to P_pick(A_induct)* `: A9 [" ^& j# j2 W+ V
end最大的系
! [6 M4 W8 K% l' N. V; V6 f/ n# O
begin P_pick arriving+ Y7 i& M* G! W9 ?/ I; Z" R
    set A_i to procindex * 10 + 1* p; M% @/ b9 q# Y
    move into Q_induct(procindex)
" L% I+ {, \4 q    move into pickaisle.induct(procindex)
1 B$ X" d8 N; `+ T9 q. |% R; o    /*check the type of pickaisle.induct(i), for your last problem.*/
9 |* W0 b  f9 t) ~7 l5 X9 k) D' u, D# W3 V7 H( T2 V! G. G2 M& D2 {
    while A_i<=30 do begin& B  [. e* t2 J" G1 A+ L
        travel to pickaisle.con(A_i)
- Z7 @) k4 h0 w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 x7 {. n. a% Z4 n
        else wait for 10 sec
3 k, C. Y5 @. R        if A_i=A_leave then send to die& A- }5 R  ^, A$ Y$ B
        else inc A_i by 1
* h" e: L5 W! U    end
! e+ q- a$ m$ s' f6 G3 H+ _8 @end& Q/ A, r0 l9 Q; K- @5 A) m3 f

+ R+ U& o! ~7 o6 e, {其中的procindex为整形,代表当前process的序号。6 }. F9 P" Z1 s+ p& `* H
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-26 11:43 , Processed in 0.016874 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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