设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12411|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 y( x. T4 _* m/ m+ C
0 n5 o- u! l$ ?; 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中的数值,不知道会不会有什么不妥。+ z! M2 Z! u$ F$ M
8 m" c$ W5 y* N" z0 o
begin P_read arriving. S' Z0 A9 y8 [; [
    while 1=1 do begin
6 u/ u% |  L3 P; @; K        read A_tote from "data.txt" with delimiter "\n"- @: @) U$ G& G$ R
        read A_time from "data.txt" with delimiter "\n"
% e$ U$ e, p. U, i/ j: x  r        read A_leave from "data.txt" with delimiter "\n"( E% R% F  \0 x; b- x* L! O5 q
        read A_picks from "data.txt" with delimiter "\n"
9 p2 _6 B2 g, d! O        set load type to A_tote' z/ O6 {7 s# S8 v' A6 h
        if A_tote="tote 1" then set A_induct to 1
- X2 Y5 e. m- T( V2 {  [4 }        else if A_tote="tote 2" then set A_induct to 2* U$ l9 ^9 I* J' x0 Z
            else set A_induct to 3   
" ~$ z; h; J8 S1 B8 E+ O        set A_i to 0
! \. R1 I  M5 F7 X        clone 1 load to P_induction; Q$ U2 Z5 X+ r* N3 m
        wait for A_time sec5 [) b( Q  O' }2 |/ Q  i- z8 o
    end: O  K0 f% p" _+ e& t
end
/ `. K2 p- d* y1 G; U7 a8 [4 ?8 ]5 K; O8 c0 x8 ^' Z# t' D* x( N
begin P_induction arriving% P* @7 f$ r/ h) l* s0 \& d& V& \9 i
    if A_induct=1 then clone 1 load to P_pick1
( M/ `' e% t' J; O  ?) U% M    else if A_induct=2 then clone 1 load to P_pick2- Y9 ?7 D( j  P5 m
        else clone 1 load to P_pick3
" a: |0 A) p1 Z- }6 `( Z0 S* aend5 k: V# p* @8 g8 M8 t. v
. @0 W* j$ [9 K
begin P_pick1 arriving; t9 E$ t7 Y( k) S9 v" S
    set A_i to 1
) i$ v+ ^4 h! _; L. a* t1 }    move into Q_induct19 \( K6 S/ |/ J8 H/ ^
    move into pickaisle.induct1' Z0 M  K! l7 \: w4 Z8 W
    while A_i<=30 do begin2 k% b$ H2 a% y5 {4 v' ]. ]
        travel to pickaisle.con(A_i)
# a$ c3 Y" E3 Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) f; ~: b6 |( ~        else wait for 10 sec
& x3 e8 p2 u9 n& K/ F& C        if A_i=A_leave then send to die1 v$ [! m$ r8 M! s: m
        else inc A_i by 1
9 |* o" c+ m. n    end$ q4 ]$ Q5 j) D3 b/ J
end- `  _8 A% U2 O) [- D
8 t7 W( w6 ]  _9 J$ g3 y
begin P_pick2 arriving
9 Q" u" ?  j* d: L8 q6 x    set A_i to 11
6 C7 @1 B1 J- L) W' J    move into Q_induct2
$ Z! _9 c+ ?! J7 o' X* x    move into pickaisle.induct2
( W7 U$ N0 e, T2 E' o- O5 ?3 v    while A_i<=30 do begin/ ~. [' I. K6 |; d
        travel to pickaisle.con(A_i); H( w1 r' \7 f% [9 Z3 ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 S; X2 z! q; {0 X
        else wait for 10 sec" U- e% P, Q3 m+ O/ C6 d5 J9 e3 {
        if A_i=A_leave then send to die# w! M1 V) Q3 E. {4 W$ O# h4 [7 c
        else inc A_i by 1
$ Y1 ~* C& c: p0 i7 ^6 \    end
0 G0 ~4 [* Q% v7 X3 A& C7 Oend
2 H' C& f# ~# @  L6 Y8 ^5 D( z. L5 g  B* K" b/ b/ q/ S
begin P_pick3 arriving
& P8 Y0 A; ?: f3 h$ O* x" q( p: i    set A_i to 21
7 E( w3 ]8 I* ~) |    move into Q_induct3
" V* y. @+ U& e/ y7 X& Z    move into pickaisle.induct3+ m" n4 f* ~' R
    while A_i<=30 do begin7 H1 l# n: P! F6 Y! @
        travel to pickaisle.con(A_i)" C9 F1 B  z. q9 a8 }( e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 l) C' a" s" J6 ~1 r3 ]+ ?- t
        else wait for 10 sec
# f7 e) ]8 I2 S$ J/ e* r        if A_i=A_leave then send to die* g9 Q" R5 f# ?
        else inc A_i by 1# ^* L  ~+ e/ T' t6 H9 s2 K/ W
    end
* N5 {) e% _) ?) a0 Nend

最佳答案

查看完整内容

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是个什么东东?
% |  o! ^) c7 W4 O: n- W% W/ H- Omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?+ l9 k2 {1 V. A: b) F  V. [

6 V9 V, j3 \6 E0 k$ f) wAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
: Z1 M6 m& d  B5 Z
* S0 i- P# x4 b5 ~6 p% ]! `另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:+ g. n7 ^$ Z8 G; b
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, h6 V& i5 W  |
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;0 E; i) `# B/ T: H$ Z# q
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
& y- Z+ q3 U6 b1 p+ Z3 Ubegin P_induction arriving- L" h+ `8 x9 u0 g) z7 j+ ]; R8 }
    clone 1 load to P_pick(A_induct)
7 h& v, C" D4 ], N! p) w" _end最大的系
1 M2 u; G1 U; z: x- B/ @2 j& [. H, d: h
begin P_pick arriving) v& A' M* |) O* o7 Q4 {3 k* z2 j
    set A_i to procindex * 10 + 1+ b- M" P0 c$ P' F" I
    move into Q_induct(procindex)6 d) O0 |2 y0 I9 |& _# Q) f
    move into pickaisle.induct(procindex)8 f  a4 Z  d7 Z! {# s# u8 [
    /*check the type of pickaisle.induct(i), for your last problem.*/' }4 E- H$ E$ o6 z8 u6 U6 Y! B% D
* k: A0 U: T$ J* e! u  z
    while A_i<=30 do begin
1 F& M* q0 h  {; K) E        travel to pickaisle.con(A_i)
/ Y% j2 B0 d8 P4 Q% H1 e+ r3 ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' |8 ?5 y  L  T* V$ @8 S7 ?, `4 I        else wait for 10 sec5 R6 `4 y/ D1 p/ M; W
        if A_i=A_leave then send to die
1 P& A4 m& ^* i, o; |) d. @& s        else inc A_i by 1
  r3 t6 A  j1 t2 i, O7 o3 n" r    end( {: G; y2 o5 C* ?. v& [1 G" P3 R
end
0 C+ C% p$ m' O$ _  G) o, }* l# Z2 J7 P
其中的procindex为整形,代表当前process的序号。! f4 e0 J. |7 ]2 B* ]
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-1-21 09:46 , Processed in 0.015965 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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