设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13622|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" `* z# [% L4 K" h1 J4 U( A

/ X: K, i8 G) F* g8 Q我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ e  z6 R  k. S5 j5 X8 P: D1 m. `9 A* f: j. @5 O
begin P_read arriving4 U1 \# i) `% l+ C' M1 A3 R- Q, w8 y
    while 1=1 do begin
' m$ {8 Z* a8 H7 K. a' ?; O+ c) Q        read A_tote from "data.txt" with delimiter "\n"  L' J: G, o  @* D+ M- ?5 y
        read A_time from "data.txt" with delimiter "\n"( Z5 |( y% k* }, q
        read A_leave from "data.txt" with delimiter "\n": M4 `: U; [$ z5 L3 ^8 p
        read A_picks from "data.txt" with delimiter "\n"
* c' M1 N( \0 c7 E) h3 O5 j        set load type to A_tote, y- |( g2 _0 N/ b! W+ U/ k4 {
        if A_tote="tote 1" then set A_induct to 13 t8 g) b4 g$ p# N( N
        else if A_tote="tote 2" then set A_induct to 2
% P5 f% K9 G; q4 V' S) w9 Y            else set A_induct to 3   
! A9 ^% P+ x* V. P" t        set A_i to 0
6 \% ~9 C! b, ^  {5 R: L8 h, P        clone 1 load to P_induction
/ \  X. K9 R# V5 B$ v# P( {5 U  |- L        wait for A_time sec
6 c- T2 ^) q7 g% H4 @  z+ P    end
6 F+ D7 L! m. aend- G/ r1 X3 W& C
# d9 t* P5 n( t$ W
begin P_induction arriving
0 g3 `* L+ f! O    if A_induct=1 then clone 1 load to P_pick1" j+ `6 J- T( x
    else if A_induct=2 then clone 1 load to P_pick2( o* g; Z: j$ C% q; a+ D
        else clone 1 load to P_pick3
; X# Z6 _2 h3 I: Aend
( x5 c: p4 ]9 b* g- z% N! G- z; W- h# T* C
begin P_pick1 arriving
- @# T" u! ?9 ?9 f    set A_i to 1
" K6 ]- v, k3 h5 P    move into Q_induct1
/ {- n! q. D1 K/ L    move into pickaisle.induct1
) O' j6 o  Q) Q, |    while A_i<=30 do begin! C0 V- O- O5 @' `" ]& n4 Q8 ?
        travel to pickaisle.con(A_i)
2 D! v( k% u5 W9 U; u% a, K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& r# O2 h9 s1 ?" h1 V8 F+ M        else wait for 10 sec; P7 W; B) h3 J) B2 _
        if A_i=A_leave then send to die4 X3 Q6 g8 ?1 H9 b1 s
        else inc A_i by 1& u" \1 u. {7 |4 ~7 E
    end
: e, z" X4 e4 tend6 |& N% {2 _$ i. P
, c' |' x! T9 Z/ r
begin P_pick2 arriving
" H& C8 _! R' k) v    set A_i to 11, Y, x( u. d/ T/ Z2 y
    move into Q_induct2
$ ~( A$ ?/ C% {# L1 S    move into pickaisle.induct2
/ o4 O% J# K2 W5 q, A. f$ \& C    while A_i<=30 do begin
! M& k" V  a5 \; I        travel to pickaisle.con(A_i)4 B" g  d0 [& H1 [# s4 Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ k9 P1 Z2 Z7 P9 m; O7 F' D  f        else wait for 10 sec; P: `; A2 O- A( A+ F- l6 v
        if A_i=A_leave then send to die
2 I% J3 x5 W& x# j8 Q7 i( u- S        else inc A_i by 1; B. C2 A, n- s% C
    end8 k# h) G2 h7 d. _( k
end) y7 h# L4 ]1 m5 h4 G5 I3 p

, u! e. @5 }3 a" k( qbegin P_pick3 arriving
4 y  I: W. x0 \    set A_i to 21) O9 L" p; H  Q, i+ ~. u( p) t5 S- w- ^
    move into Q_induct3& \0 z* z+ I" d; Z1 r9 @
    move into pickaisle.induct3/ |" B0 m; Q5 H, {4 v7 k0 |
    while A_i<=30 do begin
9 p% G; o0 E/ O        travel to pickaisle.con(A_i)
' V5 S( y- s1 Y" a" L7 q4 u- j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; C* _2 p6 L7 S" f; P5 R- c
        else wait for 10 sec
. J/ j; U3 w, \1 X/ M, I  j        if A_i=A_leave then send to die
( y2 ~. i% S6 Q! o% |9 \+ o' ]% _, s  |        else inc A_i by 1
" A. F* {# R8 r) X& T" \3 z# X5 U    end
2 `/ d3 P4 a7 M% `5 @; Tend

最佳答案

查看完整内容

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是个什么东东?) q% Z1 n6 H& M1 \& P+ i& T
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  r7 e: S: b- L/ {% W
) G6 H) B8 x0 K0 H1 e: bAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) `  U! y1 _, g, f

6 [! T" T# G  g) v* C另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:0 o. F" L7 b# o( y! i9 ~
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
0 [; X; K& W+ ~, x) T8 o, ~3 x2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) N2 ~8 {- J0 y2 Z
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:# p. ^: p0 E" L- E. e$ u3 M
begin P_induction arriving# E/ e: H! q5 U( ^, {/ q
    clone 1 load to P_pick(A_induct)" i8 {- _) ^5 C7 e
end最大的系0 @: I+ g8 m) f8 ~5 Y6 [4 a) ~. t
' I! [( J3 j8 \6 H$ V  q6 X
begin P_pick arriving, L9 }! _) U/ w0 A
    set A_i to procindex * 10 + 13 f! t6 }: t6 N6 Q7 e0 P
    move into Q_induct(procindex): \& h/ ~+ C" |+ Q
    move into pickaisle.induct(procindex)4 C# Q) p6 S' V' ~
    /*check the type of pickaisle.induct(i), for your last problem.*/
6 `+ P& n- a1 z) y% m
. h1 \6 X0 |5 ^! E: ~, C: b" ^5 R    while A_i<=30 do begin2 x, g1 M  X, g& n0 h2 [
        travel to pickaisle.con(A_i); ^0 C7 F, o8 P0 [+ B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  i! c% I0 c% u( B' E, r
        else wait for 10 sec
, r, L$ Z) O( H3 K- g        if A_i=A_leave then send to die0 j2 x# [4 o5 h7 L
        else inc A_i by 1
6 F4 h0 ~$ l/ q6 L    end4 R* O# K/ d6 y6 T* d/ ]. }* {
end' o; Q$ H3 c. f

/ z' K- E6 N* \: t& H其中的procindex为整形,代表当前process的序号。8 S( C( x* x* C4 a4 E
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-4-24 19:06 , Processed in 0.018388 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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