设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14233|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, ~  m/ c! I3 S4 x' }5 [2 G% p( K

4 {; f' B0 o4 `* w7 V- S我的问题是,在每个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中的数值,不知道会不会有什么不妥。, h$ v. G4 O. q, Z
; r1 E% j" J1 i1 o
begin P_read arriving' a1 o; X0 ]9 l( G) X
    while 1=1 do begin
) b0 F1 ~+ r) S: H/ {        read A_tote from "data.txt" with delimiter "\n"
3 N( R* @3 L! p! F        read A_time from "data.txt" with delimiter "\n"
+ O9 D3 L$ f2 Q% f' i        read A_leave from "data.txt" with delimiter "\n"% d7 [& u; e" x
        read A_picks from "data.txt" with delimiter "\n"% _* M' a0 j3 X
        set load type to A_tote
7 t6 P- l* A: J: m8 R3 T# A        if A_tote="tote 1" then set A_induct to 1
! G8 v' }2 w" e5 T9 o0 ]        else if A_tote="tote 2" then set A_induct to 2
! v" g& U) n( K            else set A_induct to 3   
" @/ e6 J* ?$ i  z$ o        set A_i to 0- I# ~* @& q2 Q4 e* U
        clone 1 load to P_induction% i! d6 i0 ~, z5 ^6 i
        wait for A_time sec
$ H( c/ W: U; }; l* ?4 Y; s    end8 P9 E' I* k: _* ]6 a/ Z
end. ?; }7 m7 I+ z8 Z5 }

( q. `) ~+ i# p" \begin P_induction arriving. l" h# O* a5 o5 v5 ]
    if A_induct=1 then clone 1 load to P_pick1
* R' Y( x/ K& Q  O    else if A_induct=2 then clone 1 load to P_pick2
% g# l! O7 j. H6 K- C9 q# s        else clone 1 load to P_pick3
  `- F& r& l- a0 F5 yend2 ]8 J2 A3 H+ k) [8 d3 u
/ [3 W' @- f8 D8 b
begin P_pick1 arriving& Z; g. G. E$ D- O: b
    set A_i to 1
% f- I2 w0 u' n7 }. Q+ x& r    move into Q_induct1
9 p% q0 N0 {/ }# y4 u: O3 T5 K    move into pickaisle.induct1
5 T1 m: r  k  I0 d- w9 U4 i    while A_i<=30 do begin
) U- H/ w7 s/ d  \2 ?        travel to pickaisle.con(A_i)6 |  `! Y% T: s! ?) |2 N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' B+ m: j( U1 Z" t* w  i        else wait for 10 sec, M+ F; U: Z9 _" ^: u
        if A_i=A_leave then send to die0 I2 L  G7 f; Z3 `' l
        else inc A_i by 12 M/ H; v( ^# g6 V
    end
! [0 o+ ]" v: P9 O; W/ Xend! T) x, E4 [$ D$ l; l
' P# t" e! O; u0 \" e3 ?2 k: e% Z
begin P_pick2 arriving
( y0 U% N4 G7 O+ C# w* _- x: i    set A_i to 117 J9 T( n- L% T5 m3 o
    move into Q_induct2
3 l+ a3 m  z6 s6 l    move into pickaisle.induct2
7 ?% l7 \) g7 e1 Y. P) x/ o: v    while A_i<=30 do begin) l6 U4 r/ @+ k% B
        travel to pickaisle.con(A_i)
$ E* w9 U4 Z) U+ g" `- _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& h, W! I7 V6 ]. k1 e
        else wait for 10 sec
3 c5 h0 }1 v9 A* y        if A_i=A_leave then send to die2 r: h% z5 J) a2 X/ w
        else inc A_i by 1, B3 i! j6 q1 b+ L4 v& A+ `" D
    end
6 h9 c- j5 H+ `) d9 V% rend- W, w$ Z5 {2 K6 F6 [# {$ }

: \6 z6 }8 @9 T2 abegin P_pick3 arriving
' T" D; c$ m, F: @& e) k    set A_i to 21
6 Q, A! g( C5 |( a    move into Q_induct3
' D3 i: _" i8 a# a8 E8 ~: n& |    move into pickaisle.induct30 O3 [' y+ c' P5 d+ m9 J' z
    while A_i<=30 do begin& i0 f5 [7 Y8 n% a6 @& ]
        travel to pickaisle.con(A_i)
; i0 ]6 `- A- h* L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. s0 U3 s& j- q' B
        else wait for 10 sec) L8 i% S% \4 a  Z' a
        if A_i=A_leave then send to die8 d, w2 d8 [: C% \7 @
        else inc A_i by 18 K$ S) `0 G, N  d% Z: h+ A- I
    end: r  \8 [7 F) Q3 Z
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是个什么东东?6 g& D- j- h* f. o
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" o' A; v0 Q6 K) h* y4 b: ^" N6 q6 D2 m7 M+ x
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! T& |9 D6 v5 s0 Y; D3 d
4 c. |0 |1 t! c: _1 {" J- \另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:0 m! }' E( j- U! }4 ?/ P+ D. x
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 A2 I% V2 d0 J  T2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;- k+ H3 T5 x& ^0 d7 {
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:# \7 e9 l% G& p( M  a$ D8 P
begin P_induction arriving
' I1 c, G9 R; \    clone 1 load to P_pick(A_induct)
  `; l. H2 @8 Z3 Nend最大的系
, X3 A2 |1 B! _
5 p9 i, I: H8 j  v( j* c/ rbegin P_pick arriving
6 ~. J6 `* }$ r6 O1 N$ _: P4 }    set A_i to procindex * 10 + 12 Z  V1 c5 s' s) p$ Q& y
    move into Q_induct(procindex)
$ N+ W% W/ w+ U8 [- n! z    move into pickaisle.induct(procindex)
2 |4 f& f; V/ B1 C. |/ }3 H    /*check the type of pickaisle.induct(i), for your last problem.*/
$ z0 y& Y: y' I+ P. X2 D
% v1 G, C2 w6 Y7 n    while A_i<=30 do begin
" L% v+ c8 d8 {" H" q        travel to pickaisle.con(A_i)# h, b! o8 P* f4 t* o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* X! T4 U1 C) e1 W. E" }
        else wait for 10 sec
, Y2 U: T: A4 E' c        if A_i=A_leave then send to die2 `9 b; o" `6 y9 W$ j; b1 t
        else inc A_i by 1, x, e4 ]! c6 r# |. n& D0 S/ C
    end# T# m. g4 l. B6 P" Q: W( h. q
end, z$ q7 ~! f' ?5 e

! ]! P- z7 O9 C( ~' q其中的procindex为整形,代表当前process的序号。
# f: Q* W* @9 S- V  C4 P! ]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-6-23 08:35 , Processed in 0.015239 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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