设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12756|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ q$ V3 ~( B7 d

/ }- K7 L* M# V我的问题是,在每个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  ^" k2 d: k) ]

. ^8 u7 W, y+ r& V7 Cbegin P_read arriving
% X% b/ i7 `& @7 K4 ?: ~( O6 m; i8 [    while 1=1 do begin6 |# [% L# L- k7 P. }) ^+ L
        read A_tote from "data.txt" with delimiter "\n"
- w* M  j, U; T5 i1 c        read A_time from "data.txt" with delimiter "\n"5 y7 Y4 G7 x7 k
        read A_leave from "data.txt" with delimiter "\n"
4 @( V$ x' p( Z3 D& K        read A_picks from "data.txt" with delimiter "\n"
+ B1 z3 f1 m! s" y; {        set load type to A_tote9 I: Z4 H0 R" ]0 S: ?; X' O
        if A_tote="tote 1" then set A_induct to 19 q1 ]& U8 `  O+ ?6 l! _. P, N
        else if A_tote="tote 2" then set A_induct to 2
: b1 p0 J/ c( v( q2 f            else set A_induct to 3   
0 t1 g* X# r# N. T! J        set A_i to 06 M0 \" A0 l5 `/ p; `# `, L
        clone 1 load to P_induction8 [0 D' S, h" m0 x5 J& c
        wait for A_time sec/ M8 U, g( N1 z0 \! `' r% {% D& V
    end
$ P% U& K8 a( cend  ~" z# J* y7 B$ I4 ?

5 m2 z" }" b1 z$ N- R6 w$ ^begin P_induction arriving* {4 k/ A2 u( s: `; z
    if A_induct=1 then clone 1 load to P_pick1
# \: n' F: q! U9 H0 }7 D    else if A_induct=2 then clone 1 load to P_pick2
0 V( a/ ~; @' g' H1 |* k        else clone 1 load to P_pick3
* H9 B$ N* u7 i; w( f+ _5 {end+ V) c+ `+ m" g( z. C. u

, |! {* Q& o$ h0 O# |' w5 |. Sbegin P_pick1 arriving/ \& i+ b  W. u4 k; N
    set A_i to 12 a, {8 O& f, U
    move into Q_induct1. B: ^7 V$ p& d2 W
    move into pickaisle.induct1
5 m. q, j* Y) L' |% H/ ~    while A_i<=30 do begin5 J9 H& z* O# K
        travel to pickaisle.con(A_i)
7 m' ]) U- _; i8 b) u# |2 k' E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. x  n+ X* F8 ^8 H1 c
        else wait for 10 sec
) _& }, ^0 h3 O, @' Z4 x; x8 u- J        if A_i=A_leave then send to die
) |# L2 V+ ^$ {' U* a! i# T* L        else inc A_i by 1
! A5 l4 L# @( y8 \  e8 k- k9 M    end$ v  t3 K# j" g: t
end! A0 V( P& ]  H
- Z% \- n2 Z/ e6 k
begin P_pick2 arriving
) T/ d3 x, j9 |3 f: l    set A_i to 11  B5 J6 D. Q8 G/ U
    move into Q_induct2& V9 O3 i1 |, p
    move into pickaisle.induct2& \5 J8 k2 A% X
    while A_i<=30 do begin4 F, Y( _% Z3 U, N
        travel to pickaisle.con(A_i)9 j0 a' B$ u0 D1 e+ X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 R# o* |8 I9 p5 P  `0 r
        else wait for 10 sec
  A* a: s" L: ~        if A_i=A_leave then send to die  \7 e1 ^# x; A
        else inc A_i by 1
+ N- U8 W3 j9 M& Y9 K    end  V. D+ I) B3 K) ?5 N' f0 n
end6 s+ ^8 K% u1 R$ z' Y0 k4 X

# E# O' R& p0 w4 X; gbegin P_pick3 arriving
! u2 t* I0 @: W    set A_i to 21( w! ^3 a) _8 n" V, E
    move into Q_induct3
* ]6 _7 ?0 {; f5 Q7 h    move into pickaisle.induct3
& U( S/ h! d: U) z$ n& `    while A_i<=30 do begin
6 a$ |& s0 T4 d; C8 ~" P! X4 t        travel to pickaisle.con(A_i)- N) P7 n- E6 T# P4 X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" F: |* M9 J3 G1 l1 ~        else wait for 10 sec$ _3 n4 f& g+ B$ R7 x
        if A_i=A_leave then send to die- x6 M9 O) r; U+ o, S' J( v
        else inc A_i by 1, p8 ?- |8 K9 _, w# [/ A
    end) l  ?  J9 ^7 {4 y# S2 }
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是个什么东东?8 ^( p, ~/ |9 B6 d6 u; r$ `
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?% T* P  e5 U. ^  ^; s
+ D5 f& g' s/ @4 \1 I0 n
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 t* ^8 O* n% `' d  R% A

0 m! h6 U3 u, f- D! K) A, Q2 l; @0 A另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, N% R$ w% p# q9 @3 R/ N1 `7 H
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 U8 S( n5 J+ p; P5 n( S2 w+ ^
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
* ?" g! J$ n4 ^0 B7 q/ }% {+ O! p3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:! p7 I/ g0 r. l- u$ c. T8 O  I
begin P_induction arriving5 P$ ~# e7 n, n4 q
    clone 1 load to P_pick(A_induct)
8 _0 B; I/ ?$ W& eend最大的系
! b! ~3 y$ b  I( }
. I# v9 R9 ]5 i! Z1 fbegin P_pick arriving
% Z) @, {" T8 b. s, Q% a# I    set A_i to procindex * 10 + 1
9 a) t4 c4 p. }$ N% j    move into Q_induct(procindex)
) ]# _) l$ v: J6 E( C  T    move into pickaisle.induct(procindex)
/ T, [/ |/ Y  M+ s) s) E+ _6 p    /*check the type of pickaisle.induct(i), for your last problem.*/4 y6 M/ ?4 Y: {/ |  n
: z% o9 m% t& A/ t
    while A_i<=30 do begin
) `9 R) s5 Y( J2 Z' @( \        travel to pickaisle.con(A_i)4 l/ t; D  i: f: y1 \5 [; I0 q2 s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, f: ^2 t7 K! W1 x% e1 i
        else wait for 10 sec( F- Q* C+ c& X% W
        if A_i=A_leave then send to die! H& S* G' E3 @# K% G; G7 L
        else inc A_i by 14 E" \# m  r- q3 [  Y1 G, A' Y5 c* _
    end
% Y% p6 b$ Q8 d! U* @end
, U, K1 o# S7 w* l6 P
# ]$ @) \! C2 T5 L, r4 X% O$ T. s其中的procindex为整形,代表当前process的序号。: h( C5 U2 N" Q
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-2-18 00:09 , Processed in 0.016525 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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