设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12621|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. d- u8 e: n' o" [' L+ u' t5 I

0 R6 Z( Q( s" L3 t, ]. p我的问题是,在每个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中的数值,不知道会不会有什么不妥。2 J) J' _' C  S' }

# j) x9 k. S) a! H9 Nbegin P_read arriving" j- M3 A8 H, f
    while 1=1 do begin/ ]. o! N" L( ~+ Z) ~
        read A_tote from "data.txt" with delimiter "\n"3 C8 G: ~  c  \# I5 X% {; n
        read A_time from "data.txt" with delimiter "\n"3 V* B4 j1 ?! j2 a3 [7 s
        read A_leave from "data.txt" with delimiter "\n"7 g2 G( ~1 p- p3 u) J$ w- E* Q( W
        read A_picks from "data.txt" with delimiter "\n"
7 ]" e1 m! S( o        set load type to A_tote
% G  n' U' S9 G        if A_tote="tote 1" then set A_induct to 1
6 L- M6 S9 P8 X. Q0 s        else if A_tote="tote 2" then set A_induct to 2; N8 D" U; J5 C5 Z
            else set A_induct to 3   
* v% e# z$ k- J! k* ]        set A_i to 0
) X; Q3 A) {; y9 M. d        clone 1 load to P_induction
' q* D* S2 b; m+ h2 K: U        wait for A_time sec
. `' [) p( n/ f4 G    end- k3 w' R8 n4 w9 M9 Q: R2 J" s  D6 y
end* o; e. A' `, z- @
2 F9 f/ R6 s) ^9 \/ g8 O3 H
begin P_induction arriving' f( z' c. h2 B& s; O; K2 X
    if A_induct=1 then clone 1 load to P_pick1
) t2 ~7 U! g, W$ j; D" Y    else if A_induct=2 then clone 1 load to P_pick2. J) A! _6 M  c7 Y$ @3 W$ F
        else clone 1 load to P_pick3
) o5 f7 [) q1 {4 P. F. Oend+ h+ P5 G! R  }& g4 `/ N2 z2 T. `6 {9 o

0 J, l) x* I( g+ cbegin P_pick1 arriving5 n1 r8 P, r4 J, g+ |8 D
    set A_i to 1" B$ i2 _" [' n
    move into Q_induct1
) s7 b& c1 A! \- U( w    move into pickaisle.induct1$ N  |& `! a- g3 q  s
    while A_i<=30 do begin  C  V% f6 P4 s) S' j/ n1 D. W
        travel to pickaisle.con(A_i)! b8 f  D0 y$ y6 n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- g  J, ]% X# l        else wait for 10 sec
' ~# A! d3 b; e0 o, I! O        if A_i=A_leave then send to die$ x. b: X% x3 @7 b
        else inc A_i by 1# k) `& |2 n& O* k
    end
1 U: `! g5 y' R# ^  A! m. @end
8 b. y. \; t1 y3 n7 G$ p5 n7 T$ R% l& f" K) q/ c- y
begin P_pick2 arriving
8 d; q3 y- W. a: y& Q& p! t6 ?    set A_i to 11
. a( l3 ~$ z: t) l    move into Q_induct2* @9 U) s# A9 x" G* ^$ B; r
    move into pickaisle.induct2
* P  y/ f& B& ~$ I    while A_i<=30 do begin6 V# t+ N7 v% a- O) L* j- H
        travel to pickaisle.con(A_i)
; A) a% J0 \( B# i; o& g% j9 [8 q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* Y. _# u! E! F9 k! W2 ]        else wait for 10 sec" B% N6 i- {6 p* f
        if A_i=A_leave then send to die
. Y7 Q0 ]1 g; v. w2 y2 y. s# L        else inc A_i by 1
; y0 i3 ]) \$ I8 g6 W% i    end
% X! J4 g* e, C! S: Bend
0 c* f0 R# S3 {9 N6 x+ e0 a
9 p; l8 w4 Y* b5 I7 W* r: y2 vbegin P_pick3 arriving8 n3 x& L8 |' V$ E
    set A_i to 21% a- V0 l9 [; a; E7 ]
    move into Q_induct3
" Z3 J7 u" o& |# M# H4 `4 R6 U    move into pickaisle.induct30 e# v: \; o  G
    while A_i<=30 do begin  J- h- X( F5 m) {) }
        travel to pickaisle.con(A_i)9 Y4 }8 t9 e* B2 a6 Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 U# s0 P9 |. y* R# p- l
        else wait for 10 sec
. G4 p5 J& `9 e% H% O: X" I        if A_i=A_leave then send to die7 a* Z2 s4 f3 ^: X  {
        else inc A_i by 1
8 Z+ o& B0 x# j1 e* q2 F, y/ w) [4 ^    end$ S" u- W+ [/ R" H7 X
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是个什么东东?
1 {1 Q: \+ F( [1 s$ pmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 @7 y+ l$ w  r4 p7 ]3 z( n& ?: ?+ X4 Z9 j5 z
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
/ A5 d" z! @' f+ T; @  i: Y4 A
* t6 ~4 f( Q" g另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* ^  N& ]: \" f6 |! o$ j$ J- ], ]1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
) x" S  d  r0 i) D, A2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 z5 [  ]/ @4 ~* }3 J( O2 t; o/ a3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:: Z  e8 u; Z7 w, k$ {
begin P_induction arriving% j. `! @7 M4 c- \) v; h+ _
    clone 1 load to P_pick(A_induct)
7 y1 U5 u0 b! w+ ]end最大的系: ]+ v& q+ r, H6 |5 _  l1 Z; M. e& {
9 Q$ j3 B" ~/ g% x9 g' y
begin P_pick arriving
; m2 A) U/ q8 \2 O    set A_i to procindex * 10 + 1+ G: N  y! g4 o: c, P3 j
    move into Q_induct(procindex)( J  `6 I2 {2 ^
    move into pickaisle.induct(procindex)1 b5 A5 J* W8 i8 A
    /*check the type of pickaisle.induct(i), for your last problem.*/( S7 {, J1 g2 z. a& U4 g) E( G3 P
5 n+ ]% |5 R0 B/ r" O' a
    while A_i<=30 do begin/ m" y+ c& p0 [
        travel to pickaisle.con(A_i)( S# X% J9 ~7 n( h. H7 g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 _9 r" y! Q; x) u) r& ^( c        else wait for 10 sec2 d& U8 C$ i6 t' P  m+ ?
        if A_i=A_leave then send to die
7 \5 ], `' b, c  v7 v9 M* D        else inc A_i by 1
* F" @9 s- d' _- `    end1 I/ {+ B+ }$ M+ B6 }7 y4 ^$ t
end
; |& Z7 L2 c/ h* i8 H
: Q. t+ i4 M3 P0 ~( j  v其中的procindex为整形,代表当前process的序号。
" V) l: h4 H- F/ \$ B% x2 dstation和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-5 12:27 , Processed in 0.014883 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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