设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12151|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ D2 A- X" W! f

# ?: u6 n/ Z% M0 Z* N3 E. ?( \我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 ~, b  _* {  ]1 H9 B2 t1 N4 s7 Y5 E, E
begin P_read arriving
* p3 m) V. [* h3 D! l0 l$ D3 O    while 1=1 do begin
( d% t: {  M. s# y! e. s, `' Y; W        read A_tote from "data.txt" with delimiter "\n"
7 x% k8 z) O1 _" J, F' E4 E        read A_time from "data.txt" with delimiter "\n"( |6 h, t! Y* l0 }
        read A_leave from "data.txt" with delimiter "\n"* [& X/ m# h) I: r& ~
        read A_picks from "data.txt" with delimiter "\n"
2 N  S* a" ^2 j" O% `1 `$ N        set load type to A_tote
2 t+ b' d2 M1 r6 ]/ ]        if A_tote="tote 1" then set A_induct to 1
# Q: t/ [0 B" @        else if A_tote="tote 2" then set A_induct to 2
! }& f/ R7 h: B. O            else set A_induct to 3   
% O" B2 g% a/ C3 U0 L% T! ?        set A_i to 0
% ]. M' P1 g1 S3 k% N# R        clone 1 load to P_induction
7 K* p! G; a1 F3 U1 _9 A7 x% A. I        wait for A_time sec! I' S" \" @  U4 l$ E
    end6 A) _+ I5 A! f& e6 X1 J
end" D; g( I8 F. b) F
+ t: @5 ?7 F  I* X' _# d
begin P_induction arriving
/ P* ]( P0 Z" T0 d, H" K    if A_induct=1 then clone 1 load to P_pick1  O( ]* Q0 E  U- h) I: |$ H8 O
    else if A_induct=2 then clone 1 load to P_pick21 d% E1 D; R- Z1 x2 q9 \; U
        else clone 1 load to P_pick3
4 A% z) B& W0 y% k6 v/ }: V( Fend
3 u. Z# r& G- B9 I; O4 H( A# h' T# K
begin P_pick1 arriving
9 W$ X! \9 q4 T. k# ?    set A_i to 15 R4 ]* O* Y+ V  j6 n% i% }
    move into Q_induct1
; H; V( T% X6 n  P% U( u- A5 ]3 @1 l    move into pickaisle.induct15 u. L5 @3 j+ B6 V- a' U. j
    while A_i<=30 do begin
- L, y0 B/ B$ X0 g" d" U3 t. N        travel to pickaisle.con(A_i)
: p/ Q0 w# ~1 n& T1 ^. J* f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( @  v, {: h4 M; a
        else wait for 10 sec) |6 f3 q! ]* ^! c% a% `, k1 O
        if A_i=A_leave then send to die( L$ H+ ]$ N( `( x/ i  y
        else inc A_i by 10 O  }" `2 O; [5 k7 ^% l6 _. [% U
    end- u, A4 Z9 {0 J! |+ T7 D# c& A
end+ Q, G4 J5 i$ k- i

4 c$ j1 _) s( v2 ]8 h& P; ~begin P_pick2 arriving
0 V& s( }  ^  n, C8 e    set A_i to 11
8 E1 O3 \3 c. {4 N1 ]1 ^    move into Q_induct28 R9 e/ M2 c# j3 ], `" P, h7 M
    move into pickaisle.induct2
$ ^( \. W0 V* l; |" x6 x    while A_i<=30 do begin
' X6 P: u( K1 K        travel to pickaisle.con(A_i)
! ~  e! R3 x) A- `- b; I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, P  k  n+ I8 {7 F. T; H        else wait for 10 sec
4 t8 t6 ~( C- a; Z9 X/ u) @        if A_i=A_leave then send to die
+ \# S  d3 [7 a9 \# I5 b        else inc A_i by 1
0 V$ F( O+ |- d5 v) I% D    end: {/ y% w. l/ Z
end% i/ s: R7 I4 A( A0 _( p1 g
- A  B$ q2 f' e( ?2 r' e/ [* i
begin P_pick3 arriving
3 @  t  I" R5 y: l1 q4 F* e" I    set A_i to 21
6 W; m- p1 Z5 f, K1 Q    move into Q_induct3
- q. ]3 c1 p  J5 `& }+ V8 p    move into pickaisle.induct3
4 n* k: ]) p) P- o! t    while A_i<=30 do begin! ~; e! n& w9 F" o+ z( }7 b* T
        travel to pickaisle.con(A_i)/ h- X  d& v, E+ w& |; M# r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! V; ?) n  s; r        else wait for 10 sec0 O9 f6 O9 n; O7 @
        if A_i=A_leave then send to die
+ g) ?" D+ _) {6 v3 S! h" k        else inc A_i by 1) n! a# K) C4 W0 B
    end0 v7 y) {4 B; t  p$ R1 j
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是个什么东东?
' v" W/ `. u! |3 a8 B. W9 x3 Zmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& \) e& ]; `' i* ~0 b9 e) N
, z/ h, J, F: P$ t6 R
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
4 }* F/ i% s. ?7 K, h2 H. w
( w% Q  O, Q/ Z5 M+ W另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:. C: e: q* s! W; x7 h6 P
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 d1 q9 b' H1 d( R2 H! i
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;0 l" _( C5 s3 J/ r8 z1 b0 h" w
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:: X1 R  b. j- j2 E3 v
begin P_induction arriving
# }2 }3 A- x# c5 o; x2 i; K2 y    clone 1 load to P_pick(A_induct): L8 a6 R+ B4 m% m
end最大的系
/ i( H' O: r9 [& g6 J+ z
6 P# U8 P% ?+ t! l  N) |begin P_pick arriving  x5 ?/ s8 C" n: ?" S; y/ N; _  b
    set A_i to procindex * 10 + 1
3 l' }4 W" w9 s; g9 z  t0 l    move into Q_induct(procindex)0 q2 `; y: M  ]  J" s& `
    move into pickaisle.induct(procindex)
4 p7 u8 I  Y4 b2 _/ h" D    /*check the type of pickaisle.induct(i), for your last problem.*/9 _; i6 O! V4 \0 }! d6 z
; P' m7 i9 G' ^+ x
    while A_i<=30 do begin
  G# a" |+ j$ U: I% e' r9 s: {        travel to pickaisle.con(A_i)2 P; [1 _! x( @4 I/ T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' A9 e+ S/ t# [5 t        else wait for 10 sec
" ?2 a) @% q6 J        if A_i=A_leave then send to die
0 J' n4 L6 ^2 q' T        else inc A_i by 11 X/ h- i, v$ J* d( }3 {/ t5 \
    end' p+ x: ~1 o/ o9 w! V. S) g
end
# L$ Z, k: I, f" j# K8 M8 `' e: j, r+ g9 |
其中的procindex为整形,代表当前process的序号。
* u" |2 ^; u+ |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, 2025-12-31 16:37 , Processed in 0.014030 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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