设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13936|回复: 2

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

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

, m5 |- e! u$ ~1 I) u7 Z2 }我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 L6 @$ U  |. d; y* ?; W* ]9 A+ ?: V
begin P_read arriving
2 Y6 l; K0 m! N    while 1=1 do begin$ e) w) |; U( Y, @+ f
        read A_tote from "data.txt" with delimiter "\n"
/ j# |  `, O( K  z9 {. j; P; C        read A_time from "data.txt" with delimiter "\n"9 F, P6 V! s4 d& C( {9 W
        read A_leave from "data.txt" with delimiter "\n", z) M" G1 m" M! p+ M$ Y# ]
        read A_picks from "data.txt" with delimiter "\n"
$ C. m0 o) x7 m! N        set load type to A_tote
+ M0 Q3 I' X3 ^( q: h        if A_tote="tote 1" then set A_induct to 11 U& N" J3 L2 F- J2 m) J) K  {
        else if A_tote="tote 2" then set A_induct to 2
' H' ?) h( V) P# Q. v& Z3 a            else set A_induct to 3    , l7 j7 ^5 e3 ], b; g
        set A_i to 0# U4 e: F8 ~$ j3 O/ D" {
        clone 1 load to P_induction" B9 O1 I7 b7 S& l
        wait for A_time sec
! m7 t) ~. d3 _% G" X    end
, V3 O& X, ^+ `& ^end, E1 o% D/ s% z# c& q6 c  Y
" K( n$ V3 [. B$ S1 a2 \" N
begin P_induction arriving3 {6 c/ r5 Z3 W8 V
    if A_induct=1 then clone 1 load to P_pick1$ Q' H2 N+ }! V0 i5 H
    else if A_induct=2 then clone 1 load to P_pick28 S: f' I+ b9 \5 G* R# ^
        else clone 1 load to P_pick3( \, N9 e% {6 D# M9 A1 S  a; Y
end
; c% }$ o) x" N
  }, L7 W* f) `) \8 I3 Xbegin P_pick1 arriving& S7 Q) Q* Y  v, ]
    set A_i to 1
- D# w9 y$ }5 v. x/ A    move into Q_induct1
2 h4 x7 G) \  K( b- Y    move into pickaisle.induct1
2 \6 b( Q$ ]5 V% v0 O2 g1 ]    while A_i<=30 do begin7 o# B) M5 `9 h# R4 \
        travel to pickaisle.con(A_i)+ r0 }$ I1 S1 f" m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 t" J) ~* @7 T% I) g& h3 t6 M        else wait for 10 sec* [1 g6 V. N7 M+ w6 o
        if A_i=A_leave then send to die0 M  K% c$ e: ^
        else inc A_i by 1
0 g* `5 n5 ]( N    end0 j* h6 M! H4 s4 p+ W
end) \! X, M5 v9 k. e4 M

6 B) H( m5 [8 ~4 v3 H' ?begin P_pick2 arriving
6 Y" c1 g* E$ E6 C. E5 F    set A_i to 11# N- a( l( x& X1 h4 X7 R: r; X
    move into Q_induct20 S, T5 k' `1 ^* L3 z% r, I* [
    move into pickaisle.induct2
  o* Y5 R1 _3 F+ K) M7 v3 v9 B    while A_i<=30 do begin! O- b2 v8 F9 O& W
        travel to pickaisle.con(A_i)
, {* d4 }2 C: J8 |* k4 @& ~8 Q" L" p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- y% p& q6 v7 v% ?- |        else wait for 10 sec
$ j0 P6 I$ d  e        if A_i=A_leave then send to die4 V/ F. i4 P: j1 y3 Y9 I8 u
        else inc A_i by 12 t; i- w6 A' s" e, R- O) S4 w
    end
  ~7 D1 b7 F2 u+ [end- D+ p8 v* n, v9 W% g

* T2 G- u4 C9 F8 h4 Mbegin P_pick3 arriving8 ?3 V7 Z2 k1 m) r: c
    set A_i to 211 Y! E% K3 l9 _7 a. U  Z1 d+ X( J- ?
    move into Q_induct3
$ W5 p  R; s) ~& z    move into pickaisle.induct3* l* T4 x  c- }0 `
    while A_i<=30 do begin9 @) P) q& o+ v9 e( @
        travel to pickaisle.con(A_i)
) d. h' Y% F1 D6 Y% M% N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 t& F" [- B4 T) B! s8 b( @        else wait for 10 sec5 H- x3 D6 h) |  {* O
        if A_i=A_leave then send to die
; z: n7 t3 L, _2 {% g        else inc A_i by 1
0 ^+ c4 y. V( p# B6 \# I    end
! g6 }# j' x2 }( @+ _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是个什么东东?. Q. s* j! \9 w4 ?4 v  A
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 h% m# G: a# n) ?, S* O2 y- _
+ Q: q4 k+ X  [! ~" e! S7 GAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 `$ Q: m7 d8 M
* a8 G% D% v. M另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ Y* Z: l  {; i( T0 k0 b' ~
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# S6 G+ k6 f1 |) p8 u& ?, ]
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" k: t& o2 x) D, D8 v( D. t
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:  t+ m: V: P+ v& _
begin P_induction arriving% y7 G+ ~4 z7 t3 e  M& z4 D
    clone 1 load to P_pick(A_induct)+ p7 E7 {9 L: M* ^/ V, z' c
end最大的系. ?6 z- ?) ^' b0 }" C

$ a/ V& r/ K; x# hbegin P_pick arriving
) W8 d& U, g# |3 S5 u    set A_i to procindex * 10 + 1
1 w) e0 o7 K8 F2 ^0 q4 h4 l0 A    move into Q_induct(procindex)
- X2 s8 [! T5 S, j$ [$ ~- x    move into pickaisle.induct(procindex)
1 @  H$ p( x: x0 U. G7 l" p6 \    /*check the type of pickaisle.induct(i), for your last problem.*/* D  u* C5 v! Q7 W7 x% B

# h( B% _" s+ H3 t4 X! X    while A_i<=30 do begin
# y$ W; Q1 `* K5 S& @% l8 T1 g6 c        travel to pickaisle.con(A_i)
* m3 Z5 t2 e. m6 i) A' m) B: a3 ]$ q- Q! o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ C' z: F! ?% C  ~3 A) m4 [: t        else wait for 10 sec
! B- z1 K4 F1 k3 C) i8 P8 k        if A_i=A_leave then send to die! [; y0 o, L- q) ?) p8 M/ {0 D
        else inc A_i by 1( H: i6 }3 U8 m! O$ ?! ]0 `
    end2 h0 ]# C! [# O$ {$ n$ L
end9 o- p! d6 Y( k
3 \% Z$ h" x0 d7 B/ }3 \1 P
其中的procindex为整形,代表当前process的序号。
) l8 |- c  n0 [& C. L, Istation和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-5-21 00:56 , Processed in 0.018077 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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