设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15176|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: H1 j) K) {  O! {6 y* u2 ]0 O& {- [8 A+ |! {4 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中的数值,不知道会不会有什么不妥。
+ L2 c* ?, x. E( `. F1 G2 M- W- e: U1 m% ?4 a2 d8 z" A+ M
begin P_read arriving! d, {; a* a& J9 `0 ?
    while 1=1 do begin
6 l3 h/ T; l) w5 T6 K  m& i! g        read A_tote from "data.txt" with delimiter "\n"
+ @; b+ S# z) d5 S/ m  l0 y        read A_time from "data.txt" with delimiter "\n"% M' S/ B# o* b+ C$ U
        read A_leave from "data.txt" with delimiter "\n"
7 z& a) S; ^8 k        read A_picks from "data.txt" with delimiter "\n"+ h. m0 y5 Q9 H  n" q1 m5 P$ v
        set load type to A_tote
' \  }) T8 H- }5 f        if A_tote="tote 1" then set A_induct to 1( y5 E& g6 A4 C4 o- L6 J
        else if A_tote="tote 2" then set A_induct to 27 b& S# z! [1 q4 I4 v2 r4 I
            else set A_induct to 3   
: p" ^, U* [$ l2 ^        set A_i to 06 J- F. U. n$ f% G' X# N) D) ?
        clone 1 load to P_induction
1 T. a* G9 d$ w- N" P        wait for A_time sec
8 o7 O2 L" X- q! h# x/ b    end
7 @& L- _3 [: Y9 \& Xend
) d$ D# b  s" V7 e0 r. @( q
- `  z" u" U5 x0 F9 sbegin P_induction arriving) q4 J0 M* I) V5 d
    if A_induct=1 then clone 1 load to P_pick1
1 n# H7 i& F* O8 g# K3 I    else if A_induct=2 then clone 1 load to P_pick2
; w- s" J9 _% l8 @* e1 [        else clone 1 load to P_pick3
0 T+ n7 p" v. e7 r2 j7 w8 ~& T! mend
2 c+ H/ l/ H+ ?" |1 _7 j
4 C5 \& E5 r9 P3 p( D5 p% Obegin P_pick1 arriving/ A) G0 J2 Z0 B
    set A_i to 1
* b, z$ N* ]7 ]1 I6 f7 q( g) M. k    move into Q_induct11 L8 J* w+ f: m" R6 M2 @2 @0 n' e
    move into pickaisle.induct11 S, d8 `8 ~: U' y
    while A_i<=30 do begin$ q# a8 y! f  ~+ ^
        travel to pickaisle.con(A_i)! }$ _, n# |3 z  G8 T" _1 l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! K* x6 C# Y$ ]2 R: v6 w3 \        else wait for 10 sec
5 S/ B# L/ y: r) y* @: ~        if A_i=A_leave then send to die/ G& ?* ~% P. P. B
        else inc A_i by 1
3 d- ^$ k% I- U( d5 W2 J    end+ e& P) q+ J! ]8 T6 }
end! \$ F. I- ~. `3 A: C7 _2 `, F0 r

! K+ X# ~$ y  I3 |1 O8 q, Q8 @begin P_pick2 arriving
8 _+ {5 y8 C* Y1 f! R; ]    set A_i to 11" e" I9 @. [& A. {; Y0 D+ x! R% o
    move into Q_induct2' o' q. `8 |, \* n. @) e% p
    move into pickaisle.induct2" o' w( Y" V8 E9 L: e4 O/ y
    while A_i<=30 do begin
/ E  a6 L; b5 l  ?        travel to pickaisle.con(A_i)
; t$ `* M; H2 L$ ]/ o/ ~- S' V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' \2 a& v0 W- h+ i' A% w
        else wait for 10 sec. o# D3 ?8 c! A  }, L
        if A_i=A_leave then send to die6 N9 G* |2 I; g5 A& c8 {
        else inc A_i by 13 E# E/ Z6 i3 Q$ C
    end
3 t; ]) n. D0 b. send+ n/ S7 S; I* l9 o  e. U, X( h% K9 Q
1 z* f6 ~# S: j% @
begin P_pick3 arriving" t0 ]$ W) P6 c  D* f# U9 J& \
    set A_i to 218 [7 L6 ~7 ~3 O6 [* q5 j
    move into Q_induct35 S! I5 B8 j& R5 U' ?% b
    move into pickaisle.induct3
# n' c& w% |. o; A    while A_i<=30 do begin- p$ I0 @/ T" |: l4 E. o
        travel to pickaisle.con(A_i)
; z7 W" ~, n3 u8 k6 o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ [! a+ F0 K- l$ r6 v' x) w        else wait for 10 sec. s/ b8 V& X) [$ g
        if A_i=A_leave then send to die6 d1 R! Y  w9 O# E6 C3 M5 {
        else inc A_i by 13 _: k4 G; j0 |! }3 P8 e
    end
( h0 M& _9 x/ 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是个什么东东?7 m; R7 i9 u. S7 ?$ M
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 d6 Z9 O- B5 ^# [2 _
+ N" A$ H) a- Z1 y, r2 tAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。6 _2 ?3 [/ A3 b8 y  u2 b) ~
4 P6 _& l: K) Q* u
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:( L6 S" R0 l# t& I% H; C
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;  i3 T) c2 O8 ?3 ?
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
6 p0 r; t, \) ]( f* X+ u+ |3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
: W, u, z+ u/ {+ t, k% k5 `* wbegin P_induction arriving: N' |5 u9 p! d9 h- P
    clone 1 load to P_pick(A_induct)
( ?& t/ o& m5 M+ d: e* dend最大的系
; e7 V. g/ O8 M$ r% c
7 \6 o' y) D, v1 p' Nbegin P_pick arriving
- Z% F/ ~/ z5 H    set A_i to procindex * 10 + 1
' r0 T% g* ?' Y2 }    move into Q_induct(procindex)/ q$ D0 Z" V( T/ i  a+ A
    move into pickaisle.induct(procindex)! e6 J+ w5 y, y* ~0 E/ u- _5 ^
    /*check the type of pickaisle.induct(i), for your last problem.*/" g0 R; O6 ?& }- a- j( V5 q
8 ~# Q1 i- w( v0 V: X$ ]$ O
    while A_i<=30 do begin5 t+ }; V% `* V. X
        travel to pickaisle.con(A_i)
+ T4 _7 q: q5 c0 K+ R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 L' G+ b+ ?9 g' ~        else wait for 10 sec
) S# u7 `( l* g9 v& E        if A_i=A_leave then send to die* J* f6 _, v( S  B/ v7 l: s' s
        else inc A_i by 1
" [: Y6 [, P& P9 i    end, c) O: Z) i5 \" {. B5 P  a7 K
end
' ^$ z7 W* h" _% p0 M( `" f$ y  o6 O9 k
其中的procindex为整形,代表当前process的序号。
9 y" z7 P* o3 J3 b9 Ystation和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-8-19 23:00 , Processed in 0.017391 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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