设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12645|回复: 2

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

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

& D  V: _. l/ i# ]我的问题是,在每个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中的数值,不知道会不会有什么不妥。, X9 p: S" m) f& D/ S

! P5 S/ A- C& i1 n% \& Ibegin P_read arriving
( L, c( g2 q( Q    while 1=1 do begin
$ X' f6 |& D1 Y8 l        read A_tote from "data.txt" with delimiter "\n"; l7 F4 g, i: p. N% l1 C4 T
        read A_time from "data.txt" with delimiter "\n"; u* P0 c5 M' M6 C
        read A_leave from "data.txt" with delimiter "\n"
2 t  Y. c; q  H: I) u6 N3 n        read A_picks from "data.txt" with delimiter "\n", B9 }2 j7 Z6 j9 p- d6 ]
        set load type to A_tote
7 I+ d$ j; ?7 f* Q        if A_tote="tote 1" then set A_induct to 1
6 Q, [; p. d3 Q6 u) O% _        else if A_tote="tote 2" then set A_induct to 2
& \  F# v( T7 }' L- b( r6 E' F            else set A_induct to 3    / D, K2 B1 B  q4 c, D. i+ {
        set A_i to 0
0 |% Z8 ?/ j  r" V+ z% w6 w* c        clone 1 load to P_induction; r, o+ e6 M: N5 ?2 h7 j2 d
        wait for A_time sec! i, O* j8 ]- l+ g+ d- T+ k
    end5 ]5 r$ K9 v' @) w3 j' L; E
end4 y( V2 R3 L  m; ^$ ~+ F
# I: ^! @4 @  Q& C! o$ y, R+ i
begin P_induction arriving; q# x$ R6 P% r  R) `
    if A_induct=1 then clone 1 load to P_pick1( S- N" K6 r8 t9 b5 F
    else if A_induct=2 then clone 1 load to P_pick21 ]; {+ E, v9 V% J" i$ _+ ^
        else clone 1 load to P_pick3
8 B- h9 p4 W% y3 t4 K7 Bend
" n2 C  o) R) V
* @# D9 y4 Y) }# o$ K; R+ z5 ?begin P_pick1 arriving$ U7 p5 d  }! r5 a0 r+ [# G
    set A_i to 1. m+ x' D: ~1 E
    move into Q_induct1
1 B) U& i9 Q. `& \- d. U    move into pickaisle.induct1- u" w& T3 U: u) P: b. H
    while A_i<=30 do begin4 j% {& Y: c) ]+ {# J
        travel to pickaisle.con(A_i)
5 ~0 C  T  ^; y: T5 b2 n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ K  t9 M0 z3 P' \# }        else wait for 10 sec
* g9 q- d+ L* e        if A_i=A_leave then send to die3 d- [$ a. g# q8 ?2 p8 N: n. }, h6 U
        else inc A_i by 1
9 [) F2 T( J/ x; o# k% D9 ?    end
9 G9 n; B! Y7 z; I: T: f/ ~6 q' Iend
6 n; Z, g/ N( L6 d- A3 h
; t7 e. T! }% {7 l3 h2 O  h5 @. `begin P_pick2 arriving. d- [4 F0 u' |0 j
    set A_i to 11; A4 U* p- b* [2 e/ x9 @
    move into Q_induct26 U( d" I7 M& X4 M) h- M
    move into pickaisle.induct23 Y# B) K. F6 C4 `/ N! @0 m9 t+ D
    while A_i<=30 do begin
- f% m  A' B" [) j; }        travel to pickaisle.con(A_i)* p1 a: L$ ~5 w. {" A- [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# z$ _0 }: P* K# ?
        else wait for 10 sec
5 }9 f+ l. c" {) P* o  R        if A_i=A_leave then send to die$ T; p% l4 `# s6 w! ?4 q1 f8 z" a. f
        else inc A_i by 1
6 [* K1 J, v8 n) \2 j    end
1 P8 ~2 t% C& Jend
2 m: H, |$ c( [  X! u1 ?! R% R
2 ~- [1 _9 h! ?begin P_pick3 arriving
$ F" y3 p0 j  {6 T    set A_i to 21
) j: P+ ]9 B  E+ o    move into Q_induct3
- J8 r8 l" o# S9 j& ]7 C6 }1 n    move into pickaisle.induct3
6 J. G! s. R* c% C- ?    while A_i<=30 do begin: g) q8 c: Q, V* s; f
        travel to pickaisle.con(A_i)! B5 ^* q, I/ a9 F% S! ?# ^1 V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 P& d/ W: Y. O: T' l        else wait for 10 sec
6 h) M* H& t8 q        if A_i=A_leave then send to die5 M* f6 m. c7 B) |8 K% l
        else inc A_i by 1  \4 y. k0 H# {# @
    end  r8 Z, h0 h. Q9 ]/ w( ]; v4 g4 V
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是个什么东东?
/ A; d9 L+ u7 V/ j+ ?move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
3 w# k1 p1 u6 S2 Q; s/ g' \6 {/ [9 [+ C# A. U0 J' c8 S
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
+ B7 S' R* S5 ?+ x/ t
4 K. y) \4 |. X& B# \另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, L9 x5 R0 F6 A- f4 z3 b8 t
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 i1 z  c% m+ [# B; n) p2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) {/ N2 V9 r2 |5 f  k0 Z1 h4 _
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:! m7 m+ ?2 @0 P+ Q" l
begin P_induction arriving
% i0 t- h" v2 W5 e7 n" P( o% Q    clone 1 load to P_pick(A_induct)' ]0 E+ j, w. D- _; R
end最大的系
/ t* j- w- P  K- j
' }+ t( Q  Y3 `begin P_pick arriving& \' b5 {* w0 |/ T
    set A_i to procindex * 10 + 1
% d( y$ E+ F$ y* T9 M    move into Q_induct(procindex)
- H4 x8 ?+ Q) L7 X9 Q/ G    move into pickaisle.induct(procindex)1 M$ ~/ z& K  u2 |  z( ]+ `
    /*check the type of pickaisle.induct(i), for your last problem.*/
; K/ z1 I- K( f& f" m1 ]/ S- I0 G9 i: s/ V/ }) c6 w, E" l
    while A_i<=30 do begin, ^* ^$ g6 K5 A/ s5 G
        travel to pickaisle.con(A_i)
/ n, B& Q4 O: U: [0 U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ _/ C" Q' S! a4 ^* E1 p, k9 O
        else wait for 10 sec! S( r  x4 S; u$ ?. C9 j( W0 Y6 C
        if A_i=A_leave then send to die
2 h# \8 s, `8 x+ E# \: q        else inc A_i by 1
; W: Q* Z9 b2 ~2 I( v) z! ^    end
& V% B+ a& P1 {: L$ V" Uend, I2 x; T+ X  i, q  r
3 k" c4 ~5 |# i% b3 G3 [# ^
其中的procindex为整形,代表当前process的序号。( c8 `, m* C  v$ B  C
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-2-7 14:08 , Processed in 0.021170 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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