设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11544|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( F7 G# ^3 l  Z5 b5 p7 \8 J
3 y/ [- {5 e* X0 Z& c; k+ R5 n( y我的问题是,在每个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+ @: _; k/ V

' R( j0 @$ [0 G9 ~  Qbegin P_read arriving: Q3 I* W- s; J; t! s8 D" q
    while 1=1 do begin, d( Q3 j" p# t2 r' K# ^. J" w
        read A_tote from "data.txt" with delimiter "\n"- I0 N6 F3 h0 x, A' v
        read A_time from "data.txt" with delimiter "\n"
# D" X4 `! e# D. O; K; o0 {. g- T        read A_leave from "data.txt" with delimiter "\n"2 G" M) O& |) ^4 k- ^4 g
        read A_picks from "data.txt" with delimiter "\n"
! r5 r8 ~" ^8 V- w: F( O        set load type to A_tote
5 @- J! ~. p& A; j1 R+ \1 W2 u8 P6 Z        if A_tote="tote 1" then set A_induct to 1
6 u4 F5 l! F) T. y        else if A_tote="tote 2" then set A_induct to 2
3 [1 L8 @* Y! S* z            else set A_induct to 3    2 X4 A" R1 i  L
        set A_i to 0
; l6 m8 `: c9 N" I+ n        clone 1 load to P_induction7 r% ^: Y* |- K
        wait for A_time sec
6 O* c5 V7 z. c- {    end
" U' Z- S: d9 ^, N  G, Iend
0 H4 }6 `' j3 Y- _/ x* ^; N' K" v& L3 }
begin P_induction arriving
3 ~8 y6 ~$ p1 p, p    if A_induct=1 then clone 1 load to P_pick1
) B& b& L. _  |7 u: s( w    else if A_induct=2 then clone 1 load to P_pick2
  [6 r' N4 J7 l+ n        else clone 1 load to P_pick3
2 U) i, p! t  C  Cend8 n5 z1 `3 E  J1 ]1 X* V: g5 \

4 D% J  W# Y+ Kbegin P_pick1 arriving/ A2 c7 J3 k/ z8 a& X" ~- B2 g- S: |+ {9 x
    set A_i to 1" K' J2 x. E- r
    move into Q_induct1
9 P3 |0 m6 J  j    move into pickaisle.induct1' {( _/ g& @! z4 Q; {9 l; ?  f- }+ ~
    while A_i<=30 do begin
3 o5 j4 q# x) G& h) r7 K        travel to pickaisle.con(A_i)
; f% q, p7 L  Z: x2 K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 C& b! @9 o' j' _9 x4 [' L8 i
        else wait for 10 sec
' I& {- T9 t9 z( {+ N* K        if A_i=A_leave then send to die3 `* f9 V+ I5 r6 a% E
        else inc A_i by 1
& y3 d3 X6 Y$ }; f6 M# w    end$ O' G/ \# k5 S) S3 o
end' e0 _- S, c$ E2 A" v" C% c1 W" g4 d

2 L  s: d( q% }/ ^begin P_pick2 arriving' M2 i; I4 c/ s( ^( [9 {& e
    set A_i to 11
6 |! k% C9 k! d3 O4 v5 V    move into Q_induct2
& N9 m3 |( L2 H- V7 S" W$ Q' D% |    move into pickaisle.induct2
1 n% ?) R3 y& c) S* p$ v7 H    while A_i<=30 do begin" o, }8 k0 [  X  k$ k, u
        travel to pickaisle.con(A_i)
$ Z# D4 S% V* D% z0 F  j! s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 B3 U+ Q" w" K# m2 a        else wait for 10 sec
8 V, }# V) i- l! [/ }& B$ R/ S( G        if A_i=A_leave then send to die
# n0 \9 ]8 P0 {. ~$ ~- p        else inc A_i by 1
! e" _# `2 _8 q+ _4 d) x    end
) Z+ u- S. z8 o' {- yend8 {! t) u% [" b  M
( a4 [% d4 F2 A3 u: z4 M
begin P_pick3 arriving* D& G: D  Z! L) i% s
    set A_i to 21
! m2 J9 f4 {0 @, N* h. O1 S    move into Q_induct3' E$ k8 A6 ]3 {- W7 L* o
    move into pickaisle.induct3
* l8 g+ n6 m, L. I4 E    while A_i<=30 do begin
3 ]8 u' ?# U5 @4 k; j' Q        travel to pickaisle.con(A_i)
$ Y4 D! K( \) W! N  n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 M0 u( C3 O/ P2 D
        else wait for 10 sec
3 v4 _' d8 T$ F* _9 b) J        if A_i=A_leave then send to die
6 [+ u/ O1 Q/ |/ H7 r        else inc A_i by 11 n% C8 U4 G! v4 }' u. p1 y+ _
    end. l+ |6 A0 Y) Z5 @
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是个什么东东?' ?' E5 T, e" i* L
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" ~7 F) D( {- j8 ]7 ?
7 H# r8 M$ g) V; C0 a' ?7 F" K
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。4 T, E- a; @3 J+ ?& H- B
- o9 O5 j7 U+ F0 I
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
+ {) x" y; i7 S- T0 `0 K0 p1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
9 z) ~, X2 L: x2 t& z2 c2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ w* H  M8 z& k& |3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; {, ?6 f1 s" F" g# ?% i5 {, Z
begin P_induction arriving6 j5 j2 y4 L& I* h$ L) Z& N2 Z
    clone 1 load to P_pick(A_induct)0 ~9 P3 \9 ^0 q, G7 R8 w! V
end最大的系
# C( s. m: R( R
, J' h8 B; R; u3 Zbegin P_pick arriving
3 Y7 p0 t: r; D& [; j    set A_i to procindex * 10 + 1
% o: Z3 F: D" b  h* u. C    move into Q_induct(procindex)1 W/ C& i& ]1 z0 ^- I
    move into pickaisle.induct(procindex)
2 ~5 Z2 Y% v0 x# O, A    /*check the type of pickaisle.induct(i), for your last problem.*/
1 ~" ~1 F" R, m' [% w: g! u+ }2 y% ]
' d$ A1 W! W2 f+ B: t4 K, ^    while A_i<=30 do begin" Z+ y% b( z$ J3 s3 X
        travel to pickaisle.con(A_i)" y: T1 m" g) k  X" Z8 X; N! o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- ~; H4 A; F2 m. e2 `4 c6 C) A        else wait for 10 sec
  D- W( p& A% i1 c+ U9 ^7 D        if A_i=A_leave then send to die2 D. U* w: x5 M9 j( N- k  Q
        else inc A_i by 1$ l4 W8 G# z3 _, X$ N1 T
    end
  F; j, L7 v! n" @: Fend
% P; c" R. k- F
' Q! p6 S/ l% d4 D( u+ G) w% b其中的procindex为整形,代表当前process的序号。
: ]4 s5 P6 l+ E/ O+ G; N' `$ L6 _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-11-19 16:23 , Processed in 0.018078 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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