设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13973|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% Y7 k! R, o& _  X1 T
& `. K; l$ f5 F2 P- I2 {
我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 n* Y3 A. l6 s* H, X" ^9 h

( u% \: y: B# g" Wbegin P_read arriving: [: C& H+ W' Z; W, D
    while 1=1 do begin* a- B% Z0 M/ ~# z3 j( Q- C) d
        read A_tote from "data.txt" with delimiter "\n"% j% h8 s6 E- A. u# Q7 u+ _
        read A_time from "data.txt" with delimiter "\n"
7 ^! ]; X, c& S; i1 ?        read A_leave from "data.txt" with delimiter "\n"
+ \( y+ W" S- [# _4 D        read A_picks from "data.txt" with delimiter "\n". Y$ S0 n8 E! \6 j
        set load type to A_tote
( c) T  d- N/ S+ x7 U6 g- r        if A_tote="tote 1" then set A_induct to 1: Q! U8 s9 O; e3 M- B2 c
        else if A_tote="tote 2" then set A_induct to 2
  K, f, G2 e% F            else set A_induct to 3    3 C" ?! R) B7 M. {0 Z$ E
        set A_i to 0( Z/ n  D. Y' Q
        clone 1 load to P_induction4 O7 ~% p3 O! ^* \' X5 C
        wait for A_time sec: w' |$ o  {5 T* R# U
    end
' a" a, c  G( jend
, v0 s9 p7 B5 P+ b/ j2 N: T6 k: X7 W' m" C
begin P_induction arriving
0 S9 J. ~, m8 V    if A_induct=1 then clone 1 load to P_pick1( D7 v2 e" {+ Q- v6 d
    else if A_induct=2 then clone 1 load to P_pick2% d# S- d$ ]! l% L3 N
        else clone 1 load to P_pick3
3 E0 J7 }5 w! e5 W' j8 N% w5 lend; t- O* @  M; q) b& P6 U9 C

1 {! ]; v& d2 R0 A8 gbegin P_pick1 arriving
4 {' [: v0 ]; v+ T9 v    set A_i to 1" L9 T# D1 C; _3 I# A: O" h
    move into Q_induct15 z1 E! }. p5 O  Y: g
    move into pickaisle.induct17 G; d) q! l) x4 w- q4 J5 X7 V5 V
    while A_i<=30 do begin
# q# ^/ U/ l- O- F9 g! B        travel to pickaisle.con(A_i). M# i9 k, K2 y* H& g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ k3 Q( ?: F. o) b6 ~2 a        else wait for 10 sec& L7 h$ P6 N( ~8 B
        if A_i=A_leave then send to die0 K3 u3 G2 a. ^3 X9 k9 H& s1 J
        else inc A_i by 1% c: d  q# }- u2 L  l" E& O
    end
) N0 q: R5 s' K. [  lend
9 p. i5 C! t3 I
0 \' g0 m, z# J: qbegin P_pick2 arriving) v" G# `% E0 _
    set A_i to 11
# K/ c! L2 _1 s% l4 C, S3 f% m    move into Q_induct2
9 e1 \% I9 f% d    move into pickaisle.induct2, {6 N' ?1 i7 C5 Y
    while A_i<=30 do begin6 ^! D1 b6 m% K3 v) ^
        travel to pickaisle.con(A_i)
7 |( O. x0 N4 p4 J$ K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ ^% L; r; B5 x# A3 d& J
        else wait for 10 sec1 ~0 j: E! x+ N; j3 i
        if A_i=A_leave then send to die
6 [: \# i4 \9 R, k7 Y5 `        else inc A_i by 1% x" h- [% g8 u$ R# o
    end" l$ b5 V# t4 |$ J8 \, n& J! E
end3 M, P" x5 w4 z
( X5 z1 T. w5 f' {$ P$ Z5 b
begin P_pick3 arriving3 ]$ L) m5 \0 ~& x+ D( ~
    set A_i to 21' V# e; k3 _9 u8 C8 R
    move into Q_induct36 H3 ?( B8 A- u9 @. `# {+ d* E
    move into pickaisle.induct3
$ y0 @6 d" S6 }+ q1 ?& e    while A_i<=30 do begin
" e# f. e# ~' U# y8 r. p0 Y        travel to pickaisle.con(A_i)9 E5 T  S( u* |/ r( M1 I# w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, f* a! o, e- l" P0 e0 M/ k        else wait for 10 sec
: U4 {0 C. ?0 h0 \9 {; e0 N        if A_i=A_leave then send to die; p0 b- i4 @* i( _- k: o! Q3 j& ~
        else inc A_i by 1
& K6 L) f# x+ N: s    end6 S2 e& Z/ c* G9 `/ B
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 S7 G5 v  @6 b) g
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
7 V! _& @2 I/ Q% Y1 y  m. |! l. B! D/ W, {, b/ w( `6 d- A: D
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 g2 a0 J& {+ f* Q2 B2 z# Q2 m
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* k' {, H9 b5 W1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;8 Y3 @- ^# Y. S  r* g
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 e+ o! w# b' }3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ i% Q' b. {3 S! dbegin P_induction arriving
% G$ f( [" O/ \6 o! h. F    clone 1 load to P_pick(A_induct)
& M9 f( {2 p, Lend最大的系
9 _$ I8 Z' A3 m- g' O; k3 f$ [( U. G1 S# N) o2 t% @4 a
begin P_pick arriving9 y# d+ n8 s( P. A* V& H+ O
    set A_i to procindex * 10 + 1
% K  k# U7 C& V& d+ A* b    move into Q_induct(procindex)
6 F9 r. @- @% k! u- d    move into pickaisle.induct(procindex)
; S& s8 _$ D. B" u; M' C& l$ R5 O+ c    /*check the type of pickaisle.induct(i), for your last problem.*/
) s! D6 X/ M. H: N  ~/ X' @/ Q
" w; U- Y! U8 ]9 a& l- ]8 C9 D: A* h    while A_i<=30 do begin
6 e8 |  E2 m: E/ @+ _# T9 \/ Q        travel to pickaisle.con(A_i)
" j' f6 k. K6 {9 ^" ^$ r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- u6 ?; M. \1 x1 c; k8 `$ x1 B
        else wait for 10 sec6 |, u8 d- U& z, Z  d3 Z7 @: z
        if A_i=A_leave then send to die, h9 m6 a. J5 P  `+ y5 p1 Z
        else inc A_i by 1
$ J2 t% i! f9 g4 Z& o, x# @7 R  T; i0 z    end* g! R5 e' ~. J
end
: a0 `4 I3 v+ t$ B9 v- m  R! J: R" I
其中的procindex为整形,代表当前process的序号。9 ]% V/ U2 A  Z0 W! M% \: A6 I
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-5-26 10:00 , Processed in 0.018970 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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