设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13912|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 l2 y, S. p$ x( x* P+ I' M8 T% C2 x" z) n. B# v7 X
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 h, i: W( i0 f$ d# w
7 G! V  w2 t* Dbegin P_read arriving  ?" m6 n+ E/ v' \; e; ~
    while 1=1 do begin
0 ^5 }( k0 Y3 f% D9 ^7 b) b; j        read A_tote from "data.txt" with delimiter "\n"/ M. U. W5 ]. J( \8 \2 A
        read A_time from "data.txt" with delimiter "\n") C' U; ^% D: Q: z* H
        read A_leave from "data.txt" with delimiter "\n"
- G' K  }/ D3 \- u2 Q        read A_picks from "data.txt" with delimiter "\n") U. j, p$ U( b' f% o
        set load type to A_tote' e( y) ]2 W# z) [
        if A_tote="tote 1" then set A_induct to 1
8 U' s/ P- H  `8 R9 Q. B: Z        else if A_tote="tote 2" then set A_induct to 2. b5 V5 Z4 l5 |# }9 A
            else set A_induct to 3   
4 f/ Z8 E9 N; d1 U4 s1 J" |; \: l  G( ^        set A_i to 02 T: K$ T- L2 C* Y! @
        clone 1 load to P_induction
' {; ^7 G, J; N6 y. k7 R1 U        wait for A_time sec
; n( u6 F* o& g& ?9 p" g2 Q! D    end6 Z0 Q0 r: l* j6 r, d3 f9 `
end* R, z9 E+ b0 W& E2 V/ e

0 g( q, c# ?( b& ], L6 lbegin P_induction arriving+ L3 P( S+ p9 f+ M4 w4 p
    if A_induct=1 then clone 1 load to P_pick1+ d4 N( q) k' n2 b4 A1 F5 |
    else if A_induct=2 then clone 1 load to P_pick2) r' A9 o' y6 Q% P& d0 X0 [( W
        else clone 1 load to P_pick3
3 c, S% I$ V  }: P' dend& N* R. e' P; ], _0 G9 @
: R- ^* {6 s9 A% z# E$ p3 r, ~/ v
begin P_pick1 arriving
) w0 I* d7 M  T    set A_i to 1' c' g/ M  M! t8 l: z; b* ~
    move into Q_induct1% M' V0 u7 l2 w7 B# f7 G
    move into pickaisle.induct1  I: q7 _4 s0 f6 g0 }% F2 d
    while A_i<=30 do begin/ g. m: y  Z! P% ]
        travel to pickaisle.con(A_i)
( Z4 H' g) I- v$ }- K, x7 _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ ^' P, K; O4 c7 y        else wait for 10 sec
7 d* z; n3 `+ o( l  j        if A_i=A_leave then send to die
& b7 b/ _; H2 Y) L% z! K        else inc A_i by 1* ]" w, T! ]/ n* j6 L
    end
& u3 Q' K& D6 E: Z, [; }  cend
. M) w/ w& \6 S, `" k% L  v' X( m$ h; W. R% t, u9 e& B
begin P_pick2 arriving
, q" k( m$ s; s7 B' e5 I    set A_i to 11
, B1 z# D2 A( O% z    move into Q_induct2
6 L; _6 t  u; j& E    move into pickaisle.induct2
' m& ?# u# G' K8 l% W    while A_i<=30 do begin5 I- A' F6 j' w9 }
        travel to pickaisle.con(A_i)
3 d: D; }% Q" X: E4 c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 I# K9 s) o4 T; |
        else wait for 10 sec. u4 r( Z( M' h  {
        if A_i=A_leave then send to die
. ^* ~% f. {3 I2 ]& ?) B" w        else inc A_i by 1' Q1 n: }: N8 |! Q
    end
! j1 w5 D$ K) g9 C! Dend5 c" u/ W0 D/ z( F" q/ \
/ y$ e( Q5 g7 ]8 |8 b% a# i
begin P_pick3 arriving! M3 W( l$ w- o4 E' `
    set A_i to 21
& n: U0 l% O+ r) w! @    move into Q_induct3
" t  p' C8 n* r    move into pickaisle.induct3
5 T8 x8 ~& I6 A4 v5 P) L: k    while A_i<=30 do begin
1 V4 k5 Y& E- q) |        travel to pickaisle.con(A_i)
0 c5 ^0 f& \# O8 u$ t) i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ E1 m: z4 h1 w: w! o
        else wait for 10 sec
$ u' c$ B: W" o) |; p        if A_i=A_leave then send to die! b5 }: {5 `8 @: @9 H$ q+ U9 q7 I, ]
        else inc A_i by 1
' Q# A/ J9 \1 A, I# B1 b# ~3 i    end
1 h8 w6 W+ x4 w- W! ^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是个什么东东?
+ g; I2 w0 I1 ]* r  V6 f* s; J. imove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ Z1 Q* N8 j, @
1 k& {' B4 f' ?$ n9 U6 v0 C
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。7 S3 @/ r6 E5 U1 \5 b. M3 v% \5 e

; C4 w; K8 }  {6 t+ s$ A另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
: X3 `  a1 m$ b" S& O1 @& p1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, f  Y$ }1 S9 u7 R7 _
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
* E, |" }5 [( l- |! S) V3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:: K2 j2 t) j: Z% r6 k; V% ]
begin P_induction arriving
. u0 p: C8 q% O    clone 1 load to P_pick(A_induct)
5 Y( f. T# R( X& b( h8 G  eend最大的系
! t, i& e1 u- s
) C; k0 n! z. ?! B4 r' J) K) Z. dbegin P_pick arriving
0 |: N8 L1 a3 `/ q. k; m: |    set A_i to procindex * 10 + 1
$ c: i' O3 v2 W# L4 {! F    move into Q_induct(procindex)
5 M1 I4 x8 n; I- b/ p    move into pickaisle.induct(procindex)
, r/ B; h) c, H1 d& s7 k    /*check the type of pickaisle.induct(i), for your last problem.*/
0 d9 X7 U  P3 U9 F6 u0 g" p, ~  X9 g* w0 G8 H4 |8 b
    while A_i<=30 do begin3 Z! {  [! @6 l1 y" j( b3 e
        travel to pickaisle.con(A_i)
2 k. J% c; {$ }% q7 `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( c- j/ a% n" H( H; B0 Y4 N* f) y$ J
        else wait for 10 sec
: R- r, L8 |$ B( W& N2 G/ n        if A_i=A_leave then send to die& R2 B/ O2 s/ N) f! v
        else inc A_i by 1
! ^5 v' c. z) R" B& I  Q    end
4 o- g: h- k  ~* Mend
8 s1 `. B! n8 K3 E1 x5 F+ p% V+ U1 P  A# z" k- l; _- e
其中的procindex为整形,代表当前process的序号。; x& h! P# E  l3 M7 r. ^1 ]
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-5-18 09:49 , Processed in 0.015775 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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