设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11572|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 F' [7 b' e" [; f5 B' n# m, |# Z2 D, R/ n4 Z. n9 Q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& q! G1 t. A0 C' N. b5 p+ Z  u6 C
begin P_read arriving2 X* z6 y9 e) ~: x7 {- H
    while 1=1 do begin% _+ Q7 L$ U' D8 [1 Z  U
        read A_tote from "data.txt" with delimiter "\n"& e. |/ N, D! n. r2 |
        read A_time from "data.txt" with delimiter "\n"
2 ]$ Q: r5 _4 Y8 R        read A_leave from "data.txt" with delimiter "\n"9 n$ }9 z" u, g$ N( T- y9 t& _
        read A_picks from "data.txt" with delimiter "\n"& ]* ]  a" o8 P
        set load type to A_tote
0 \+ R) O# W* m+ c" J* X        if A_tote="tote 1" then set A_induct to 1
5 k6 H" c& i* C, Y9 @        else if A_tote="tote 2" then set A_induct to 2+ T6 U+ }* w) R4 J9 W
            else set A_induct to 3    : [+ `' z% x+ }, o" a) l* H8 i' Y
        set A_i to 0
0 h' h" M% c( p        clone 1 load to P_induction
* O2 k; Y' W. w: ~9 L, E1 _/ R        wait for A_time sec3 e; u, Q, ?# {8 G3 m& E
    end' `3 a7 b" G" q1 k
end5 [6 f' ^% Q8 i3 l

2 Y  m$ K7 x' c# N7 ubegin P_induction arriving0 s3 {( w; o- q  g+ {; r
    if A_induct=1 then clone 1 load to P_pick1
1 [2 B$ D* Z- r) W$ G9 S    else if A_induct=2 then clone 1 load to P_pick2
3 h; K' Z5 V# _; o- {. @        else clone 1 load to P_pick3" d8 t+ G" c( B0 _* ?
end
( h# G  D* h$ {& |  U* G( Z3 j+ W# O7 p+ u. \9 v6 G. s
begin P_pick1 arriving
) D* Y6 ~0 {/ d) G1 l; u- n) g    set A_i to 1
# `# d& m5 T  [1 V6 r' t8 b) ?4 ~5 W/ [8 R& i    move into Q_induct1. A+ r: u5 a/ e! e  d
    move into pickaisle.induct19 K5 @2 x" y  r' @  p* r, i
    while A_i<=30 do begin
; T# ?9 M6 C( V! E% U5 l# W        travel to pickaisle.con(A_i)
/ T) G- `/ `. r6 ]* U$ `% z9 S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ B" ^2 U; G4 q& A4 B, c
        else wait for 10 sec
# \2 i) a* ^  s8 f# [; n: L: f        if A_i=A_leave then send to die
1 I" B% M! `8 s6 \0 |        else inc A_i by 1( g1 G) G$ h8 g5 N2 y( d  g
    end3 S% m" V( W% L( G2 O
end+ y8 S+ i  _, X% P7 @: i0 W  _$ P

- g* h& H6 y( T$ v. A5 Q; J8 ^7 Bbegin P_pick2 arriving  V0 T7 v5 O1 W( U6 x1 S4 B
    set A_i to 112 ~+ l4 `' V9 P- q, V! F
    move into Q_induct28 I, S0 p% Z! r0 n# ^" ~8 S
    move into pickaisle.induct2
+ g3 ^' u5 E: \& X  I  m    while A_i<=30 do begin
! ^2 D; `8 a. h9 Y$ A" t        travel to pickaisle.con(A_i)7 z8 _2 z" O$ N8 J6 l7 U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) [/ j$ C1 ~6 e: t5 N
        else wait for 10 sec- g. {  p7 E% h( r1 O' U$ P  x& \- V# k
        if A_i=A_leave then send to die8 q1 u! W9 U& c. x8 c
        else inc A_i by 15 A. H- J! c/ B  M7 y
    end
0 E' [4 t* B4 z* Rend
" p3 H, z! T1 C( s3 P1 {# e: A. P2 b3 B( }# O
begin P_pick3 arriving% F8 X) H' ~8 J- x9 L
    set A_i to 21
2 x( g' Q3 E- p    move into Q_induct3
2 K$ n5 d; q0 c! y  I2 F8 u, l    move into pickaisle.induct3
0 V( Y8 @4 O" Q6 t8 F    while A_i<=30 do begin( U* z! r! K) Y- j
        travel to pickaisle.con(A_i)- a$ V7 C, d& k2 V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 ?; G$ [: X3 J        else wait for 10 sec% J; E  q0 P3 i
        if A_i=A_leave then send to die; F  c% k% ~* p( p# F- a
        else inc A_i by 12 {: C( k* }1 t7 {( _6 t# W
    end! {( G, A. m+ @5 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是个什么东东?
4 l- l8 c+ H5 _" `0 ]move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
9 j5 S* L6 L7 f
" W9 g3 x% O' A7 T% z5 z! D. dAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
( v3 w' l  I2 g. q9 v2 J: Y% e1 t2 E5 o
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! }1 R, O5 o$ z: i0 [1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
* k' C+ M) \3 D" w: _& [2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ _* `0 M8 x" W. @& n9 O3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
& Y9 k# {- W3 x0 Ubegin P_induction arriving
5 e4 w0 }" ^7 K" U    clone 1 load to P_pick(A_induct)0 F7 ^  ^$ o8 v" X
end最大的系6 G1 t( o( W7 T) x

) y9 D) N/ C: V: N, cbegin P_pick arriving
' Z+ I: B/ `: X# [1 m4 R, z& @    set A_i to procindex * 10 + 1
4 q6 x) D- g) r* b% g( j4 K0 z9 P, t    move into Q_induct(procindex)
' W( J; o2 S1 V8 ?% T# b  o7 V( _    move into pickaisle.induct(procindex); o0 ~& V; m# T4 T  o
    /*check the type of pickaisle.induct(i), for your last problem.*/
/ O7 r6 X7 L3 _! m5 P! C+ @5 {. N
! t% [! ^& ~: `8 m$ l6 d# b    while A_i<=30 do begin
8 W) I8 q7 g  p- a: w9 V- D/ \        travel to pickaisle.con(A_i)# J: c7 A2 T' n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 v  R( F( G9 L+ L        else wait for 10 sec- g2 l. h# d" E5 Q& H
        if A_i=A_leave then send to die
  |% ?# V, v  {% g0 ~  A; C/ q        else inc A_i by 1# h" r& S+ H! s$ y
    end
  B/ _3 C- W" T: @end2 F3 j" P/ q, v' L
$ ?4 ^- U/ f/ z1 ^+ G4 {0 ^
其中的procindex为整形,代表当前process的序号。) N( V5 p& f0 X
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-21 14:36 , Processed in 0.017700 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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