设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12647|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ ?* }1 X' h* J- l% }2 W- b
  i) j- J4 ]$ K" d我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, S$ T9 O4 ?% \+ G+ [) Y9 k% f
begin P_read arriving
# G2 p% |) O0 ~' |7 E- q1 W" V    while 1=1 do begin
/ i7 Y  N; I" i. Y. A4 m1 Z) W        read A_tote from "data.txt" with delimiter "\n"
: t$ D4 W/ r" e9 f! W; V+ j        read A_time from "data.txt" with delimiter "\n"
. J4 ?8 u0 W9 ~; B' x        read A_leave from "data.txt" with delimiter "\n"
$ j' S4 _: P" O2 Z+ d) B! X        read A_picks from "data.txt" with delimiter "\n"  Q# m" n3 d# Z# V3 Q2 d
        set load type to A_tote
2 C# f$ ]- d3 u8 |        if A_tote="tote 1" then set A_induct to 1
- t8 f! v8 t! U) r6 b+ f# G& u        else if A_tote="tote 2" then set A_induct to 2
: O% l) C8 F1 _' y            else set A_induct to 3   
5 ~+ d- l3 M4 J8 {+ q6 R7 c        set A_i to 0
& v' H; E: i; x) ]7 l& \: p$ c        clone 1 load to P_induction
& R# R0 j, f! ]. f- r) M        wait for A_time sec8 S. d- l% \& J
    end" O3 f, C" t- v* R0 D+ A
end- O# \6 A8 n1 Z6 z5 i* A

9 z. |& X# q4 q5 \8 z  ]# U7 m; ?begin P_induction arriving9 {" |' @/ n; |! w; r9 e' T
    if A_induct=1 then clone 1 load to P_pick1. `( r& B' [! y' n, D
    else if A_induct=2 then clone 1 load to P_pick2
! p8 Z# L1 N8 ^, t, m. h8 y        else clone 1 load to P_pick3
: y/ Q' [7 u7 E0 K/ @, o' }5 bend
- }  I& i) M4 ~1 n; M+ u' o
- P- i# T" s3 f0 A2 ?5 i- @begin P_pick1 arriving
, s5 h! L$ E0 d& r8 ~$ M7 U  Z    set A_i to 1
5 W1 m2 r( G( f    move into Q_induct1% B# x$ {8 Y  Y" w9 G2 H/ c5 D$ C
    move into pickaisle.induct1( T# K/ A+ g' s& D, K  Z
    while A_i<=30 do begin
! C0 F/ s2 [1 i* q& m6 p) Z        travel to pickaisle.con(A_i)5 d" b7 R. W  Q' K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) U4 h. p1 b  r/ B' s8 t
        else wait for 10 sec# U; n( _! N7 u" Z2 L) e
        if A_i=A_leave then send to die  i* R9 u- \% U+ J
        else inc A_i by 1
1 d2 A5 t! L5 Q: `( T' ~+ X; G1 v    end
' E$ V8 L3 y# j1 u* U  V/ _( Oend
5 H/ R: C* z5 J: e3 z3 }
4 y! ^9 E; c: T9 Hbegin P_pick2 arriving
/ `0 S& F/ e3 X+ z$ @    set A_i to 11
' ]5 j7 d; o" {    move into Q_induct2
/ j( k6 ]* e5 k    move into pickaisle.induct2" s! U2 r9 {3 e' d% ]& [
    while A_i<=30 do begin3 k- Q  q. P2 }8 |5 A
        travel to pickaisle.con(A_i)
8 s2 U$ A5 T! j  b1 @4 L  O: U8 q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 w5 m- m( k$ M$ L8 J8 w
        else wait for 10 sec
6 ?# T4 D9 }' c4 ^        if A_i=A_leave then send to die
2 R$ J7 ]* K4 \$ L. `        else inc A_i by 1
  K) }2 M) \: ?2 _& K  _" }% t    end3 G5 A0 w  ~' G
end
0 d# Z3 ~+ r2 V. t  p: T& C' [$ T
begin P_pick3 arriving
5 @$ F+ u+ l6 X. ~( P# e' O    set A_i to 21
6 k& E* Y# f5 ?0 B" |/ G8 C! V+ j    move into Q_induct3
  X+ ^) N- L& d2 r& c    move into pickaisle.induct3
% j" b# h2 n$ ~' V9 g% R    while A_i<=30 do begin5 U8 _7 W- ]/ v8 D5 |
        travel to pickaisle.con(A_i)
1 F) j3 Z. `9 e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 G7 c! ]" V( B" R4 s- s        else wait for 10 sec# Y! f7 X2 r5 @; [. `# _4 n
        if A_i=A_leave then send to die. u/ i9 e+ N' d& c: [3 h6 {4 P& W( [
        else inc A_i by 1
! v' N+ q! ]1 a' [( k9 s# S- m/ B9 y    end
/ V; H: P/ {, s, P' n' }# e; Mend

最佳答案

查看完整内容

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是个什么东东?! ]: R6 p7 L/ F0 J" R6 x& h( r
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- P2 h4 [) [9 ?. A1 J

  X1 y5 R6 m& a/ V! B& T" jAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
  r; j. M7 G; Z3 L6 N# V
; ~8 U: u" z+ |! O5 G, z另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:9 q3 |6 B2 t9 y. Y+ v% b
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' j6 Q- E; S. w
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! M, j7 o( m% ?4 K" X9 H# e% c
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:$ G9 [  [9 K: J" y* t0 H
begin P_induction arriving
1 T1 X1 z7 k  y, u( [( {$ u    clone 1 load to P_pick(A_induct)
3 `" \* u$ r/ g# ]end最大的系
& k# ^+ I3 d- I$ W" E, y/ j! v9 J6 a* M: z
begin P_pick arriving5 J' T" E7 h" ~. U. R  D. \. a
    set A_i to procindex * 10 + 10 J( \4 ~2 C, ?9 k. e
    move into Q_induct(procindex)7 {% G% s; e) x6 U7 M
    move into pickaisle.induct(procindex)
8 ]1 a: [& M4 q    /*check the type of pickaisle.induct(i), for your last problem.*/% Z5 M# a4 s; s2 C$ `& N! P
/ s8 l" q" L# ~8 F$ W' }4 I$ e6 M
    while A_i<=30 do begin
3 {& h  b: D  {( ]8 _* C' x        travel to pickaisle.con(A_i)8 C7 i; ?# H1 a: E% Z  }) |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 P* C, R6 c% F- u        else wait for 10 sec
: O2 M( ]8 g9 Z6 d8 X8 j        if A_i=A_leave then send to die
/ Y, g( l' N5 i3 W8 K        else inc A_i by 1$ Z: m8 Q# a% F2 X" Q& r# t
    end) s" A; L9 M/ T; O9 @. v3 T6 }
end
# ?$ r& ^' [/ B2 C. Q$ Y: p0 s
8 v% l$ x2 S2 ]* e其中的procindex为整形,代表当前process的序号。: I" ]; {4 x( W: Z
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-2-7 20:31 , Processed in 0.015710 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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