设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14785|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. y8 [3 J7 M4 D6 W; [/ `% q! A
9 ~1 J% O' H' [+ e% y我的问题是,在每个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中的数值,不知道会不会有什么不妥。, `: C0 A9 r- x9 T! b' ?

# p- S8 m% W: ~  [7 G0 Ybegin P_read arriving6 X) Q9 p: U. `" q, d
    while 1=1 do begin
( {8 M, v# L# @8 L" _+ i        read A_tote from "data.txt" with delimiter "\n"
4 b: `' X& @6 I8 I4 B* H* ^5 w$ J# Z        read A_time from "data.txt" with delimiter "\n"
. C; L/ t3 J# T6 C( O6 E        read A_leave from "data.txt" with delimiter "\n"
6 @6 \% e( ~( o( D6 I8 Z* e        read A_picks from "data.txt" with delimiter "\n"
) `! \! q. g  T( N! q) _; d' [0 H        set load type to A_tote) ^9 G/ ?& ~: E) T
        if A_tote="tote 1" then set A_induct to 1
" E0 Q2 h% z$ z0 S        else if A_tote="tote 2" then set A_induct to 2
- I6 W: \/ `2 L* x            else set A_induct to 3    4 i  W: I; o! Z
        set A_i to 0
: W$ g! v7 a( s1 O1 k0 z        clone 1 load to P_induction) F( L5 W' D: I) b, {& g; K! |9 |* G
        wait for A_time sec
7 p$ g$ |/ g2 Z! F    end
; S; I, O5 _5 y+ \; aend6 `, g$ r* }# x( p& t) l

( I5 i& j& k& ~8 r/ G, I1 }) k0 Kbegin P_induction arriving
% s# Z2 L4 F& K% c/ w# }# {5 f' y" O    if A_induct=1 then clone 1 load to P_pick15 j1 M9 z$ [- y% ^) `* ^9 w4 Q
    else if A_induct=2 then clone 1 load to P_pick2
" Y: ?1 I5 m& i. `& a" M( k" V        else clone 1 load to P_pick3
( u9 @  Q# ?9 E- C1 bend  p; K  x' z9 q7 i
& E; r1 H$ q8 ~
begin P_pick1 arriving( w0 l9 n4 u4 _5 T
    set A_i to 1
+ Y, }% R5 K9 S/ S3 z& ?    move into Q_induct10 `% `% t  M7 n8 S  H
    move into pickaisle.induct1
$ d' e( I( H9 j* Q1 d% Q! m% |    while A_i<=30 do begin
& p+ b# c% D  U; o6 d/ {        travel to pickaisle.con(A_i)
5 I0 H% |+ z; E! {: N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* c$ N0 x: ?8 |        else wait for 10 sec% H, c* C: h; ^3 ?0 v; }
        if A_i=A_leave then send to die
+ h; z2 b+ G* j        else inc A_i by 1
! Y9 P# h; T5 {. [0 I6 J    end
+ g) e2 r' ]; b% o3 E0 W7 W* Y, Jend
( w* W8 W, g; ^  ]) b5 M- @
7 \0 C; S5 X( r* G1 lbegin P_pick2 arriving4 g7 a" W, y5 [; P
    set A_i to 11
/ L6 G: \# ?. U& r# W6 W% h3 ]  G    move into Q_induct2
1 U0 g9 Y  b7 _& E; g* d0 f" j    move into pickaisle.induct29 n& P0 u. s4 I. ^' R: t* B
    while A_i<=30 do begin
; d/ C# K0 e/ S4 s! ~) i        travel to pickaisle.con(A_i)
. ~/ Y$ M9 u9 b% @/ m8 S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" G# e, o  Q" X) F! V1 M        else wait for 10 sec; S: Y1 t" E9 G2 G+ s6 e5 t- V
        if A_i=A_leave then send to die
% r0 }) _7 C& j, I; M6 }        else inc A_i by 1
! l7 o7 |' |4 t. b    end- m7 u$ |! ~9 _7 Y# o8 A5 p
end
! L- z0 A9 L6 s- j! F. i* x! s  ^% q
begin P_pick3 arriving4 H$ b& V6 P: Q
    set A_i to 21
- z( @2 D9 m% j8 S* x2 e    move into Q_induct3- p+ t$ S! C+ H! v8 ?
    move into pickaisle.induct3
% I1 s( J( C. S' P    while A_i<=30 do begin
7 V" U& _) Q6 ^. q4 h        travel to pickaisle.con(A_i)
( H; A/ I7 B0 A" u; l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 I; A5 Y) ?- @9 d$ V        else wait for 10 sec
, K* q! Q$ }+ J2 L3 b; U        if A_i=A_leave then send to die0 k3 t7 F4 v' O" p  o
        else inc A_i by 16 c0 s' l  t1 V$ u( d
    end
& A" J, ~3 b5 D9 E8 j- y# dend

最佳答案

查看完整内容

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是个什么东东?) G0 X3 [: Y2 u$ I) j
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 s; ]* h5 t0 [7 D2 M' u
: b) d0 W: n- b7 kAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 B% N' d  D4 u, Z$ a

& `  V2 r! u* ]% q5 o! k4 i另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 q; \3 O/ N; n5 [2 h1 a0 Z
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 P! x/ i6 w, E, t- I/ e" ~6 t
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;3 g4 r: [; j) v  @7 B1 v/ I& Q" y# f
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 d" h; N& X# Q5 ~2 `3 l
begin P_induction arriving
1 @* C0 ?" M5 a" F1 K    clone 1 load to P_pick(A_induct)
3 Y. K1 G; B, j" Q' rend最大的系
( P3 F8 u. c' T+ O& Z" S* N
' v& o: C- H& @begin P_pick arriving
7 c  X) N% `$ k; y    set A_i to procindex * 10 + 1
: S2 S3 M) A+ \    move into Q_induct(procindex). O* M% x  T7 d& G2 H5 q
    move into pickaisle.induct(procindex)
: F# n* v" X# S! |    /*check the type of pickaisle.induct(i), for your last problem.*/
- Q2 |3 N$ z: }! Q( e8 Y2 B2 t( t: V8 ~3 s3 n% c7 v
    while A_i<=30 do begin
$ P, Y8 W8 i* C  _8 p        travel to pickaisle.con(A_i)4 r% Y; H" T8 o) f3 U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ ]+ I5 P& y# k, X2 d
        else wait for 10 sec+ K% |, U2 ], W8 s
        if A_i=A_leave then send to die3 t4 [; z  X* ~* z$ b
        else inc A_i by 1# S" A$ `- }+ q4 S  ^; \9 J
    end& C8 Z3 c8 D8 w/ u- O! W* L9 k
end1 N% M  D) N' L0 x+ L; ]: a
+ x  {: r; f2 p- \4 F. b& d
其中的procindex为整形,代表当前process的序号。- X9 O- B7 k& l  o6 ^! v1 _
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-26 19:57 , Processed in 0.015703 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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