设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14313|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 K4 \/ ]* A4 D7 f2 r  m
! O: [7 O' K! P+ _+ Y/ J
我的问题是,在每个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 W7 s* b, O$ [. t  _* t# p6 Z7 `8 Y1 M% o, A& h
begin P_read arriving
! T. N9 Y9 F( e; i  m    while 1=1 do begin9 r, N1 ~: q( W$ c- L
        read A_tote from "data.txt" with delimiter "\n"; k0 i* A. K0 [+ K9 A3 Q* G
        read A_time from "data.txt" with delimiter "\n"
+ [# Q" u; m- L) _5 x        read A_leave from "data.txt" with delimiter "\n"1 P: T6 g2 t1 n$ s$ l* L
        read A_picks from "data.txt" with delimiter "\n"
5 ?" V+ G9 D- Y1 V- _% [* H! J        set load type to A_tote
8 f" T9 J7 X) ]$ B        if A_tote="tote 1" then set A_induct to 1
) W; Z, |+ N3 n) ~! L5 j        else if A_tote="tote 2" then set A_induct to 2
+ T" x, ~' f$ |0 v. |4 t. N            else set A_induct to 3    " s7 r3 s1 _+ Y. C( T/ R! C
        set A_i to 0
: z# M, Q+ H4 z7 {8 D# _7 s        clone 1 load to P_induction
- v# A# k8 A7 f  g% |; E        wait for A_time sec
4 Q  C$ K$ n* B% Y2 q    end
4 [+ L+ ~4 d1 F8 y  j2 d/ m; m) i' Eend. E+ b1 ^* @% a, S
  C  m' D# }( f0 j- {( d8 I$ r
begin P_induction arriving  ]- I" R( j/ ^, A& d# e. Y' d' H
    if A_induct=1 then clone 1 load to P_pick1
! v0 @3 P7 i' b$ x3 H8 u9 I    else if A_induct=2 then clone 1 load to P_pick2
8 o: M- A' V5 h/ \        else clone 1 load to P_pick3
' B0 {* p7 R1 S% H3 iend% ^% w. J) d/ t( L& {6 n, L
4 A% R5 \6 `7 ~- x8 Y
begin P_pick1 arriving
3 I! M- Q% m) V- p    set A_i to 1
5 c) A- m  v, p$ A! A2 t    move into Q_induct1
; Q$ b/ l) e- F! K0 V/ s0 O$ v& X    move into pickaisle.induct1, H+ k! c  @, p  f7 {
    while A_i<=30 do begin
) J$ E+ Y& Z7 Q        travel to pickaisle.con(A_i)
; M3 X; ?3 e/ @" H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ o" ~2 i# O6 Y        else wait for 10 sec- c1 H" |% n6 x7 P6 N( U3 P
        if A_i=A_leave then send to die
$ |4 H# P2 z. D! w: r( A# b% j# y        else inc A_i by 1
6 \. _  o3 G" m2 n1 a( O3 R    end
# S% Y, c6 h' `end; w1 Y' n1 M" v' o0 c* z5 z( f

. F8 k" [" t5 s: ^" I9 Ibegin P_pick2 arriving3 [' ~% C  o0 @7 Y
    set A_i to 11$ \0 {! p' D& W) l7 Q& {
    move into Q_induct2
) h1 W7 w5 X& b6 Q+ N: z6 A    move into pickaisle.induct2
& Q! ]. F" Y+ A: z    while A_i<=30 do begin0 U- \7 n7 f9 t7 J+ Y% l& f5 Q# h5 d3 r
        travel to pickaisle.con(A_i)5 `& ^2 {0 H; d+ P; J/ b5 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ [# \! V3 F; m
        else wait for 10 sec
) J% t1 {* r9 k1 P( u- Z0 d& {/ f        if A_i=A_leave then send to die4 h+ D! R, Q3 J! z# i
        else inc A_i by 1
, x+ ]5 e# Z# a2 z# Y2 \1 M    end" ?7 E7 A2 N) b# ~/ _' Y6 x  R
end5 C% P' d0 G6 \1 R' k' s) r
: F' Q# Z( t6 I- Z% o
begin P_pick3 arriving* |. G' I- H; H6 B3 e( {5 p! k: O
    set A_i to 213 |7 B; H7 r' Q# r5 M, `$ x. Z  q
    move into Q_induct3& M" c- }6 e1 |) E1 w* a2 t) e
    move into pickaisle.induct3
$ }/ v6 w, @: P$ h  {  P1 h: Z+ O    while A_i<=30 do begin
3 @; G) w! s3 e+ O        travel to pickaisle.con(A_i)0 ?* o3 w/ v0 B2 i$ m+ h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 v5 y; y+ I+ K: y* @( `
        else wait for 10 sec
% R9 _6 V( a  Z9 y2 I! Q% ~        if A_i=A_leave then send to die& p( B2 Q$ Z3 Q8 O- E4 C8 D
        else inc A_i by 18 _  i, q$ e- j% W, n! l8 y
    end, T9 r4 Y) v# f5 C, T. S& {
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是个什么东东?
+ [/ Y6 Z! N/ p1 ]* ymove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?. L1 B1 |9 W$ n* _" I% t1 S" ^4 h
- S, y+ w! Z1 T$ A$ y
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& M4 G! Y" ^0 f) m7 T( G' |' P. W; p0 P  c/ F
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, Q/ M4 N6 D4 z, l, f1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' t* W9 h- ~8 ~; j6 a6 k
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ n9 C" w# k" v$ h& }3 Q
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 A: A% b8 |4 S5 Y. \
begin P_induction arriving
) a9 e3 _  s9 i+ L3 O# m& D7 L5 i    clone 1 load to P_pick(A_induct)
. d+ W1 s$ W  b+ Q& k1 o- [, nend最大的系
& p' Y7 O* z; [% ^# F% L% N& z" p" l2 @
begin P_pick arriving
' z4 b4 i0 e$ ?$ H    set A_i to procindex * 10 + 1; J* J/ H% H2 ?3 D
    move into Q_induct(procindex)( q3 F) ?4 H9 H% M
    move into pickaisle.induct(procindex)3 }* N0 ]/ A2 Z, V$ k: w
    /*check the type of pickaisle.induct(i), for your last problem.*/9 z  w/ r" Y$ d- L# r% Q4 M* u

& ^1 y" P7 m7 v/ u5 V    while A_i<=30 do begin
, L! ]$ X* A+ a" c        travel to pickaisle.con(A_i)
* E8 R/ x- O* h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ z& h5 {* ^* l( Z" H7 T
        else wait for 10 sec
2 l, w# N8 Z! h* Q/ R! J% W        if A_i=A_leave then send to die) Y* X# u6 u* i! n
        else inc A_i by 1
: l4 S) A9 ^1 f8 D    end
4 L! ]+ {8 R7 H+ g" h0 wend
% ?& T! u" @: h1 U5 F' p: ~0 @+ J  [: G/ f7 s2 ?
其中的procindex为整形,代表当前process的序号。/ @( C. V" S- P" C* 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-2 01:20 , Processed in 3.884349 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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