设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15314|回复: 2

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

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

6 |) J9 s" x" \我的问题是,在每个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中的数值,不知道会不会有什么不妥。; F1 e7 \/ C2 B; f) ]4 n- `

! R/ q% a# a  x9 H: sbegin P_read arriving) Y, \! D- b! U+ R& }) G' x
    while 1=1 do begin2 D, K9 r9 Q# J6 x" X4 f
        read A_tote from "data.txt" with delimiter "\n"
( V; `4 j2 D; C2 I* i: j+ i        read A_time from "data.txt" with delimiter "\n"
/ B  L3 Q/ b7 x, t) M7 W" j+ G1 k1 w7 W1 \        read A_leave from "data.txt" with delimiter "\n"
; J9 }" k3 l! t: M        read A_picks from "data.txt" with delimiter "\n"5 s# x  U' [" t9 `. g1 G5 U/ K
        set load type to A_tote; U) i8 r. L; h. @( G
        if A_tote="tote 1" then set A_induct to 10 J$ [6 F' K" Y4 G" b7 r
        else if A_tote="tote 2" then set A_induct to 2
' H% G, |. r2 D  M+ J            else set A_induct to 3    & p( X7 Y7 Q# y) W  Y5 T8 u
        set A_i to 0
1 J4 o/ E( y' j0 e6 p        clone 1 load to P_induction
! g9 x6 t5 }; G* v        wait for A_time sec
/ s% N2 c1 |, Z5 P; g    end
: [# T' N' }1 e, p% q! j+ Gend' C' s$ ~0 M. i( [

% B% d8 i$ |* O3 _% @) h, ibegin P_induction arriving1 @, \& p9 y. K8 y0 @$ o4 p1 W
    if A_induct=1 then clone 1 load to P_pick1
$ T, b" I! J3 r" [- n4 Q    else if A_induct=2 then clone 1 load to P_pick2
% r4 y0 Y8 j4 b" ?2 L6 R. E; a        else clone 1 load to P_pick3
0 E* |+ z: k6 ?& s" Zend5 C# p+ M5 C& g8 b$ Y
: k# l& x% c% d0 a9 N$ ?  c- r. ]
begin P_pick1 arriving
0 J0 a: G& a* `* A/ N4 z    set A_i to 1+ ?, u, T; Z# I1 n  n4 \
    move into Q_induct1
- h9 C% l3 `7 m3 ^    move into pickaisle.induct1
5 w. Q6 f2 v* c6 X* r, B    while A_i<=30 do begin' ?! X+ E/ }0 r$ C: N5 T0 ?
        travel to pickaisle.con(A_i)
+ H! o/ t: b" A* w$ u. O5 z/ A( i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' x% e+ g7 J/ U
        else wait for 10 sec2 l" X5 X1 b+ \8 I9 ?( x
        if A_i=A_leave then send to die
  N  d, f/ d; m; J! Y2 G+ Q        else inc A_i by 1
, R8 V. E# a& c, {- C    end) k; `; C) ?2 Q, F
end* x6 P+ x9 d- [3 u) U0 A& y& `( v
) a9 a( X5 R1 J3 o) h) c8 s
begin P_pick2 arriving
* f9 o, {& _( ^# F+ k& P1 H    set A_i to 11% S# q( t& j9 u; Y/ `5 p
    move into Q_induct2
* U7 y- Y* O8 N# v, P+ Y    move into pickaisle.induct2
! b- \3 H0 z: E9 U9 a. I/ J5 E    while A_i<=30 do begin2 @( F; G7 X' E/ X8 v5 m4 R/ `
        travel to pickaisle.con(A_i)) J. p( b$ p" K9 ^8 u9 |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 w/ Y2 O! p7 @3 [' s* [$ J5 d5 R' X5 J
        else wait for 10 sec
# p4 [7 ~5 a0 m9 A0 }  X        if A_i=A_leave then send to die% Z/ Y7 Q4 C6 W% ?) r# u; U7 L. p
        else inc A_i by 1! m# n% {$ m0 q# Q5 ^& W4 v
    end& _  c+ s- |- j' G/ @
end
2 \* ]2 J) D2 v* A6 j; j( s7 y6 G  z  I- C
begin P_pick3 arriving9 S  I" y7 y$ f3 G7 E3 D, a
    set A_i to 21$ G+ r8 z, A, F2 U; a+ r
    move into Q_induct3
/ z. w7 y* H4 U$ I. _- s    move into pickaisle.induct3" _- k5 A- y% `
    while A_i<=30 do begin
( B8 g3 J( k' y" i/ a        travel to pickaisle.con(A_i)
3 N. G' D4 p  [7 r; R- v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, D0 l2 K2 i' [0 e        else wait for 10 sec* m/ D" P4 v& t( A" B
        if A_i=A_leave then send to die$ t2 Q* X0 c. Q
        else inc A_i by 1
2 ~; N5 F( b9 `' z; z5 y    end* n- u- s+ `$ @+ O2 r8 f
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是个什么东东?
! C7 Z- o$ V2 {& T8 N' mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
2 B/ h4 {! k' \, [# P0 t, S' x5 d; n7 ~% x0 G7 e( o
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。  r% c- q+ A- H- o7 J% B" w' _0 \+ Y
: k  U7 n# y# I' O0 @
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  ~" a* u+ H$ _* L1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;- f9 Y, K( ?/ N: X
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 h$ }! {$ M' f7 }8 l" p  w; j; K
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
0 Y( R8 V' ]# a* Zbegin P_induction arriving
; j7 b( w/ K" V2 j+ L, R* l; E    clone 1 load to P_pick(A_induct)
5 Z( ]4 J, N+ v2 y( Rend最大的系6 J3 r$ @5 G8 I, M6 j9 G
1 @+ }3 y" a% x0 y4 }  I! |
begin P_pick arriving
, O: z% f, u, O# K: R* ^, }3 b    set A_i to procindex * 10 + 1
* s! N1 O4 g( O3 ]  Z7 p    move into Q_induct(procindex)# R5 u! K0 i0 z' F% H
    move into pickaisle.induct(procindex)
/ [$ h8 a" X" k4 K5 s( Q, h    /*check the type of pickaisle.induct(i), for your last problem.*/1 Z" u+ [, v$ U$ L& r8 Q1 |  U
5 D5 q- s- V* v, Y. p, ]6 J$ {# F
    while A_i<=30 do begin- `( N: N' D$ Z$ r
        travel to pickaisle.con(A_i)
4 k5 b+ F- L) `6 n4 K- ]* p6 F" C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 g! G3 \$ A+ \; E
        else wait for 10 sec- S. |) m4 n$ ?6 j; F
        if A_i=A_leave then send to die
4 i* b* O% ]" M        else inc A_i by 1
/ S% W5 Z' A. M  |2 p* v( k    end2 R7 I$ D8 g! T2 p* I: Z
end0 \; e9 j1 u. m0 h. }

3 B. @: |1 i$ Y$ Q8 j9 C9 [3 v( M/ s& T其中的procindex为整形,代表当前process的序号。: _0 H8 N4 U* s. W& T* _7 S' D
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-9-1 14:38 , Processed in 0.018673 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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