设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12465|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 Y1 c. G1 |3 [6 {% Z
7 U2 x) B6 o/ Z* 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中的数值,不知道会不会有什么不妥。) \" T5 ]' e# x7 j2 I4 e

. [8 o. c! X1 p& p# X$ hbegin P_read arriving0 e( U- W; U9 w1 s0 R
    while 1=1 do begin
5 C9 p! |0 m- f- ^) r        read A_tote from "data.txt" with delimiter "\n"( }- E$ z) m8 V6 o% y
        read A_time from "data.txt" with delimiter "\n"
1 j; K' \% Q+ e5 d. ^& W4 H0 [; o        read A_leave from "data.txt" with delimiter "\n"
% z  ]; `$ o: ]  X9 w9 K/ u        read A_picks from "data.txt" with delimiter "\n"7 j2 @1 u8 e% H
        set load type to A_tote% h5 U$ `9 g* {& L, w! j- r
        if A_tote="tote 1" then set A_induct to 16 ~! |* n+ {. J6 p
        else if A_tote="tote 2" then set A_induct to 29 q1 h3 \  \  {
            else set A_induct to 3   
1 I/ M+ F/ G( t0 X        set A_i to 04 w* G  V, k& V  b; L0 `5 t6 }( l
        clone 1 load to P_induction
/ H/ {/ Y5 Z: D" A# ~7 b3 G, `        wait for A_time sec
% o% a; B9 E! u: H9 w! w    end( z1 c$ Z  t% B3 X9 X& W- }9 s
end
9 S1 `- h- s! F9 O, m2 g6 \. s$ M4 d
begin P_induction arriving4 H; P% {3 J, H, I, ]
    if A_induct=1 then clone 1 load to P_pick13 C, O$ B/ l' k- u* x
    else if A_induct=2 then clone 1 load to P_pick2
  \0 T* H  t5 s$ b! R  f5 O+ [( o        else clone 1 load to P_pick3
2 a8 k7 C( x* W6 |, J9 eend
7 f0 O1 b: G* a8 d/ B" x
3 e' d4 T4 s4 b! C+ Ybegin P_pick1 arriving
8 O) M% ]0 U" [! |    set A_i to 1
* Z9 E5 }9 n5 F    move into Q_induct1
" U& o) E4 L) z+ Y2 l    move into pickaisle.induct1" `/ X3 r* V7 F% ^, F
    while A_i<=30 do begin7 {" f7 B0 u/ I
        travel to pickaisle.con(A_i), L! ~: o5 d6 Y  i2 e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% S+ v8 y" J0 `2 q6 d
        else wait for 10 sec6 |7 _* i/ t# b* y. }$ V1 G
        if A_i=A_leave then send to die& f( i; N# q, j' W, Z9 D) {1 s: @
        else inc A_i by 1
# N' T. U7 K, s$ m+ E, q3 N2 U% x    end
; `& h! U0 m2 k* t: hend
- w1 v% q9 A4 K5 s% c
( y+ X) n4 |( ?2 N" abegin P_pick2 arriving
6 Z( y2 b2 V/ o+ l4 f    set A_i to 11
$ E5 o! Z, |$ L    move into Q_induct26 _' X# S# M  f* s6 w" l- Y
    move into pickaisle.induct2, k# }8 S( Y2 H& i, g0 |$ n
    while A_i<=30 do begin
5 B! _/ [% y% h- x6 m        travel to pickaisle.con(A_i)$ c( I6 J. l* Z; [1 d5 Z! V& @- n% r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' Q1 s+ \( u+ \  p' m) u. r% a' R
        else wait for 10 sec
3 o  v4 K* N1 h; o        if A_i=A_leave then send to die" Y' |0 J* O0 B2 L
        else inc A_i by 1
1 I$ B. b" X7 z. f    end
: O8 L/ ?7 E! _; L) j8 d5 Aend
% ?8 h. v3 W7 r# F7 D% K  D
- E2 U- c6 a% G% ^. a& F6 bbegin P_pick3 arriving) e  w* B8 O) X3 v2 u- }# |' M4 J
    set A_i to 21
: D# j( ^% F2 L3 g6 X' N# }( Q  o    move into Q_induct3
7 m* @1 _9 P* X" b2 ^" M: D    move into pickaisle.induct3
) y) u. a$ z% z6 C% @    while A_i<=30 do begin5 B! U# N8 P( K9 v( O' D( t
        travel to pickaisle.con(A_i)
6 F& ]6 i8 v6 @. D4 Q8 Y' m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% l8 p2 Y' z* W  h        else wait for 10 sec
. R, i' Z6 Z' V  }        if A_i=A_leave then send to die
+ r( }4 R8 c. J2 d1 S        else inc A_i by 1  ]6 K5 ~2 I. ~1 F" n* L
    end5 S- |/ [' U) v9 N, E; H
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是个什么东东?
5 O8 u/ C5 z# j3 K* P, Umove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
3 f* Y/ y: J" X& ?, t2 Y- X, B8 r2 U8 J$ Q4 E
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& V3 I( }9 p& u" J* Y
2 {- v! f, R" N" ]/ d, h& d另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
: ~' }; G! s7 ?$ i* z1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' F6 u* N: O9 E9 t( `
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
# }* G+ N) @2 K" `: q+ u, U3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) X4 C0 a& Z# J" I. n7 F; z
begin P_induction arriving0 ~7 Y$ g5 g* ~
    clone 1 load to P_pick(A_induct)
9 [& w; n* X6 d9 O2 u; i- S, Yend最大的系
( P0 S# g0 R1 S  C! H7 F9 h2 D
9 a7 z4 B# N# q$ Ebegin P_pick arriving
* m1 D1 |7 ]4 Y9 s" L/ t. U+ \) F    set A_i to procindex * 10 + 1  i  d. d3 J9 B
    move into Q_induct(procindex)
1 {  x2 S" B. t    move into pickaisle.induct(procindex), t5 Y5 I2 U- _( s
    /*check the type of pickaisle.induct(i), for your last problem.*/" l% \+ o5 R! a9 |9 n+ S

% |$ b. |& r0 K% m. I: A' s' ?    while A_i<=30 do begin( g$ f8 \. u0 Q! \# _8 D
        travel to pickaisle.con(A_i)/ n4 O* \. m7 B% `  k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( I/ n% K2 b! x: ?" A% z6 v9 {        else wait for 10 sec4 L& v# H9 v6 e* B: t, m( Y0 [- M6 c
        if A_i=A_leave then send to die% G( ^: U% z" u! n
        else inc A_i by 16 u! P, W4 y' `: r) ~. q
    end
6 e8 K. W! }5 V/ {+ d( Yend, J# X: f4 K, w! T. J

0 D; p3 ~. J+ @9 o' x/ I+ X其中的procindex为整形,代表当前process的序号。- ~' E1 b. ?2 d% ^/ }; @/ x  J& }
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-1-26 10:29 , Processed in 0.015762 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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