设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14897|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 L8 a. C) B; M% Q% U& ^
& H/ L$ h9 A: q1 b$ `
我的问题是,在每个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中的数值,不知道会不会有什么不妥。! X7 S: Y3 Q8 M
8 Q2 l/ @/ f0 s
begin P_read arriving1 T; V* b: |# N7 a- Q
    while 1=1 do begin) _5 m1 S- n6 Y$ {; U
        read A_tote from "data.txt" with delimiter "\n"
1 a/ `) l0 X9 b/ j        read A_time from "data.txt" with delimiter "\n"
* \6 ^( r1 g2 G2 B) j2 D7 n        read A_leave from "data.txt" with delimiter "\n"9 q4 w9 i& B* o3 x& n
        read A_picks from "data.txt" with delimiter "\n"
) r  r: `7 L! P        set load type to A_tote
; m6 T+ B/ w$ R& g1 p3 h        if A_tote="tote 1" then set A_induct to 1
. P6 q& x  }% i4 ]- t% u) h. c) B        else if A_tote="tote 2" then set A_induct to 2
2 z' P+ t0 k; J. X& f            else set A_induct to 3   
# o' i) h+ c+ r' Q) B: _        set A_i to 0) c% o* A* Y& o: D  a% \' F7 R
        clone 1 load to P_induction
4 i7 _: I' N8 |) T5 L        wait for A_time sec
$ G3 t% P$ p* F( u    end
, v. y! {* z. {" Qend
- i5 b$ d, X6 a* J4 m6 Y2 ^4 g0 f2 s9 @5 C
begin P_induction arriving* \! t0 l2 K! @
    if A_induct=1 then clone 1 load to P_pick1) z( L6 F; v8 ^( g" B) H0 h5 |
    else if A_induct=2 then clone 1 load to P_pick2' A7 |, S# E' T+ q
        else clone 1 load to P_pick3
0 f1 H% K/ c( M. pend9 |! p) A& |% q$ W

: _+ U; D2 ]  cbegin P_pick1 arriving- K) F$ {0 |% ]% F7 x9 _
    set A_i to 1
4 @' r5 W2 T2 s0 E  [& I9 g    move into Q_induct1: I$ y- O6 w# Y1 Z' K' Z/ O
    move into pickaisle.induct1
1 E* T$ q; }7 e" p% z) s" V    while A_i<=30 do begin
( I9 }# h  r9 G5 P% X6 [6 [        travel to pickaisle.con(A_i)5 \, w5 N* ^- x0 U% a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 Q  N) M4 p4 g! w        else wait for 10 sec4 w+ @9 A6 k$ J8 Q* a7 B
        if A_i=A_leave then send to die. o+ @4 F. S+ S" r7 J
        else inc A_i by 1+ ?. _2 d5 V9 L# t7 O! [
    end
) C' W% T: Y5 U4 [$ }& ~2 H  Uend" p$ C& C; m% O  B3 s

# T! B( j* ^" c( V' i: u4 B0 kbegin P_pick2 arriving
3 d7 c# z  h: D$ t1 v    set A_i to 11
5 U" O6 t# k1 ]! k" b3 Q8 @    move into Q_induct29 u5 a' ^; J  T2 M
    move into pickaisle.induct2
. S, `9 F  q8 {9 ~  h. b( C) E3 c' P    while A_i<=30 do begin% t5 T) d2 r  W
        travel to pickaisle.con(A_i)
( l% o( d: V4 X% t* Y( e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ M, A! F' z0 L7 c. u* G) V4 d' I3 [
        else wait for 10 sec
, ]0 ?6 I! F- j  S/ N        if A_i=A_leave then send to die
0 ?$ @' |  z* P1 k& F2 c, F, C8 T3 B        else inc A_i by 1
% N* l. E) n) |6 M. r    end
; \! x/ m$ p: H! m% E9 {end
! s4 g/ S$ D4 g4 a$ c( N" E' p2 K" u7 ?0 L# n* z* S! v6 y
begin P_pick3 arriving: Z* `  Q9 F. l6 R7 A
    set A_i to 21
. }8 t% V! V) M    move into Q_induct3
- J; k: D- K! p' ]    move into pickaisle.induct3
) P  O6 t, J! ]; m" h    while A_i<=30 do begin
" [4 }: B5 b! D4 t, @        travel to pickaisle.con(A_i)8 p# t" J" c4 U) |. }$ F* H, \4 B6 h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 H" [2 Z8 q  b; u
        else wait for 10 sec+ C: R# J  M" u& s
        if A_i=A_leave then send to die( X: D3 m  w) E( {" _2 r
        else inc A_i by 17 o1 Z0 x# V1 o$ M0 Z' n
    end
9 X5 `& S5 R3 t3 B  p6 h% N9 Wend

最佳答案

查看完整内容

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是个什么东东?4 t) K7 H+ q( Q4 K- y! x
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ c$ n: D1 j. b
: H: v" K: T' _. jAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
" L/ E0 w! ~1 m: v/ T6 `! P5 p/ _2 f- ^  q. M0 Y+ v/ x1 f5 H
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:0 g6 v. ?7 w+ x; g3 c: P2 J
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 x! ~: L. j: Y  a8 \; j
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ P, _' Y8 i" e4 T/ d3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:4 F% t2 y" W2 F
begin P_induction arriving
% I5 Z/ {/ ~+ Q+ s, D" A    clone 1 load to P_pick(A_induct)
* ]" X/ g3 Q+ [end最大的系0 i: j9 n: S# j$ w' @

, J8 j( O: V$ J* y, T' jbegin P_pick arriving
$ u& B; [  z) w# Z8 ?    set A_i to procindex * 10 + 1# X# O( [& M5 w
    move into Q_induct(procindex)* R( L& P/ Y4 U2 l; y
    move into pickaisle.induct(procindex)0 g: q6 H) A$ X( \# e# F
    /*check the type of pickaisle.induct(i), for your last problem.*/: w' j  c8 p2 o* A' E$ X

4 ~% k( `/ @- R5 z0 C    while A_i<=30 do begin
8 Y5 J2 I/ l6 W% d# y        travel to pickaisle.con(A_i)
7 Z/ p- B/ m! I5 S3 ]0 y) p2 s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* x, t/ [% D! R; L  j* @, V' x
        else wait for 10 sec$ N: o; Y+ O3 |  {( S( d
        if A_i=A_leave then send to die: M# G& s3 K- O" d6 S! z" z3 S0 A; j; ]+ T
        else inc A_i by 1% p& {6 F- ]- y1 p# E% j
    end
' t- x* b7 @3 `, p' d) r: h+ |end
- N2 Q1 V: d  N" A6 j
" n8 M$ g2 R' _' H& z0 X其中的procindex为整形,代表当前process的序号。3 T4 B1 t8 p8 i. [
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-30 07:03 , Processed in 0.016592 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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