设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10581|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 J7 o3 H% c1 d3 a2 a4 t8 N  Z& s: o+ G1 J9 Z& Z; ~6 B' 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中的数值,不知道会不会有什么不妥。
7 X- j' Q" g5 N* v7 U. ~7 A& g) n& y
begin P_read arriving. U$ c3 b: T8 b  r$ f
    while 1=1 do begin+ E6 j1 ?) o6 S4 S1 ]& c7 N7 f2 K( l
        read A_tote from "data.txt" with delimiter "\n"7 L3 \; j* s- M8 ~# @
        read A_time from "data.txt" with delimiter "\n"
( d1 Q- d2 Y+ x: }        read A_leave from "data.txt" with delimiter "\n"; R+ {' \- I8 }
        read A_picks from "data.txt" with delimiter "\n"
* p' A/ o: N2 B& }" r        set load type to A_tote
& a4 n  e2 n4 D3 a        if A_tote="tote 1" then set A_induct to 11 j3 b" W% ?, L" {; v
        else if A_tote="tote 2" then set A_induct to 2
6 [+ c9 k+ U7 V4 f; l/ l            else set A_induct to 3   
; v3 D" ^5 D. e. H. O# w' [9 {; I        set A_i to 0; ]5 `2 i  h8 G
        clone 1 load to P_induction
4 F% j3 R, W1 H: C9 ]        wait for A_time sec  Z7 t4 q9 z4 Z# Y# ~' ~
    end! L0 ?5 z+ e8 ~9 e2 A6 K' ~" E$ y6 l
end
3 s+ N3 J! L' x4 i  h+ |0 I) d) [6 }+ t9 B
begin P_induction arriving
9 a9 S/ b4 q% E; h, X    if A_induct=1 then clone 1 load to P_pick1
7 x: q( w5 `3 h: M- [8 X) C    else if A_induct=2 then clone 1 load to P_pick26 e% T1 }, x7 x1 u
        else clone 1 load to P_pick3( R8 l5 n& ]+ x; f* {7 ]& f
end/ G8 r" Q2 d8 N( e$ m3 B

4 d: C& X0 j' {! a9 \begin P_pick1 arriving) M+ a9 A7 x, Q# |4 j/ t
    set A_i to 13 q! @5 P0 b) q7 Y
    move into Q_induct18 V3 U. I) M% \! j+ U7 }5 b
    move into pickaisle.induct1
% d; v# [3 K. B& d  k" k" |9 ]* V    while A_i<=30 do begin" w$ u1 c- W) w* Z$ Q5 C, V) `# q
        travel to pickaisle.con(A_i). {; t0 z; Y* f' [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ \3 B& Q& q  r  Y* x' H- e
        else wait for 10 sec
! R! C. |8 j& u( Z4 A, m( V        if A_i=A_leave then send to die
- u' F" F( `# l: r( J        else inc A_i by 1
. C& l  j' c4 _$ ~3 ?! Y    end' F. v- }5 k9 w6 A. r9 B9 `
end3 b$ t- q" t  B5 ~* m9 i
( M1 o5 L; ]& C) o4 N/ }& ?! V! y
begin P_pick2 arriving
: S, H$ j# l: @( f: ~& A    set A_i to 11
9 m6 w+ Z3 S1 Z+ M8 B    move into Q_induct2
0 J: b9 S, l& L) `- y( b4 Z    move into pickaisle.induct2
  {; l* a. w1 `7 J/ V    while A_i<=30 do begin# i* W& i: i* l% ]8 a1 k; {
        travel to pickaisle.con(A_i)  u: b, e# c6 [8 j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 O, ^3 c" ]+ h" C8 y        else wait for 10 sec% f! M% b) S5 w: m& R) Z
        if A_i=A_leave then send to die
# O8 P9 A: \7 c- I& b0 u* y        else inc A_i by 1
' G( u: o9 t# X1 u6 s) H: q3 _    end: n+ n' y* l! X7 R
end
' i& l. m1 ^: s- `7 _5 U8 E" k) s1 q; b3 F: P9 e
begin P_pick3 arriving; L5 e7 {& `; u+ E4 V2 l
    set A_i to 21
8 t( V, ~& h2 p    move into Q_induct3' t  }) ^0 c% F3 n  ?4 h
    move into pickaisle.induct3
; Y, u: M" b1 }    while A_i<=30 do begin9 L4 t' p, H; s* O5 r+ b
        travel to pickaisle.con(A_i)/ |& Z7 r7 V5 i2 d3 L. o% t" v% e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: s- ^1 h+ `4 i9 k" c- R. u3 L
        else wait for 10 sec
+ @* `8 }% i1 M2 l5 |; y  P! l- W        if A_i=A_leave then send to die
$ J. U* a5 `2 Q& Y# I  I* d, @        else inc A_i by 1
* B& G1 q8 o! Y  q8 ]8 z- O    end' ~- \- p& D  X8 V+ _* N, u( b
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 i0 O6 m! S: ^+ C9 m" f1 Y
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
) [# [& t" x) @. _
' t. Q2 v- M, r8 R- DAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。8 U& W2 ]* w/ a, G9 {$ q
% E/ K' j% j7 Y* T# R
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ d2 o, O+ P; y+ G* \9 c0 H) }1 I3 v: r
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;. T9 M, Y! B# L3 D
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
. H* }- P% e! i/ w' l3 C/ ^3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:! m$ r! L& J6 b% F+ [
begin P_induction arriving5 {& j" j' u; H1 f8 F# o
    clone 1 load to P_pick(A_induct)
3 C" o# `/ J3 R9 K) m$ T1 q/ jend最大的系
6 e  J6 d4 r# g  L( |0 k4 _5 d0 S# G: `  R& u# j+ ^5 V
begin P_pick arriving5 _( Q# N$ m% g* n, e* l
    set A_i to procindex * 10 + 1
6 y3 J6 [8 R0 a% r    move into Q_induct(procindex)
( O/ B. {+ U/ z$ p! E  d. y    move into pickaisle.induct(procindex)
4 g* A( W, K2 k/ R8 Z3 t    /*check the type of pickaisle.induct(i), for your last problem.*/
3 a8 g% ~# x; A4 s
* A' _* l' F6 E, Q    while A_i<=30 do begin1 Y5 B  ]) V: I% B. p/ a+ U
        travel to pickaisle.con(A_i)
0 b8 E3 h0 |5 p' Q3 W0 f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 [: D$ k- }3 C% U
        else wait for 10 sec: ?) V7 H' l+ E" V4 B: T# Z7 g
        if A_i=A_leave then send to die
+ `. }5 x/ s3 n( l        else inc A_i by 1% p- p; r1 r: H4 T3 ~' l& q) }% F
    end5 o' H$ `7 p  X) g- r/ Q$ A/ J
end
7 |$ E1 n' E$ w+ X" a9 p" [' v7 d: q  i* t7 @) d! N( ]
其中的procindex为整形,代表当前process的序号。
* i" D, E. u# F7 }! Jstation和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-9-14 04:17 , Processed in 0.014056 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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