设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13897|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 v5 `: u/ r) |6 l, F, T# g
, L, G, G0 F6 L- N) F- K
我的问题是,在每个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 u8 H5 f& ?5 N4 i

4 T; j3 ^; ^! S6 e$ ~' f9 Gbegin P_read arriving
, f( b" j$ D# b5 D" ?    while 1=1 do begin
' ]+ m5 s) h3 Y6 F7 t        read A_tote from "data.txt" with delimiter "\n"
: S" t7 M1 ]: r3 H$ ~1 j        read A_time from "data.txt" with delimiter "\n"
4 V3 ?, e0 X9 M+ T9 {2 ?4 f) m; F        read A_leave from "data.txt" with delimiter "\n"
. K0 Y9 q4 E: z9 e- J- E1 V        read A_picks from "data.txt" with delimiter "\n"
/ O0 n9 e. u, _( V, b        set load type to A_tote9 w; F4 A* B4 O6 q: r% J
        if A_tote="tote 1" then set A_induct to 1  _% M" F1 a" i4 S1 ]
        else if A_tote="tote 2" then set A_induct to 2) x: y& D, o; Z. N( o; A$ K
            else set A_induct to 3    8 T& I& g0 W9 N- e7 q$ D" o
        set A_i to 0
( X3 Q1 l- i! R        clone 1 load to P_induction- E+ y0 I1 J3 @2 V6 D3 ?
        wait for A_time sec
' q/ E) e. H3 E9 ?. U: m    end
: d$ v) {* \( z4 K: yend, G. {1 w' [5 h$ m" n" H; W

& H2 S* f5 K+ \0 X: M" d0 Ibegin P_induction arriving
6 f. V, G2 W. @# H' Q    if A_induct=1 then clone 1 load to P_pick1
; U  U9 j. S0 N5 R  g    else if A_induct=2 then clone 1 load to P_pick2. w7 B' c( ~6 h& v
        else clone 1 load to P_pick3) i! }. i& {& C; z4 c* _, Y
end9 p$ N% [" g4 I; f% u' h# k
" |6 ~. G$ X6 w2 \$ `; I/ m9 [
begin P_pick1 arriving
3 x; y, G' q) C/ U4 |    set A_i to 14 o1 ~- J, f2 y4 D, v
    move into Q_induct1
  K7 u1 a9 M( C; ~    move into pickaisle.induct1# g1 Y  Y) I$ V. z; x2 ~0 L) I9 M, }
    while A_i<=30 do begin6 ^( d1 [; ]2 ~8 [4 }
        travel to pickaisle.con(A_i)$ |- l+ y/ P) @+ a' c/ ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# e* P: C9 S  ?4 L5 R
        else wait for 10 sec* H8 X' A- a4 A9 o7 x+ ^
        if A_i=A_leave then send to die
# X. D$ G, c* G; n8 @3 y        else inc A_i by 1
& e6 V. u& p' s$ i8 |6 w    end" U3 M) _0 I+ s% Z& K) Q/ W
end
! _; ~: H6 p+ l- I6 t9 U  G5 {  a
begin P_pick2 arriving
( h' U% \" I: V7 x    set A_i to 111 s& Y% u+ ^0 [) q8 }  U
    move into Q_induct2
/ O& x; [, j; u+ z  q7 b2 `  j: M    move into pickaisle.induct2) R* F: W) ?" @* `1 A3 ~- J
    while A_i<=30 do begin2 f$ P# z" n1 R$ |$ K/ I
        travel to pickaisle.con(A_i)
" |$ n& U1 m: r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 p' F. A4 U1 q2 h8 V( a
        else wait for 10 sec
; g/ c0 J1 D  c        if A_i=A_leave then send to die2 r$ c1 G; M) n7 r, B
        else inc A_i by 19 A4 A, m7 `. C& w
    end
/ F2 z" X+ L3 fend& g5 J  @) J! X/ p3 n9 }
8 [& H- q4 h2 }7 E
begin P_pick3 arriving/ n, S* K) F+ L" ^# G! v
    set A_i to 217 t4 X1 @4 o  S& O7 _! `
    move into Q_induct37 s9 h$ E4 K3 z$ Q0 y7 b
    move into pickaisle.induct35 ?8 v4 `4 \% }9 v2 ]
    while A_i<=30 do begin6 Q% I, w& |+ R9 `% _  L
        travel to pickaisle.con(A_i)
: D5 ^5 e7 h8 W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' y; O- Y* _1 V. C: Q3 p" f, J$ e
        else wait for 10 sec
, v: _* q! T1 _. Y# o6 U* I* X        if A_i=A_leave then send to die
/ P: `; |( I5 k/ j        else inc A_i by 1
7 I& Q; P  s) q( P9 h4 T7 j    end
+ j+ G! {" |; l) V( qend

最佳答案

查看完整内容

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是个什么东东?: B' m2 a3 H: L: }9 p
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?7 o! g* @! d' ^8 x" u" h5 _

, Z/ }3 x! }- V  GAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 |$ j1 W" L1 R7 [6 c" u& B( L

2 K9 G  [% b) C另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:1 e- {$ U+ V; c" o0 D) }+ e
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# g, @5 Z% s2 V7 d. x, f( S, {2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;/ S8 F/ Z, ~4 {# ~- t" W/ `+ _  N
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:! z: @; O7 z5 T1 j7 d; T/ K
begin P_induction arriving$ @3 c! p9 c; U+ v
    clone 1 load to P_pick(A_induct)& D6 V( w& d8 K$ d
end最大的系+ B: F( p  y% }9 w! t2 }% y3 U

: s5 }8 k! @- n) ~3 y# k- f2 vbegin P_pick arriving
' K$ l- T% {- o5 S0 S: u1 a( A* g    set A_i to procindex * 10 + 11 i! B: F8 e3 B2 F( ]/ B! I' D
    move into Q_induct(procindex)
  P6 h& U" w4 }/ v' u5 Q; V    move into pickaisle.induct(procindex)
$ f+ n' J8 g; G$ R2 X6 s    /*check the type of pickaisle.induct(i), for your last problem.*/, t4 ^1 |+ k* r" {
1 k9 O* B9 [" Y  c2 s: n- Q
    while A_i<=30 do begin$ Y4 z3 |( |, _1 [
        travel to pickaisle.con(A_i)
& ?4 s- M4 r" N6 h' s8 S5 `0 P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# e0 M3 q- s6 |' H. B
        else wait for 10 sec& \/ k3 r; g4 m% f$ c
        if A_i=A_leave then send to die
9 ]$ L7 V8 a/ n5 a        else inc A_i by 1) R1 H1 u' P6 V
    end
: i2 g. ?- B- ^6 z+ ]$ n* y  Lend
5 a5 r7 Y* c/ {6 w& W( E/ p
* X, K4 I( y0 d3 b2 g  C6 `其中的procindex为整形,代表当前process的序号。0 v" i( u9 k/ t& F* [7 [
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-5-16 09:17 , Processed in 0.027736 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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