设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15610|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) I9 `0 u# ]. V4 g
; z  {6 S& p" q2 |! Q! u8 D; L6 R
我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 B5 G6 p% Y1 Y. K' [3 L
' @5 `8 J( |5 R7 j
begin P_read arriving! b* T3 k- x5 r: z3 ~+ U
    while 1=1 do begin3 {6 {/ k# a, u! z4 U. Y/ A+ k
        read A_tote from "data.txt" with delimiter "\n"% ]; J6 \. v; R9 ]  W
        read A_time from "data.txt" with delimiter "\n"4 d5 ?# X. u6 j% Y5 n
        read A_leave from "data.txt" with delimiter "\n"5 ]3 B1 ?" |( c4 E/ @: C% d3 |& F/ {
        read A_picks from "data.txt" with delimiter "\n"
' v! D: P* k9 D0 u        set load type to A_tote
* n2 x8 ~. `  ^# k        if A_tote="tote 1" then set A_induct to 1
& l, z* k( U$ {  o$ T: ?8 |        else if A_tote="tote 2" then set A_induct to 2& f' J& E3 Q  j
            else set A_induct to 3   
1 I" K7 K  t( S7 V$ g7 `        set A_i to 0
) f& D0 e8 U  A! F+ |) k        clone 1 load to P_induction
+ Z% G3 R' K& z. V8 P3 B! O$ j        wait for A_time sec
- h7 y$ n- |9 R4 Q/ b+ \) h$ C    end( H5 A% ~+ ]5 F: C, ?+ p
end
$ ]  V& r4 e& Y1 y1 {, b% ]" @- X0 ^$ D
begin P_induction arriving0 [* v0 z# x0 b  V0 E
    if A_induct=1 then clone 1 load to P_pick1$ ?1 b' C' A5 C) ?+ J/ T
    else if A_induct=2 then clone 1 load to P_pick22 o8 x8 W) F! q- e# Y( m
        else clone 1 load to P_pick3. @' f. t2 q& O( }5 Z5 O2 V) z
end
5 y  {2 }& V- b) H1 b+ k- q
# n* Y- u! E* R; |* n0 j$ kbegin P_pick1 arriving7 M1 Y( ~# ^$ U  B
    set A_i to 1
9 {* j% n4 N) [& d  N3 r    move into Q_induct1* S8 o& U& L% l9 N: c
    move into pickaisle.induct1. N8 \9 e- i6 E% ]8 \7 w
    while A_i<=30 do begin
  ^7 j1 C0 A5 g; _) V/ x1 `' |$ H2 N7 ~        travel to pickaisle.con(A_i)0 o  s! c& @: L! i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& V! l3 `+ t2 M/ q8 @
        else wait for 10 sec/ B9 Z8 S! V* C- W7 e
        if A_i=A_leave then send to die
, q( i; c! V. p4 j. q% c" ^        else inc A_i by 1/ i  Z% [& p) o1 ]0 {+ A" W. o
    end2 h+ \, D8 _5 h# r
end
9 _. E& g0 F5 ]: E4 G3 c7 o: W8 X! L% W! J7 z  J4 n; B
begin P_pick2 arriving2 x% X' b6 _- I' X2 l/ o
    set A_i to 11: d( w6 @' e: N5 C" v! `
    move into Q_induct2
1 J9 V5 s, Q2 F1 |. K; }& F    move into pickaisle.induct2
/ F9 ?0 p. q+ J/ n- _5 m+ B5 F    while A_i<=30 do begin3 j" l- m  y) n* F; b9 ^
        travel to pickaisle.con(A_i)
3 W* u% S  x6 H! K  D: n( S7 B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 ^5 {1 H# N1 ]: R% l5 m* w$ u
        else wait for 10 sec
8 H& x% v3 {2 g        if A_i=A_leave then send to die
8 X; D, U, @; `, y. T3 `        else inc A_i by 1
" y5 H* [( o' i! V    end6 U  J4 X/ r% k: W1 J# ~
end
$ @1 \/ Q/ c# ~8 _' T, X! X) s
+ S0 ?8 I0 h* V6 h( ~! Rbegin P_pick3 arriving( Q! J5 _9 s8 [, f* l3 p& I
    set A_i to 21
2 I  ]# Q! B8 A: z    move into Q_induct3! W: h0 L& E. M3 Q$ u
    move into pickaisle.induct39 p% P# Y5 r# H9 b% P; N
    while A_i<=30 do begin, I+ @# h4 P+ U; E9 n7 S# X
        travel to pickaisle.con(A_i)2 k) Q3 t) k/ b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 H; q" C7 h; G* `: s* j$ Q        else wait for 10 sec
3 i; q. R, A0 A' g8 T        if A_i=A_leave then send to die9 J+ f5 B2 a* }: n- O/ M$ u
        else inc A_i by 1
9 C# |# {( o% I4 {8 @    end
- v$ ], O9 z" ?7 I$ Oend

最佳答案

查看完整内容

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是个什么东东?
, |/ W; w5 v2 n. ymove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?2 K/ d+ Z+ Q  Y) l% q/ _* S; e: H
( Q. Y& A$ L" K& U5 G  v
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! l( C: W( N! c) p6 _/ u; h; S' r# R% n3 `4 E
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; k, z% N4 M; Z/ D; u1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% ?8 k5 J4 t% S% m
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;1 P6 M: E7 ~  Y2 d! z
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
5 j, j& M; @9 u( |begin P_induction arriving( e4 }3 O7 u# h- e
    clone 1 load to P_pick(A_induct)
# z+ o, U7 i& K2 L$ W! Send最大的系0 {% w: X5 J( ?$ u
% H/ `; o" [, u' p2 z" S- X
begin P_pick arriving
" t" O; h4 J1 v2 j2 }* v2 G    set A_i to procindex * 10 + 1+ h$ s; K; |7 B. P' E& X2 ?. m2 m
    move into Q_induct(procindex)
  y6 t+ O1 a! O( e6 X    move into pickaisle.induct(procindex)
4 ?3 u5 t8 ?8 y1 ]" E$ J    /*check the type of pickaisle.induct(i), for your last problem.*/
" y2 \1 Z2 L. J  y7 [' Q- k9 T- U/ `4 c; D) a* S8 `( n
    while A_i<=30 do begin8 s$ _3 j# s4 t8 U2 U6 a
        travel to pickaisle.con(A_i)
5 O1 I% x+ W! r. E% R  h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 P( A- d" c" |* |) E$ V        else wait for 10 sec
6 V# q/ H) y! Y5 G/ }        if A_i=A_leave then send to die9 ~* \& n9 L) Z! t' x
        else inc A_i by 12 u" l3 x* j! q! J9 V
    end% f' c9 |* F; e
end
: \, w# l. i' G$ Y% j& T. z- O* G4 J
' Z1 u9 J/ E6 B4 n, j, n  n# i其中的procindex为整形,代表当前process的序号。
: f9 j+ R1 C/ E+ @4 J2 Z1 G; }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-9-22 14:37 , Processed in 0.017987 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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