设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14370|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 g) D$ O' O& D2 S! O
1 q7 z) {7 H, j: W
我的问题是,在每个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中的数值,不知道会不会有什么不妥。- B" _/ S5 V0 L
0 z3 {2 S# q" v5 V' ^
begin P_read arriving
$ G. s7 C5 g, ?. G+ G* W    while 1=1 do begin7 h1 c4 v1 @% M3 U+ y: c' z
        read A_tote from "data.txt" with delimiter "\n", V6 ]& \) x2 l$ [) n# R$ Q- w
        read A_time from "data.txt" with delimiter "\n"/ F7 R5 y. l) c2 q* E! n) W  E# {
        read A_leave from "data.txt" with delimiter "\n"
0 i2 ]8 N3 {% ^) H- W* `( i        read A_picks from "data.txt" with delimiter "\n"/ u9 v' \+ P5 L3 B* n4 F
        set load type to A_tote
  r7 _2 E! j9 j' O        if A_tote="tote 1" then set A_induct to 15 m9 V( Z5 I, u7 C/ a
        else if A_tote="tote 2" then set A_induct to 2) o+ Y- t7 H# ?. M
            else set A_induct to 3   
( }4 Q) @6 V- @& {( q, B        set A_i to 0
; W* x; z+ P( [        clone 1 load to P_induction
# G; f7 e( E6 }5 h        wait for A_time sec
& Z7 [% x$ Z, G8 ?' ~: D    end
' ?% y* h  B' m7 H- h% y  rend
( N0 S+ A" X" O6 F, k
% X) @% n9 O, h/ \! G& f. S* M* Ibegin P_induction arriving, K- s6 N# @  x* b: g* u
    if A_induct=1 then clone 1 load to P_pick1
: N4 u, W. `  `- b- x0 A    else if A_induct=2 then clone 1 load to P_pick2
7 B1 B# m2 h! l/ ?. s; {        else clone 1 load to P_pick3* N* N- V) O0 d! e
end3 S( p6 I" n, B: n+ N

6 l+ K7 x) ~$ i1 ~begin P_pick1 arriving
" ~: H, M5 Y+ ^    set A_i to 1
5 q  s6 p$ b' }  C- y    move into Q_induct1
) o# O- m* ^. Y& w+ ^; ~, m    move into pickaisle.induct10 r. R. V5 Q6 f6 D
    while A_i<=30 do begin
- n) T0 i7 P( `  }        travel to pickaisle.con(A_i)% o) x. Y4 a2 Y5 \6 v  K' v% b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ s* D. ]+ a1 w; A  B
        else wait for 10 sec
, r. r$ Z$ H6 V        if A_i=A_leave then send to die
3 `. F8 z: o3 s' Y        else inc A_i by 1/ q' l3 P( E" t. J  I  {
    end
2 N  a- A) m8 X; k/ o; ], o+ Dend0 p, \  A  q1 m
& D& t; C  x$ p: ?; d2 x
begin P_pick2 arriving
$ ~; |" i6 r5 [% W" U# m* [    set A_i to 11
- Y( ~/ q5 G6 ]# W7 ~$ a    move into Q_induct2
9 ~% n& y$ O6 v0 b; W4 A    move into pickaisle.induct2
; o  w5 q- E8 K# w4 X6 N; O    while A_i<=30 do begin- ^% v4 V5 Q0 W+ o2 m% N% M
        travel to pickaisle.con(A_i)
0 K. z, H; p# r/ u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 P. e! B) o( f+ X5 y        else wait for 10 sec
2 z: j* F  N; z: I        if A_i=A_leave then send to die
4 _% c; N1 s' F  Q        else inc A_i by 1' N% n( j) v) A8 Z/ L2 m$ [
    end1 K$ R: f7 J5 @9 Q* i
end; B2 V9 f2 N0 O

, c1 G* N- f: q6 _: k  j; Jbegin P_pick3 arriving: \, i& r3 a, C, k7 s
    set A_i to 21
3 f" J  O+ Y" a2 e) D    move into Q_induct3
. \+ z. ]. y' y+ d. S' a, c) w    move into pickaisle.induct3
$ |! w1 S8 g2 x" T( T2 x    while A_i<=30 do begin5 \3 }/ _" f7 d% P7 N) }" L
        travel to pickaisle.con(A_i)
3 w8 r" h. y( ^; T$ C, k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. ~4 a( @3 _( Z& n3 H- Q4 F$ }" c        else wait for 10 sec
0 S$ _, c- T  J6 |1 s. n+ |        if A_i=A_leave then send to die
  j$ f( d2 ~# ^        else inc A_i by 10 ?# |  n( _- s+ P0 n3 Y) @% c
    end) e) ]. R# D  C8 u* f8 W
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是个什么东东?
) ^9 f0 J1 N0 [; s2 Z4 gmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
2 R" v4 y2 w; \
, X) C& I* q' ?* XAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
, i5 n9 b; @! K$ R( e5 w4 }
5 ^/ o" I& P8 |4 P5 @% S: N0 h9 x另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:* y. R: X  S1 N1 Q3 r- @/ h
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;4 N3 l8 e# D  C5 j
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
* T; e% D2 W, i( l2 @3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
- H9 w) Z$ R$ q3 H0 e( Vbegin P_induction arriving4 S+ h5 Z* N1 t  z+ t/ L
    clone 1 load to P_pick(A_induct)
6 E2 ^' A# ?/ n1 X' Xend最大的系
( |9 W& Q' c/ i  a, v- b5 Z+ i: z* h, F+ l
begin P_pick arriving+ ^' `  m5 D# B, c. l0 P
    set A_i to procindex * 10 + 1
" I8 Z+ O: {% A. j' J; k+ R    move into Q_induct(procindex)
+ k% O+ X/ d2 J; J1 U1 B" u    move into pickaisle.induct(procindex)
" r5 r$ C2 d+ C6 H/ s    /*check the type of pickaisle.induct(i), for your last problem.*/
, A7 o( V$ n) ?! ]. ^3 l; S7 K* p( u0 g5 y8 w1 u
    while A_i<=30 do begin% g7 y- V6 N. C5 l' M# J: ~" s
        travel to pickaisle.con(A_i), S% Y; ~) c* m% s1 l3 {* B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* G$ T) P; W. k2 s4 [* L, k1 u
        else wait for 10 sec
. T! r7 I* s! p' V0 }9 o1 R5 V+ h        if A_i=A_leave then send to die
/ u, I5 V7 |+ j' Q        else inc A_i by 1+ t; D$ k5 F. T  l1 q
    end3 E" T6 ?. x  S( u
end, W" Z0 ^% [2 e" U& Z+ M

6 X5 Y6 L" D% x, v其中的procindex为整形,代表当前process的序号。( C, p6 v- D% `, D; X2 F9 P
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-7-7 13:40 , Processed in 0.014584 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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