设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13254|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 _4 t' I& B7 v7 b+ Z0 @7 v6 Z4 V* W4 n& r
我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 A. R2 L8 c  T
; u- U. \9 ]0 I, H/ s' O+ P  b0 P
begin P_read arriving0 F  x! X& d9 b+ f. d
    while 1=1 do begin
& R3 @8 u. a( h* F# c        read A_tote from "data.txt" with delimiter "\n"7 c4 D2 @+ @" k! W, d& h2 j
        read A_time from "data.txt" with delimiter "\n"
0 {  t" \; Q( n+ t        read A_leave from "data.txt" with delimiter "\n"
" P& ^9 `6 O) F) \% B. o( n* F* A        read A_picks from "data.txt" with delimiter "\n"" i7 C5 C9 c% ~; b8 }  I- \
        set load type to A_tote
6 r" I! ?2 H+ r) g* s8 f        if A_tote="tote 1" then set A_induct to 1
  f3 Q& l) E  W! |) W        else if A_tote="tote 2" then set A_induct to 2
; p$ ]: N& J- U2 ?            else set A_induct to 3   
7 L$ F& J6 N4 P, T        set A_i to 0
& P0 T- D) u  X' i        clone 1 load to P_induction% p, B9 m  m+ e# J* U
        wait for A_time sec
- s5 F) ?7 k. J$ B$ h$ L) W    end! M2 V6 G4 `0 D- ?' r
end
" d0 H' |1 A8 L- l  }3 ]
$ }: o8 ?5 p4 s3 |# ]  {  d* Gbegin P_induction arriving
5 I8 K8 z$ P/ l& R0 r! T    if A_induct=1 then clone 1 load to P_pick1; y5 K4 a# G/ F) Z# v- `* ?; k
    else if A_induct=2 then clone 1 load to P_pick2
3 D. |9 M9 L3 j3 y: O3 I; Y/ m, B        else clone 1 load to P_pick3# H, h$ M( W9 t+ K; r5 h" V: F% e
end
; R1 K/ p+ W- j
- i/ s9 ]+ @8 S) t& dbegin P_pick1 arriving) }$ R7 S1 I6 C2 o; g, T$ R
    set A_i to 1& M: \' g/ t& _; V" Y
    move into Q_induct1
4 Z8 h) e2 s$ A& a, u4 f1 O+ I    move into pickaisle.induct1
7 \3 G  V( I4 h3 k    while A_i<=30 do begin
4 \/ x& D0 [2 ~  g  f3 p5 u        travel to pickaisle.con(A_i)9 {5 ^9 I  n% g: X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. M0 ]9 ?. {" D" x* V6 V1 g9 k3 d        else wait for 10 sec
# ?0 ], @: b1 u2 m# m; h        if A_i=A_leave then send to die. v: ]. f. M. H4 A  W" v( c6 Q
        else inc A_i by 1
; x7 a1 V/ w; m. E4 [    end% B  O" E7 J; C0 Q5 P* m8 S; x. b
end- s9 `/ U3 A% _# `' U
' Q. H( s8 w! o4 J+ T
begin P_pick2 arriving1 Z& i8 Y5 a3 W: g9 O
    set A_i to 11
& z' n& p6 p' g9 G5 J    move into Q_induct2
! E" f2 e, c+ Y- b" a) G    move into pickaisle.induct2
; z0 e6 Q- L; _: c) e    while A_i<=30 do begin) o5 N7 g# x: `
        travel to pickaisle.con(A_i)
/ d  |  i# p) ]: M/ k2 x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. r" L) T6 a: ~) B+ d+ A        else wait for 10 sec
+ z# E. K. u6 V% D        if A_i=A_leave then send to die
  z/ |% S4 S8 c  _" D( t! m        else inc A_i by 1, l2 c' @: Y6 |; L! c. z
    end
9 s/ b7 X) c* H4 pend" s! Y1 S7 P6 g5 y3 M6 ]8 {

( L% t% T3 m3 n9 v  jbegin P_pick3 arriving
9 `- v# F% U6 |8 S. B% `( U    set A_i to 21
' p) @7 x0 }" o- p# U. |+ [    move into Q_induct3
5 R% p4 x9 P- D/ z% K9 i    move into pickaisle.induct3" K/ t( l' p9 s5 Z- Q
    while A_i<=30 do begin
' [$ h2 \/ L5 H+ R- p* i% I- Y, K3 ~5 h% f        travel to pickaisle.con(A_i)2 j" a; n/ N7 _; `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 Y  L2 H- {5 E' w, f- L: C
        else wait for 10 sec
. \! N2 q  r$ L5 g  [1 K/ k/ }8 j9 e        if A_i=A_leave then send to die. z+ N. _! `6 U4 s( L
        else inc A_i by 1' I; O" m! y* X- L
    end
3 U2 F6 ~' I2 M! qend

最佳答案

查看完整内容

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 z8 `) J2 I& l! Z' j. _2 ]
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 ^' A$ f4 J: P
; q+ ?, A" ^; G% Q
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* k, M5 P; |  j4 }0 L2 T. k- g. t# l* M
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 V9 V6 b% _; G2 w: x9 D
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;: H7 C" t+ V- f2 E0 l+ r' {
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ K# x9 c4 _( X; g3 r1 B+ r/ k3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
4 @" H( B9 b4 H( A# Bbegin P_induction arriving
! Q& g5 W) k  O. G    clone 1 load to P_pick(A_induct)
# c1 |6 G4 |, N7 z( }( Rend最大的系; M$ S9 j6 E' _: ]7 J

5 w+ y' B5 }8 g2 W4 d5 U; abegin P_pick arriving
) M/ |5 Q" d0 h' Z  b, p    set A_i to procindex * 10 + 1: b$ Z- q; k- p3 i
    move into Q_induct(procindex)
7 F/ v5 l# J1 v4 s6 `7 q    move into pickaisle.induct(procindex)
, r" n! V* K( d7 z% v0 s    /*check the type of pickaisle.induct(i), for your last problem.*/0 V  S  d# D  {" e

3 ~8 n/ m( z+ I    while A_i<=30 do begin. K2 {% w% i- t/ ]. x! t4 [, K- Y3 g
        travel to pickaisle.con(A_i)
! ]; X4 Q3 n( L- Y- h. ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 Y8 @# r" @* u  ^+ k; ~( C3 ^) Y
        else wait for 10 sec
, n( J. F, {" u9 Z# i/ u0 |; A        if A_i=A_leave then send to die( }) }, L% Z  R8 R% D
        else inc A_i by 1
2 z1 G; w) F; W+ N    end
( x# E' ?1 X3 D7 [4 lend
( b, @; N. T8 A: g' I
4 D$ x3 u8 B5 _! s6 g/ c5 O% P其中的procindex为整形,代表当前process的序号。! v; P7 {. p0 _  }' H& E1 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-3-30 14:35 , Processed in 0.021926 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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