设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13890|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. ~0 y) ]  v. _' E# W

4 d, N0 m, H1 {! m5 y. G9 T我的问题是,在每个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中的数值,不知道会不会有什么不妥。  f3 }( C% P1 w4 L* ^

6 s8 B, |6 C: B0 r# Dbegin P_read arriving
. D  f( k% F4 q. u. l    while 1=1 do begin, X% p' H0 Y' e' L
        read A_tote from "data.txt" with delimiter "\n"
- D' k- Z+ g5 B  K* s        read A_time from "data.txt" with delimiter "\n"9 z' H* \/ x" B
        read A_leave from "data.txt" with delimiter "\n"# Y+ v6 y1 h! E8 @
        read A_picks from "data.txt" with delimiter "\n"; T! {/ C0 w% L8 D& |8 b
        set load type to A_tote8 G+ B4 |5 u) Q6 L
        if A_tote="tote 1" then set A_induct to 1
& t" f- L4 Y/ D4 C+ L$ E" E        else if A_tote="tote 2" then set A_induct to 2
) |. x8 R; ~: W0 a. J            else set A_induct to 3    9 D" Q& B3 i" _9 u
        set A_i to 0
9 d# T+ \1 O7 g, _, K" b        clone 1 load to P_induction. `1 E; b9 @$ |, |
        wait for A_time sec
2 x( H6 P# J' R/ i    end( G0 y6 K/ ?' m1 n0 W  O
end* P2 |% {' S# T( ]" ]/ {8 W3 ]3 @: E
$ O4 k6 {  m9 c- b. C9 Z& W% P
begin P_induction arriving2 T+ |: p2 @: e9 P/ j
    if A_induct=1 then clone 1 load to P_pick1# m' C9 w3 E) F# ]& t% P* p
    else if A_induct=2 then clone 1 load to P_pick25 I! J0 i! V' K" \7 C  g
        else clone 1 load to P_pick3- }1 b! M3 q; p+ }6 ~* p3 Z/ I+ q
end' |- ?' T( B+ H! i
) F' X" p, i0 A# k8 K- y5 C
begin P_pick1 arriving
0 }2 Y0 E. R' N    set A_i to 1. J$ F+ V, n! |$ r
    move into Q_induct1' [' S, p( `# I
    move into pickaisle.induct1+ S7 W; [: y. r' w( h) ^; Q
    while A_i<=30 do begin- j+ Y$ a; d! @; Z) ^7 Y5 A3 J+ ~
        travel to pickaisle.con(A_i)
* A# s( w+ B% u6 ?' ]* B. W+ `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* w7 S5 f6 A* `$ B6 w4 v4 L
        else wait for 10 sec
3 c# v/ e4 Q. z: h' r/ H2 x        if A_i=A_leave then send to die
- c% J( g9 F% t/ F        else inc A_i by 1% b) H. m* |/ E) V2 [7 w6 H. y3 ^
    end
; n" }% s7 v7 L2 U; |end
6 @& g8 h- L+ H6 n- s' U8 O  i
+ X7 [/ i) {6 n3 Cbegin P_pick2 arriving
. Z' O1 l$ U9 h- H8 h4 D3 S+ R" D    set A_i to 114 S; z: ?- a4 p( ^8 W; Z
    move into Q_induct2) {1 {2 r( A; c" g7 z6 W8 O0 F
    move into pickaisle.induct2
& F4 g# P2 h' }1 L1 q    while A_i<=30 do begin2 u# p( @$ {& Z& u( P
        travel to pickaisle.con(A_i)0 S  Q; V) H0 K) I8 m3 o1 e3 c* t2 u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& L. `% Y/ Z2 ^: N( ]
        else wait for 10 sec% U4 M) B% k& a8 i- F3 U
        if A_i=A_leave then send to die
0 f- [4 F4 V# i; W3 P% @        else inc A_i by 1  w, C' g1 Z/ C+ X  J+ Q/ Q
    end
& A) j4 {% b% h% m6 Y/ @; ?end8 |; U, H/ T/ q* E' D" G% Y
6 X  G+ u  I4 F) {9 b4 c3 f: @
begin P_pick3 arriving
7 Q; i) r  J4 {' G    set A_i to 21* D2 U+ h4 z0 ?& _+ ~5 i( ^  a
    move into Q_induct3
4 [( j: A8 W4 |) G1 p+ e$ _    move into pickaisle.induct3
. r& z5 f# F2 H( f; H    while A_i<=30 do begin
" r) M. M8 U  @' N        travel to pickaisle.con(A_i)
* v# m% w( ^5 o: c9 [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- c9 _8 d* S! V) f0 [! n
        else wait for 10 sec# F% W% r6 r7 C
        if A_i=A_leave then send to die( P3 n/ v6 s* l/ v, G0 g
        else inc A_i by 16 k' w$ P7 n( E9 K- i
    end! `7 d: U( c! Q$ `
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是个什么东东?
+ ~6 x2 r' B2 ~9 }1 a! zmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 Z# F, G. G+ Z& F. t
( q& \& K- l* t0 w/ j' m" i3 g9 vAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
5 X8 ~8 I2 A% }' @: Y7 n( Q3 y7 A- h8 ]+ R+ }1 K  r" u
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 a8 E% h  l# c0 E/ H0 U4 w
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
; ?4 [1 V: }5 j% V" F) W( h2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- Z! q3 M3 A2 x0 H% D3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
- d3 }( P! f9 O3 P& R/ a( Ibegin P_induction arriving
! z- Y% n+ L) X% v- ?( R: t) s    clone 1 load to P_pick(A_induct)
7 w; V/ D! r2 q/ r8 bend最大的系* e1 B4 ?# K( {# O6 {: i6 p
# j8 h: _. m( T0 F+ {3 K) u7 ^
begin P_pick arriving
! t% {4 A' x4 ^    set A_i to procindex * 10 + 19 @' |" ]2 i* c& N( O. N3 X0 O/ V8 o
    move into Q_induct(procindex)9 I% B" o; s2 O
    move into pickaisle.induct(procindex)' C0 ^6 w" m, D
    /*check the type of pickaisle.induct(i), for your last problem.*/
) i1 @$ w$ f0 u& ^' Q* S4 ]9 [: L0 e1 D: Z) R7 W1 B5 r2 @% e
    while A_i<=30 do begin
8 o1 ]/ ]+ a" f" G0 s5 R        travel to pickaisle.con(A_i)
% P0 j( I7 @8 P# K! M5 u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; v# G  {3 ?0 T% h
        else wait for 10 sec
9 R8 B: O9 X$ P% I        if A_i=A_leave then send to die8 z" C6 n9 \6 |4 ^7 B# w/ Q7 K
        else inc A_i by 1
: z5 y# L# f9 J* b  c( D% M    end
% _1 O1 y7 r7 N4 g( Q/ I" a; zend' [; t7 S* H* a$ A- u$ c

1 @6 \4 h5 ~0 {. L+ e其中的procindex为整形,代表当前process的序号。. ]: z8 M, r# y0 N& @* 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, 2026-5-15 16:18 , Processed in 0.020224 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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