设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12328|回复: 2

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

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

! Y7 |$ J6 |% l6 o8 a4 i, E我的问题是,在每个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中的数值,不知道会不会有什么不妥。' L9 f. |/ E# ]- i' W

; Q+ ?5 Z9 b$ mbegin P_read arriving
, P3 j" ^. `; {/ n    while 1=1 do begin
' o0 I& ]. k  l        read A_tote from "data.txt" with delimiter "\n"8 A$ A* O/ U7 t$ @" M4 N
        read A_time from "data.txt" with delimiter "\n"
4 L( L4 [$ ]% m! ~5 d" B        read A_leave from "data.txt" with delimiter "\n"
& _7 c, X* O$ p        read A_picks from "data.txt" with delimiter "\n"0 C; S) ~0 h+ D" C
        set load type to A_tote
* t2 ^& u# J. L9 ^5 c) l' }7 {$ E7 A        if A_tote="tote 1" then set A_induct to 1
) @* L8 i3 r7 t: J. b, ?- e        else if A_tote="tote 2" then set A_induct to 25 r1 d2 s6 W; U+ Z1 q
            else set A_induct to 3   
$ q5 P# G+ W) j- u* r        set A_i to 0
( t' O" [6 q, u! D& o        clone 1 load to P_induction
, k9 J7 @4 w* s5 |# j/ f4 M2 F& {        wait for A_time sec$ w3 B8 a% A7 v  P  x  M! A5 e7 X
    end
/ P! u0 _7 n! P" Qend) _$ I  `: F$ N( d% Q1 n4 C

, j4 ]( c: z3 k2 s8 ?" d/ E, {begin P_induction arriving
9 ]7 N: J5 r/ i: |# T$ \    if A_induct=1 then clone 1 load to P_pick16 C0 E% _4 s/ y: h/ m& N
    else if A_induct=2 then clone 1 load to P_pick2# j  d, u0 g3 p2 E) R& i
        else clone 1 load to P_pick35 k7 a# E5 ^7 v1 A3 L
end: a1 l5 [, i8 t& L. U( |# F+ A
" n7 t4 B; ]+ \; B
begin P_pick1 arriving! A" n. I+ B) f. f9 M
    set A_i to 1
. h" w9 k+ d5 `. A/ X4 Z6 R. q+ [! V    move into Q_induct1
, ?& a  \" C4 X2 e    move into pickaisle.induct12 _$ d9 d6 F' T
    while A_i<=30 do begin
9 ?; W! S9 A. k8 C2 f        travel to pickaisle.con(A_i); b- L, |8 S# c* `9 M# H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% N' L! Z9 g3 J* |. ]# D0 G        else wait for 10 sec
/ d2 O- U! P* M5 N, _        if A_i=A_leave then send to die
8 R$ A3 g1 n; X0 z        else inc A_i by 1/ L  W' a" g8 \9 c5 `4 q
    end
, R4 e  H8 L1 R$ u/ Vend
; W- U. X5 ~6 N% e# E* x0 p5 O9 g7 l* ^4 h  L. K( q
begin P_pick2 arriving
7 v: \& ~0 \2 Y: x/ P: u: w# Z) r    set A_i to 11
7 Y$ o9 l* ~  v* t2 v& f    move into Q_induct20 D6 d) t) J6 P: f5 t. d2 [9 j
    move into pickaisle.induct2
" V+ U" ~/ o8 |. R' O    while A_i<=30 do begin9 N- b- U4 M/ j% u6 Z' x' j8 v6 y
        travel to pickaisle.con(A_i)
9 R; y: P2 B1 [6 `1 `$ T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 F6 d% j0 S1 q1 T3 _" w$ `        else wait for 10 sec
$ M7 b' O4 b; V1 B) Q* L        if A_i=A_leave then send to die2 X7 {% g! q7 C) H- P- A
        else inc A_i by 1( ?9 m, u/ G, o2 {1 J( M
    end# F* f! i6 g# Z7 y+ y. f) b1 K
end, R/ J) L- Q) r& j- r' x

. l2 [: N/ h. M* Cbegin P_pick3 arriving
* G! }/ ~# }; K# v3 }    set A_i to 21
; t9 y' B! V6 g/ l. W; G    move into Q_induct3
/ m0 [6 r( ^/ _/ [    move into pickaisle.induct3
& q6 s! }7 @/ t! _  k    while A_i<=30 do begin
! m1 Q; e- w/ j        travel to pickaisle.con(A_i)
0 n/ ^& x" Q0 ]7 Y& n0 x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ w! j# B4 X4 x        else wait for 10 sec
, K1 n' ?, z3 L0 N9 x6 y        if A_i=A_leave then send to die, i! t6 C: b" m1 m1 b
        else inc A_i by 1/ N  f/ m$ h+ O+ T! K
    end
3 [1 `# d; R1 g: B4 ]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是个什么东东?
6 P, I9 Q8 ^$ s! tmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
- P: m' F5 F% g4 I
! p8 l) Q( |7 \- z, W( j# t) {2 iAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
( Z# [) W8 `  |, K8 \. |% N, ^0 n3 [8 r+ P* i3 @; ]
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
) W3 e# K5 n6 A" e1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
$ v# b+ i% P/ v4 u7 Z- Z& c2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;( q6 @0 M2 G2 X7 {7 K6 u  j- @
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 r2 p0 A2 U8 Q. U3 Obegin P_induction arriving
9 u# s! N% Z$ h! X# L. X    clone 1 load to P_pick(A_induct)% @4 @/ D: N# g9 i$ U
end最大的系5 r+ }+ @) e0 D& g9 z% t9 b* i* m

$ n3 P; t4 I  M6 bbegin P_pick arriving
; B* Z) y6 h+ ^- Q' v9 R    set A_i to procindex * 10 + 1; t1 w- Y  o: c5 K7 K# R
    move into Q_induct(procindex)3 c. s- G' I: h* a" _- l4 d! ^( E' I
    move into pickaisle.induct(procindex)
/ g# F- i/ {' X' H$ ~- b8 b& {    /*check the type of pickaisle.induct(i), for your last problem.*/
8 ~  b! {2 P$ z1 q$ \3 O
$ ]. F/ }( E4 {# j7 k( J  N0 n    while A_i<=30 do begin. L/ g8 M1 p8 X; z
        travel to pickaisle.con(A_i)$ u/ H3 h- `- B' U, l9 F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# A5 y/ K5 i2 U) ]4 B        else wait for 10 sec
8 a4 |4 u, w1 N1 h/ q' \        if A_i=A_leave then send to die
1 M/ K8 ?5 p5 a& `: e& Z( O        else inc A_i by 17 q0 B$ a6 d# N
    end
7 ^1 W; J. P* S( Lend
5 i# X& A4 Y/ T2 }9 |* \- o& E3 Z5 `
' t& G' K$ w" t" g8 W9 d2 V其中的procindex为整形,代表当前process的序号。
3 ], h, r' E' n1 Wstation和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-1-14 04:08 , Processed in 0.018984 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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