设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15433|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 V! C: d4 Y7 m0 }$ k% g6 \* ~0 J! w; E
我的问题是,在每个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中的数值,不知道会不会有什么不妥。0 P- V  F0 D2 a% Y- D! m# T

+ b' j9 V9 w& Nbegin P_read arriving
+ t: f6 r+ l: K% @9 i1 t    while 1=1 do begin5 I* t6 S5 W" a3 G) ]
        read A_tote from "data.txt" with delimiter "\n"
; W- F& ~) u& ?) G0 m9 X  u        read A_time from "data.txt" with delimiter "\n"! c5 r& x$ D! D
        read A_leave from "data.txt" with delimiter "\n"
  w- {; m  k1 l; Z( D- s  i        read A_picks from "data.txt" with delimiter "\n"" r% W4 Y- s, U8 E9 g2 R% m# k* m
        set load type to A_tote' S% B7 L& c- ^/ q
        if A_tote="tote 1" then set A_induct to 12 h( j5 Z1 i* n9 r* c
        else if A_tote="tote 2" then set A_induct to 22 u0 r' D. _2 {/ @
            else set A_induct to 3   
! X7 r. j% S* B+ R2 B        set A_i to 09 w# }& y  ?. K
        clone 1 load to P_induction" _# k% ~+ ], a. O. y6 I# o# F
        wait for A_time sec1 S  I* y' \* W
    end
! I" a2 k, Z4 @9 i) U# d4 L8 _5 vend
1 J% f/ ?" S6 `& f2 `
7 V5 N* D. z1 P+ d$ f  Z2 ?begin P_induction arriving" T/ P! z6 F, ?0 F$ T
    if A_induct=1 then clone 1 load to P_pick13 h1 s8 B9 e& Q+ C' p& H
    else if A_induct=2 then clone 1 load to P_pick2/ P3 X1 H  A5 \( E- _# G5 v
        else clone 1 load to P_pick3
. o8 U9 X+ e( v# V- tend
$ {0 {; X5 j' W* p- E
" _3 L) w2 F0 r8 ~4 @- Nbegin P_pick1 arriving
- V5 f4 x) `% j, \; O0 j    set A_i to 1* n/ S2 J1 ^0 n
    move into Q_induct1
+ {2 x* E* f/ ^: O, F- v+ R9 T    move into pickaisle.induct1
# k5 d6 m. N; [4 h/ A  @; z/ L$ g    while A_i<=30 do begin3 h2 }+ m2 v+ y
        travel to pickaisle.con(A_i)% F2 y- G2 X9 h5 y% c8 y1 ?# _8 i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! B4 I. v4 z/ |8 R: ?8 l( N
        else wait for 10 sec% a; I8 [8 L% ?+ Y0 i3 t4 f! m: W
        if A_i=A_leave then send to die
$ N" f% [0 f- S0 U6 z        else inc A_i by 1
+ _' C4 i5 k1 D3 m    end/ J2 ^; `; N% ?2 n' T. t
end3 q0 k0 d8 m! M4 ]* f' i

7 D6 x: r7 l- M1 Jbegin P_pick2 arriving/ ^) k! R5 J8 G$ }
    set A_i to 11
4 \0 D$ T) l  G8 K9 Y% t- Q    move into Q_induct2
3 W. E8 _- x7 y: x+ X, a    move into pickaisle.induct2
! X( Z. f9 U7 L4 A; E# C& ?    while A_i<=30 do begin2 G- l0 L2 e" ^8 A
        travel to pickaisle.con(A_i)
, L3 V# n+ r; N7 R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 S, G8 D: D! }8 R1 }3 A3 I: e1 p        else wait for 10 sec
3 F% ?9 {& |1 |- r1 t        if A_i=A_leave then send to die
# p" L' k. x- v* \6 i        else inc A_i by 1: w- Y1 C! L  U# b8 }. s
    end
- M( u, G% l4 c7 Z: s) u$ Gend: @4 L5 J, \/ a# a8 B! a0 U. s, Y

& ]6 \5 Y) J- |( U% ~% ~. P6 pbegin P_pick3 arriving
7 B! a  b+ t. V" m; o    set A_i to 21
  o* V9 T" O  G" W8 X9 g    move into Q_induct3/ I2 r0 Q1 b) p/ ^. U' ^
    move into pickaisle.induct3
1 w6 f' k2 X1 Q    while A_i<=30 do begin
' w& r( G' `( E        travel to pickaisle.con(A_i)8 f6 m/ w3 k( F# }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 {6 e& t6 z& c! q1 }
        else wait for 10 sec
  Z' g) i+ H" a4 k. r! C        if A_i=A_leave then send to die+ [; r2 r/ |( u
        else inc A_i by 1' o0 ~/ H( M: u: S( y, A( z4 Q* s
    end: H1 V1 R" P7 U, _% h( q
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是个什么东东?2 g6 ^9 w! _2 z5 q& B
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?) J" O- i5 C! {* Q+ v3 D* [
% u& i7 g9 a' U/ x7 J* m
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 H9 N2 f, Z. \* M$ w; B5 {

  K$ E& {2 G  s$ j! |0 ?4 K0 p另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 h( s( z- Q( z3 V" e
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;( w5 Q: w" |/ ]3 E7 A, J) v
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 `  y% @+ k' B8 }
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:: P: R5 C4 O2 v/ U
begin P_induction arriving
* B, Y2 `" L8 |9 u    clone 1 load to P_pick(A_induct)
/ G  B( V5 G/ H9 M) ^5 o; dend最大的系
, |7 u4 E1 d: E& Z3 b: \
8 `2 m, g! Q. e: C1 S3 ybegin P_pick arriving3 j9 p# W8 H$ F9 d8 z" V% `, [% i
    set A_i to procindex * 10 + 1. h: V8 U) {1 D9 \+ b+ W" O/ o
    move into Q_induct(procindex)5 m. d- ^0 W3 ^& f7 w$ r! T' V8 |
    move into pickaisle.induct(procindex)
* F+ Q- }! y2 }    /*check the type of pickaisle.induct(i), for your last problem.*/) C3 e1 \1 x' t" f: c/ a% f

: \0 C0 r+ j; g$ u4 C2 y. @    while A_i<=30 do begin, T5 \) t4 ^8 L9 m8 V4 j
        travel to pickaisle.con(A_i)
% o" \, ?- i+ w/ |/ S; `& |: ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! ?  H9 ]9 t6 {        else wait for 10 sec
, i2 f( D9 m7 U$ z+ W' T; @) |0 Q        if A_i=A_leave then send to die
+ J8 o- I9 C/ u        else inc A_i by 1
7 g- S/ j* O) p( ?& ?7 C- x. s    end
: S/ c7 A% }1 t* {end0 V# P6 p8 u8 |& g+ X) S5 J
9 z* b, U% Y8 D4 B0 T
其中的procindex为整形,代表当前process的序号。, n" \7 ~5 P' H
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-9-10 18:34 , Processed in 0.015193 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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