设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11682|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 I+ k/ m* `* j, Z4 O% x% _) X/ T7 m% b
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' C, a3 B7 |' @; z& U$ {# B) a
- g6 _! o& ^6 E% Hbegin P_read arriving: ?! f% m8 R. d$ ?" Q' p: A" D
    while 1=1 do begin: B( Q& g" s5 a+ N( t/ H! M& N
        read A_tote from "data.txt" with delimiter "\n", o' Y4 O; B& v; `# _6 V# \
        read A_time from "data.txt" with delimiter "\n"! Z* Q: {8 V  m5 Y
        read A_leave from "data.txt" with delimiter "\n"
1 {! j2 f; A% ^6 I        read A_picks from "data.txt" with delimiter "\n"
0 K( b* D$ F( G6 V* C% {5 ?        set load type to A_tote1 D" @3 b/ ]. w2 G! \8 ~+ |$ k
        if A_tote="tote 1" then set A_induct to 1
! X7 K5 j9 o2 Q, |        else if A_tote="tote 2" then set A_induct to 2
7 A4 e9 V3 [3 C' _" z/ T            else set A_induct to 3      }; S7 H, }  w' {7 i2 I
        set A_i to 0
! E- X0 Y- p5 B" F        clone 1 load to P_induction
6 \( H7 {% q+ f5 `$ R+ x        wait for A_time sec
6 X) H* a8 g4 N0 n; L+ a! o7 q/ R/ ?/ E    end
; i. k( d( l. V6 iend
6 E! M8 C5 j! S5 F9 |3 U$ R8 O1 X6 |! E/ @
begin P_induction arriving% f* }$ S9 K& W, B& k" s& |
    if A_induct=1 then clone 1 load to P_pick1
& S4 U+ ?/ W7 m1 l+ h7 ?    else if A_induct=2 then clone 1 load to P_pick2$ S: _( Q. A* I2 Q) W
        else clone 1 load to P_pick3& z; l$ L3 I) L) s1 Z* g
end
6 ]4 U6 \2 a6 Q% o& C& J
# Y+ r9 ?  T1 ^7 D5 }3 p) Obegin P_pick1 arriving
0 O5 R% W6 N) x* Z' q, C: ?0 E% O- C    set A_i to 1& R# v3 Q- ]+ `
    move into Q_induct1
& n, C* A* r* h2 K    move into pickaisle.induct17 W6 P' J0 v! a
    while A_i<=30 do begin
4 M0 A5 g& j+ Z# H- o+ ^! T. \        travel to pickaisle.con(A_i)
, V5 L! B  Q. y" p% I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 A7 T9 u) t* T& u$ u  Y1 e+ o: z        else wait for 10 sec- ~% H' N$ h. G! m
        if A_i=A_leave then send to die& o9 Y  F; v* @" _( ]; O# p
        else inc A_i by 1
3 s  Z$ x, |3 Y3 G4 a    end
- K5 q4 L3 P" Y* Y- B6 z! U  }7 w: pend
* E2 G# S. p3 P9 u. X. M8 J
8 d7 x5 `$ ~# p. @begin P_pick2 arriving* F/ |1 |, p* [+ B8 \4 w& u
    set A_i to 11/ g6 K  J7 m1 A" r6 y2 B6 s
    move into Q_induct2
8 {" s* `% H* U/ t" b% }3 ?    move into pickaisle.induct20 c2 R7 n5 Q, b
    while A_i<=30 do begin
4 @3 O$ V- ~2 ?' {1 C! a! a        travel to pickaisle.con(A_i). U; W' F, {! C) d3 i4 V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% c, S3 R* p  {1 [$ F# H* @
        else wait for 10 sec, X* u- p/ o: @! V; F
        if A_i=A_leave then send to die/ y6 K3 y: P% I+ p+ u/ }+ C
        else inc A_i by 1. {. E, q! ^$ r
    end
% M( M. h% ?: _! Oend- }  ^( g/ R( q$ y" ]1 J0 i( M' e
0 u: o4 l  J* m
begin P_pick3 arriving
) X0 w8 N3 D' S# [, O. b    set A_i to 21
* ^4 v3 M1 v7 B+ p! B7 R    move into Q_induct3
: p6 A' n" f+ I    move into pickaisle.induct38 v$ ]3 d) m. L& E) o8 I; N
    while A_i<=30 do begin
1 x# M4 T* ?2 L8 D/ S6 {4 ?5 t        travel to pickaisle.con(A_i)- ^# H, s; x# y8 n4 t2 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 f& w' n5 H, V5 K  T/ ~
        else wait for 10 sec/ A  E5 [+ e0 N3 |* h% @  ]. A
        if A_i=A_leave then send to die' A# ]* s, h' O
        else inc A_i by 1
6 c: n$ D2 |5 C% ]    end
" u4 X- E' Y$ N) z! uend

最佳答案

查看完整内容

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是个什么东东?
4 U# J" q" }. @5 Nmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?1 J. V1 W( t) @9 D  M$ Y/ n0 }; s
4 ^9 K" v: T6 Y1 ^2 U
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。  ]  c! {( {* x9 G- w

4 s5 K' }6 C+ }0 K: w另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 I, ^7 L  _: e1 |6 q9 L
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
6 D" M6 s# L0 @! W2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 k7 b9 A) ?8 X' u8 H
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:$ Y- ^) y+ F, N  o6 t8 l! T" E- @3 ?/ y
begin P_induction arriving
& p/ }7 Q* n3 ?4 j    clone 1 load to P_pick(A_induct)
* K! J) o: P, ?# H" F8 p/ u/ Qend最大的系1 W+ r8 V5 {1 G) k; w2 j
" r4 Y4 }+ A9 E2 g: C
begin P_pick arriving
2 Z" s6 M; z5 e3 v3 u5 c0 P    set A_i to procindex * 10 + 1
) M$ r0 K6 \. ]/ y    move into Q_induct(procindex)
; w6 \7 Y: I, }# w* n  i; }3 V    move into pickaisle.induct(procindex)( q8 l9 B5 `0 U$ d5 s  K2 h1 O
    /*check the type of pickaisle.induct(i), for your last problem.*/
- u0 X: d' b. a* W) R4 ]- o" {) ~4 v  _. O  C/ e* n, J+ h2 g/ x
    while A_i<=30 do begin
/ j6 c: h' H/ \+ Y. D( g" Q        travel to pickaisle.con(A_i)9 D' G/ p- C5 b4 {. @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; Z$ p  b  ?1 g' |6 B1 s. ~7 c9 l
        else wait for 10 sec5 |3 w6 @* l3 H/ a' f1 I
        if A_i=A_leave then send to die8 K3 t, a% v: e
        else inc A_i by 1
$ d; v2 D2 Y' `7 R4 @    end
8 K4 x. I% [4 C, n$ h8 n1 [3 y' V0 X0 Mend+ z0 @; {; i% V+ H! C

+ v) J$ R& J# Q. j其中的procindex为整形,代表当前process的序号。
; u4 W6 l8 t9 H# Q" ostation和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-27 08:21 , Processed in 0.018874 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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