设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12990|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢9 q7 ^) Z9 H( W" V* h
+ w' P% t& b: s4 p8 Y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
0 g2 T, x2 o9 d6 P6 z+ h
2 S4 ~* v+ m0 S2 Y+ P0 P2 Mbegin P_read arriving0 b* o5 o* o2 P6 J7 a; L, Q- W# W
    while 1=1 do begin) N: O6 B" T- V* A0 ]9 b" i+ a
        read A_tote from "data.txt" with delimiter "\n"
  k6 H  `+ k( `; ]: ~/ ?( {        read A_time from "data.txt" with delimiter "\n"
# q  j8 F5 J/ c& P& t$ o7 N- Z, o        read A_leave from "data.txt" with delimiter "\n"
% e& g+ l" ~  w# n7 a0 g: Q        read A_picks from "data.txt" with delimiter "\n"
# g, k. a' I, a# W9 \        set load type to A_tote1 N. _0 ?% Y( h, r
        if A_tote="tote 1" then set A_induct to 1
/ o9 y& q) Y! }6 y8 ?& ^: n9 F        else if A_tote="tote 2" then set A_induct to 2- W  m! [; O) Y7 g
            else set A_induct to 3   
2 H8 a# h# h3 a" W' V9 [        set A_i to 0; [9 i0 V# s' H0 u- ]3 K) w0 W7 I
        clone 1 load to P_induction
, b6 {; Y+ h9 s, b3 F        wait for A_time sec
. Z6 ~3 d3 d/ e5 w8 ~    end
5 l& E) ~- s- k7 G, \$ P# @end
+ s, ~% D9 I" R5 h( G: r; M" }2 n8 v% U( E' q
begin P_induction arriving
$ T7 K4 W) m$ K    if A_induct=1 then clone 1 load to P_pick1* y- R6 p3 T" j
    else if A_induct=2 then clone 1 load to P_pick2) T1 n' K3 o, @$ U8 ~0 v5 t
        else clone 1 load to P_pick3% j, u2 w* W: l6 a
end1 [* c: a7 }/ q2 s' X+ F. {

, ]! F- @0 D* M) E3 }( jbegin P_pick1 arriving
+ q+ z& Z2 l  `. q5 O; `* C# _    set A_i to 18 {3 x2 n4 Z. ?* R1 Y) w- Z
    move into Q_induct1
- k! r1 q/ A5 I) Y, ]    move into pickaisle.induct1# m& e  U$ X4 o' [& P/ e* z
    while A_i<=30 do begin  ^4 _3 w! x$ k
        travel to pickaisle.con(A_i)3 w# g# G5 A; [) R0 E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- K" T- m6 v( ?: i* D% o        else wait for 10 sec/ ^) o6 D+ b. m8 L7 V, [
        if A_i=A_leave then send to die
2 Q" m" h$ x- ~5 E5 X: }        else inc A_i by 1( |1 i# u+ k" x9 ?- I4 q7 r
    end
, b/ O$ q+ q( s% ?9 \9 Uend
- j4 I. e1 Y/ q* q" p) R: Z8 q8 f" T; [2 ]. V4 W* Q& g! b0 _& l
begin P_pick2 arriving# n2 n! ^- s0 K9 ~; ?5 @6 K
    set A_i to 11
# h2 P3 D. N3 H2 l8 k" T    move into Q_induct29 l- k' _# S+ r. R' j# c5 h
    move into pickaisle.induct2. d8 }+ \9 {' m" |+ p9 N
    while A_i<=30 do begin
0 y) ^, p. ~, P. Z        travel to pickaisle.con(A_i)
) `; H' }7 h+ k; G3 G* F, i8 d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- F4 C& x% Y: g8 f" y$ v) D9 X3 Q        else wait for 10 sec
, {4 B% f/ u3 y- T        if A_i=A_leave then send to die
/ |" @/ x1 m* @9 z1 T; [" }        else inc A_i by 1
; y6 h* Z( S7 i- o    end
: I, q- y4 d9 S5 ]end
7 [3 K( y; J' ~
9 u+ Y3 n  F  _begin P_pick3 arriving
# w2 N9 A2 I- Y2 d4 M- Q0 h' L4 R. @, K    set A_i to 21; \3 o5 ^$ e  ]( b' X) d
    move into Q_induct3) @6 x( \: c! V% @8 g% F+ _  M
    move into pickaisle.induct3
1 \6 E* g! L# m9 n% x$ ]. D    while A_i<=30 do begin
- K# i' ~2 d" Q! n( ^5 Z( M  U& P        travel to pickaisle.con(A_i), a. s% b$ J3 W) U; I1 q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' a$ m# W; D0 f0 T3 P6 q        else wait for 10 sec
) P* a( G# ?; ]2 {6 Y        if A_i=A_leave then send to die. X, d) C! n1 S. o
        else inc A_i by 1
0 C. G: L  g- W+ }    end7 U" h' T2 k' r  ]5 `
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是个什么东东?
0 f$ c6 h7 U0 f% I3 S  imove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
4 _/ ]1 o( a; N% y
! N/ r. w& C1 X3 a, ?, l" _% T3 Q5 cAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ O0 k1 q( T1 S0 X: e1 X9 p
0 N- t4 P0 v6 P7 D7 v% d8 p" ^另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  x! v' T1 z1 _9 ], z  |7 j1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;7 B- \5 ^6 l6 Q) m% D% o# I
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;1 \$ I1 t" i) [- B) t! L% C- d' R
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
3 k0 O, `: @  ubegin P_induction arriving9 d: p' r' B% M7 S9 m
    clone 1 load to P_pick(A_induct)5 F1 V! b  K, o( n
end最大的系
3 N9 _- I6 y" \7 @8 ^+ o, Q
- \8 t5 V& S& F: xbegin P_pick arriving
, i- \* G: c! q  N$ S7 n9 x    set A_i to procindex * 10 + 1% K. y4 C1 n7 q1 Q
    move into Q_induct(procindex)6 T. k4 c7 P: x+ ^
    move into pickaisle.induct(procindex)
- {" K( o$ _# A( c    /*check the type of pickaisle.induct(i), for your last problem.*/2 U/ {* ^; Q0 N7 n* d
( ?9 ]7 f9 X3 O
    while A_i<=30 do begin5 d4 t! l( k7 E- j/ u
        travel to pickaisle.con(A_i): N( q$ ?' a" J) D/ d7 ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! c5 |1 D% k2 S: w& Q
        else wait for 10 sec4 T, S% @+ A) f3 K: F
        if A_i=A_leave then send to die
5 [0 n% y5 P8 D7 E2 ~1 N' T6 i        else inc A_i by 1
4 y, i6 `6 a* w) x) }" G    end# d+ E1 i3 W5 O# g3 y4 c
end* F5 _9 u. y9 o2 l

) H  V' L4 I* v其中的procindex为整形,代表当前process的序号。. g, X2 ^4 z" e; J
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-8 13:49 , Processed in 0.014805 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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