设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13156|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* F7 f& H# u9 B4 O" h2 k( |  z9 A% l$ [( S5 C; @0 l+ z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。: j4 r, A0 f! {+ ?
4 A: d# g) f( _: u" N
begin P_read arriving
# @: C# V4 }: G6 p9 e8 t    while 1=1 do begin
2 Y# i5 X; T" \8 W7 n        read A_tote from "data.txt" with delimiter "\n"% H. v1 u( d( n3 V0 Y
        read A_time from "data.txt" with delimiter "\n"3 P$ q6 M! r& ]8 K* e7 p
        read A_leave from "data.txt" with delimiter "\n": q, @- D7 @( u2 P# F5 w
        read A_picks from "data.txt" with delimiter "\n"
( M* \0 t2 c8 u- t+ ~  u        set load type to A_tote4 t1 r& x% f4 |' z; h; n* S  z  O+ B% n
        if A_tote="tote 1" then set A_induct to 1$ u- K9 W7 e9 O( n/ d$ k. a% T
        else if A_tote="tote 2" then set A_induct to 2% H1 a. d& R! h+ ^7 k$ @' w
            else set A_induct to 3   
2 R3 w" \- r/ K: e6 W1 h        set A_i to 0& x7 a9 ^: W7 k9 s4 r) U/ J
        clone 1 load to P_induction
! N0 ]; `: x. ^" n2 S) r0 B% H# o        wait for A_time sec
' k$ S0 A2 T3 x- A    end
# T3 a/ f7 M2 c9 q6 Z- N  xend8 r' P+ _5 M- e. r
- m, u( x% W6 I9 M" C
begin P_induction arriving9 b4 C8 p7 t( U2 |; g1 G- L
    if A_induct=1 then clone 1 load to P_pick1
7 O3 Y; z+ j) Q: ?' X' E+ x5 \    else if A_induct=2 then clone 1 load to P_pick2
. K# x6 O6 m9 M# @) S5 {        else clone 1 load to P_pick3
+ S4 b) n# ~, l  x2 Send
4 O3 M8 C' n4 }
: p2 Y) A( y" t7 ~begin P_pick1 arriving8 c* x; ?9 O3 `# w$ Q  ^% w2 y0 @/ S
    set A_i to 1' i" M. m) r" J
    move into Q_induct1
3 ~* C. p. @) B- H1 D    move into pickaisle.induct1
8 E( y2 t5 f7 p: u, j3 p    while A_i<=30 do begin" [  S. h# G/ Q# @8 d; a
        travel to pickaisle.con(A_i)
+ w; e9 u- Z  V% v/ a% f! \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; B8 n1 Y. V$ G. g4 S' Q        else wait for 10 sec. [/ D, J: t; M6 I4 u
        if A_i=A_leave then send to die7 F3 |7 M3 f1 K9 J, t" a+ s7 g4 W
        else inc A_i by 1
& }( d) Y+ u4 O6 d' n0 s    end1 ~: R5 [. a9 r2 e  C& ~; u' N
end! d9 ^; F8 I! V9 G5 m
( S7 t% ?( S. Z
begin P_pick2 arriving
# h1 O6 X$ E& A& h/ K9 C/ d# x    set A_i to 110 _1 Y4 R. p0 ^3 r
    move into Q_induct2) E0 ~* f' p& J! d3 w# U
    move into pickaisle.induct2
0 u3 w' H" l4 c  f0 c9 v    while A_i<=30 do begin
( C! V% N3 e! a' L" X        travel to pickaisle.con(A_i)
- m- F) e+ r; W- T7 J" c% Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 H% t3 T$ p: J
        else wait for 10 sec
! H+ l$ q( ~- h7 W( y1 e6 P        if A_i=A_leave then send to die2 e4 O" {5 ?5 k8 G
        else inc A_i by 1
- v6 u0 W8 n' ~    end# ]0 f2 R, U3 E: k: o* @
end, w* q" \3 X8 u
: p7 q2 x5 |  s+ j! d( x9 D
begin P_pick3 arriving+ g* }- Y7 G4 x2 H# ^; P% h% r& ~
    set A_i to 21
% {4 A6 J' R+ c8 H4 U3 Z$ U    move into Q_induct3
8 R/ n  H1 L7 X+ b$ x* F( Y, j- c    move into pickaisle.induct3
0 L. j1 t' {7 b- y# l    while A_i<=30 do begin
# ]& k6 a& t& ~! C$ w$ q# A0 J3 }        travel to pickaisle.con(A_i)- z1 ]" C" c9 q" y0 G, O" z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% O6 [" f9 Y0 {2 k. `8 x3 {
        else wait for 10 sec
8 T) y9 h2 a' C' `9 D8 l        if A_i=A_leave then send to die' R! R+ ~6 M% K  b4 I
        else inc A_i by 16 R1 ^7 ]8 t8 i+ }$ i' d$ [
    end
' J& U5 n& N( W' K  H/ r3 Xend

最佳答案

查看完整内容

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是个什么东东?
6 J, B& A+ I3 X' F: ~- omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 w! O: o3 Q* H! b4 }! O& d
4 ~5 M7 \; |8 rAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。* T) B( `3 |8 }3 q
; t* E/ \$ p2 s' o3 {6 r' e5 j
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:! K# T4 r/ o) i0 |5 ?- i! G( g' D
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
+ K: \, E3 u; ]1 a& y2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 C! l6 u" O% c6 J* V3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 Q: F; V* @3 p  i3 {" Z3 i
begin P_induction arriving
: O  n8 T9 x( i1 O    clone 1 load to P_pick(A_induct)1 H% q2 y; d) K4 V+ A
end最大的系
% p$ s% ^" Q# c4 b! D! J( U( M
, Y# t# I& p: x  B) Jbegin P_pick arriving
% e8 w  o. E) f0 E    set A_i to procindex * 10 + 1+ `' _3 |6 `7 h9 V( W/ n7 X; p
    move into Q_induct(procindex)
. @/ K8 V) M( q' T" \3 P0 X    move into pickaisle.induct(procindex)
1 x2 c1 d& z3 `0 @; D2 Z/ `    /*check the type of pickaisle.induct(i), for your last problem.*/
3 V1 D, d; o% p8 A( ?; a: a$ s* Q) c5 c
    while A_i<=30 do begin  [# Q3 X# l) m8 T! F+ A
        travel to pickaisle.con(A_i)1 q1 Q- m: p, Q' A# ^% e* v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 e! b3 F# Z/ S! G3 j3 g( y        else wait for 10 sec
- \/ g( _6 c& u+ Z7 U        if A_i=A_leave then send to die
2 f! c/ G+ D8 U( v  m        else inc A_i by 1
5 G, F* L1 M0 Z  g8 _9 n7 }4 r' x/ M    end  y- j9 y( W# o; i6 r* b6 \* ?
end# e8 k) T& Y5 g* l
3 u# t9 }) W" Z- N0 H. a" g2 W  ~4 i
其中的procindex为整形,代表当前process的序号。4 A% E+ X% A2 L' J" y, u  [
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-3-22 15:27 , Processed in 0.018918 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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