设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14994|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 u# Z9 V1 u3 x* c

0 S; h6 f2 n5 n3 @. o; f! w我的问题是,在每个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中的数值,不知道会不会有什么不妥。( _- Q( \+ ~. ]# A. y# y
0 u- K6 K1 t0 s
begin P_read arriving5 _7 m; W6 r. Q5 n( J9 a( v
    while 1=1 do begin
& v: R, [# X  p4 ]        read A_tote from "data.txt" with delimiter "\n"* K. T# h- C; G, F2 R+ }# M
        read A_time from "data.txt" with delimiter "\n"6 m& @$ O9 l0 W# Z3 Z' P
        read A_leave from "data.txt" with delimiter "\n"7 b% x- h& y. L; w
        read A_picks from "data.txt" with delimiter "\n"9 [) @) }" @' u& l& r1 w# Y
        set load type to A_tote
; g. l0 ~' U9 H8 D5 F        if A_tote="tote 1" then set A_induct to 1
! m1 m, z) Y- Q        else if A_tote="tote 2" then set A_induct to 2
( a( }9 E" O9 B2 d1 x9 j- x+ g. x) X, m( x            else set A_induct to 3    3 c$ b! }- O4 w: {$ F$ y6 b* ^
        set A_i to 0' [) t3 d) l4 O0 X- A' M1 {# ?
        clone 1 load to P_induction4 g' t$ C, ~  t( ~+ D& G
        wait for A_time sec
7 s* p- ?- h3 O" f# u    end: g0 ]; s9 X4 ~8 a  c# B; E1 \
end
& L" D' E+ G# T7 L: N; X8 F( h' R) _+ }. |
begin P_induction arriving
7 o3 n, m5 x) Y4 ~    if A_induct=1 then clone 1 load to P_pick1% g8 H$ [& s  B
    else if A_induct=2 then clone 1 load to P_pick2
. r7 D2 q' ^- A* e, H/ {, e5 ?        else clone 1 load to P_pick34 y! W3 I0 \2 ]$ D8 o' f( ?' c+ Z
end4 z- _% Z. \+ N9 m

' U' l4 [# W& |begin P_pick1 arriving' d9 H; A: I& X3 r
    set A_i to 1: q9 @7 D) g) q4 [$ i
    move into Q_induct16 T: |; L; G+ l
    move into pickaisle.induct1
6 K- \2 J- D6 W6 n    while A_i<=30 do begin
. u- Q: B9 U7 m: Q8 n0 F, {% |7 B9 p        travel to pickaisle.con(A_i)1 j  ~+ p2 L7 L0 e) J/ |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! a( M/ h9 x4 R
        else wait for 10 sec$ f; D" |+ w+ D& Z: X
        if A_i=A_leave then send to die, k$ a9 n  G, O5 T
        else inc A_i by 1( ~/ E) ~2 L, \) w! N) \4 R# G2 d
    end
9 Y2 M; g0 j$ k/ o) G. rend
6 ~$ n: a+ {  p7 i, z6 x
" j5 z7 A; v" W, O% I& P% Fbegin P_pick2 arriving8 z* F# Z2 X9 _; Y; }' P2 I8 C6 X
    set A_i to 11
. Y+ a6 Q5 k) H6 N1 U+ ^    move into Q_induct2
7 ?8 n. g2 R6 g0 K6 D    move into pickaisle.induct2' K" j( R. ~  F4 z' _* r' e
    while A_i<=30 do begin% J1 c  w: v  E% H
        travel to pickaisle.con(A_i)
$ z- @* a. E1 O  O9 [8 b) o& M9 F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 z' m% p# P+ E' J* [& V        else wait for 10 sec
3 Q% F* ^( V, n1 d3 Z7 v8 G        if A_i=A_leave then send to die  M6 z  t5 y  u2 M
        else inc A_i by 1
' N% V9 ]" B7 u6 O/ W* h( p    end
& Z# e2 n1 M# L7 Kend
; i: ~! L+ p1 x  v% [' C8 ^, G$ N% s, Q  K" c( s
begin P_pick3 arriving
/ l+ L! H- \3 r# q/ }    set A_i to 21
. }6 B2 [$ I. i1 Y, G8 @    move into Q_induct39 d+ E4 f: _& ]" _+ a! y" O
    move into pickaisle.induct34 J5 k/ G9 X  |4 P! \) H
    while A_i<=30 do begin/ o% k9 f( v' Y
        travel to pickaisle.con(A_i)
, a- w  U8 @5 j2 }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 g' _8 s3 x. y/ r% V" N
        else wait for 10 sec
6 p% E" e) B" Q        if A_i=A_leave then send to die' [1 A8 z0 D# P& F
        else inc A_i by 1
4 f" A% X8 d" V+ Y    end) ^8 g: K6 d9 _; ~
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是个什么东东?
" U- {' K( U- Q" }( ymove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" R1 b  X1 w( B# D- k7 e0 W9 b, Z0 ]8 v) |
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 f" d6 F2 k, @( d* m. X
7 m" s" c  e  E" ~0 b# x
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- H% r. K! r: q- ~! I! W) P1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;1 o& G1 {8 [. ^7 x( P
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
& _5 t9 V& ?+ i* D6 q3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, r! U& w9 D8 q
begin P_induction arriving
- h8 A& b  W# S) [+ r' U    clone 1 load to P_pick(A_induct)
. h9 f2 {. `: |+ k# p; Cend最大的系8 m( n* [  x! |  H7 L- V0 Z( W
) x( G' m# d9 D+ Q- \0 H  S  |! f
begin P_pick arriving
# x& D# }7 D6 y# g8 H: K6 [1 Q6 ]    set A_i to procindex * 10 + 1' A5 _% \6 d+ c# c# O4 G
    move into Q_induct(procindex)# X- J- C* f) N$ M
    move into pickaisle.induct(procindex)0 i1 v3 L  p  D- I& J2 |* p6 q
    /*check the type of pickaisle.induct(i), for your last problem.*/
* m: q0 J* n) [0 t& z" l, C
5 t- y1 y! S* o$ o: ~! `9 M' `. Z    while A_i<=30 do begin* J3 e" c3 |: j# v  ]) L
        travel to pickaisle.con(A_i)
5 N# ~$ C- W" a! ]8 p& T. }9 y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: Q) P. K6 p1 K# L( c# Y( K        else wait for 10 sec9 S) R! f& O' x2 o- u7 A
        if A_i=A_leave then send to die. w' y; }0 U! S# D7 R) F; O- z( Z
        else inc A_i by 1
8 O& m& `  x8 F+ y& h    end8 B$ @- e: h  K$ {
end4 j$ x" F& }" ~0 Z% B* H4 M- s6 G- c

9 o) U, ^- K% ?( N: p其中的procindex为整形,代表当前process的序号。* g/ M# _1 N/ g# G+ z% r9 [9 W+ b) a: L
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-8-2 15:27 , Processed in 0.015380 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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