设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12567|回复: 2

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

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

+ C3 q( {, f' V0 j1 g我的问题是,在每个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中的数值,不知道会不会有什么不妥。! Z$ Q2 T) q1 s) G
2 P$ g' e- a6 w- m* i7 n
begin P_read arriving0 g3 g8 K  `+ Q3 X) e7 Z0 k: J( e) p
    while 1=1 do begin
% c1 ^% p% |% u* D, O3 `# T        read A_tote from "data.txt" with delimiter "\n"2 `7 g$ d8 x3 B3 N2 B6 i  o
        read A_time from "data.txt" with delimiter "\n"( E" C) U- U$ X2 T/ r
        read A_leave from "data.txt" with delimiter "\n"& B  |0 v# ?( B' g1 V7 c& B' W# o' r
        read A_picks from "data.txt" with delimiter "\n"
% A% w1 H" ]9 X5 N" r) g4 o        set load type to A_tote- [! f& m$ L. V2 D8 a9 T
        if A_tote="tote 1" then set A_induct to 18 Q; F( \" B+ B! t' W- O
        else if A_tote="tote 2" then set A_induct to 2
. S; M& I2 N3 ^  O1 ~( p            else set A_induct to 3    ! w' q" ^  _+ l! C' h
        set A_i to 05 ]5 e7 u* O. G' }" p* w1 e
        clone 1 load to P_induction% S) i6 B; {# r
        wait for A_time sec% Y9 ]( G3 y+ j9 l9 B6 D
    end
# A% H4 d  o9 v$ x/ \end
) [' W. h  Q3 _+ C8 n. ~  k, }8 L' \5 |: L
begin P_induction arriving3 _2 K& r& u5 m
    if A_induct=1 then clone 1 load to P_pick1: P; q3 y' U( S; j
    else if A_induct=2 then clone 1 load to P_pick2
; B' P  A9 i6 h9 N3 k        else clone 1 load to P_pick3
2 k7 p( }: E: l1 y0 ~- y1 n5 `end
0 W- Y1 ~' y: Z0 [6 p- |0 o9 |0 `4 R4 I2 }- G& p
begin P_pick1 arriving/ p3 j6 ^, r, V6 q, ?/ H
    set A_i to 1: i8 w* |- e) i$ P) x  n: J
    move into Q_induct1
1 }; B, n8 c- d, N( G: Q/ `    move into pickaisle.induct1/ D* r4 V1 c& s$ ^
    while A_i<=30 do begin$ t+ U) S) c7 |
        travel to pickaisle.con(A_i)( v' K& O  u" U* S) E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! m6 i. M$ k* ^4 p& d        else wait for 10 sec
% Y3 q$ M  s! \        if A_i=A_leave then send to die" U% o8 ]5 v+ z& H& U& X
        else inc A_i by 1
, |. Q: M, r2 R    end+ J/ h" A+ G, B
end
1 B: x1 `3 L' U3 ?# R% }. t6 U* Y
begin P_pick2 arriving& R  J& n: U& n1 ]: D
    set A_i to 11& T/ a! m* D) [# |
    move into Q_induct2; s/ g- [" Y! ]4 x
    move into pickaisle.induct2( a* g5 M- [" m) o
    while A_i<=30 do begin6 [: I! U+ ~3 e- A
        travel to pickaisle.con(A_i): Y3 G/ E& l! O5 Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) t) K' X* T# ]2 E
        else wait for 10 sec$ `( ?4 D, N: Z! _
        if A_i=A_leave then send to die  x) S8 @  ^3 M. Y! w. @
        else inc A_i by 1
! s7 }4 X$ Q: ~    end
! @* n1 V, U' G. |; Hend
# V/ [  E2 w; s' S6 K3 v8 _, c5 a& x# P. f" {  x, D5 I9 K
begin P_pick3 arriving
3 p6 G, s1 P$ H5 x, E    set A_i to 21
. v( M# t) j1 {$ V    move into Q_induct3! N$ t, {, p+ u% s
    move into pickaisle.induct30 Z% H4 a. D7 l0 ?8 u7 E. H. |* r
    while A_i<=30 do begin
9 x" M( l/ R; c4 O+ ]        travel to pickaisle.con(A_i)
1 n7 U( |5 u/ C4 a% o; E" r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 K# b9 G% [4 B( q$ C7 J( o
        else wait for 10 sec
, `) U1 q% o9 d* D        if A_i=A_leave then send to die: x! X9 n4 A; s7 s" c4 N0 J8 F) M
        else inc A_i by 1
+ l# w% f1 I' P    end
5 x4 n9 ~1 L9 O) P6 o6 Z4 aend

最佳答案

查看完整内容

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是个什么东东?
/ m4 Z% C/ y+ ~/ h2 H9 Q& }  kmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
% O% U6 [9 y  W& Q, ^: ^
9 [3 a+ o# m0 I' e1 JAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 d; w' }3 h* ^5 V3 v

. {1 {: r9 k0 c$ L另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
2 |1 d* ?" Y' Q8 H. u/ q$ w& B1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ R0 b5 y2 S, X9 Y; z4 L
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;% |, b! Z1 C0 m- `9 w$ @9 x
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 k3 U. a& h! u
begin P_induction arriving/ J! u, x% Y$ s
    clone 1 load to P_pick(A_induct)
- i" S( h* r9 ~, K6 ^. Lend最大的系6 w0 n8 |6 F6 u  q& j. s% ~) e% J

- {' ~9 Z+ n' ~2 H  g* [" hbegin P_pick arriving
$ Q1 t: G$ h6 u    set A_i to procindex * 10 + 1
5 r. G5 N- l" ^% O6 v8 N    move into Q_induct(procindex)* \& Z/ p6 Z( @
    move into pickaisle.induct(procindex)5 }% z" j, ^  f! \+ E
    /*check the type of pickaisle.induct(i), for your last problem.*/2 }% \- o0 ?! ^/ D

+ ^5 l) @( T, M5 a    while A_i<=30 do begin
' H/ @2 R/ u1 h! ^! g" `7 N9 T        travel to pickaisle.con(A_i)
  j+ T' Y. x6 V& q) z" M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- G9 @, j, g7 z& L: ?
        else wait for 10 sec
6 h: z, v) B/ m  j        if A_i=A_leave then send to die
# c; i8 |8 Q4 K! |: Q        else inc A_i by 1
  v# D6 F0 u* j) ^, \    end
  T# M& W& M7 K. h/ |1 n% t8 Dend4 t& X8 T  H9 ?* d( W
6 S9 c4 f; P2 e5 `9 d7 i4 p
其中的procindex为整形,代表当前process的序号。
. W' x5 w6 ?( V, z0 Hstation和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-2-1 17:07 , Processed in 0.054082 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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