设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15018|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 ^$ \! @- m) i/ `1 S5 F

: v" D) |. W9 \, H我的问题是,在每个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中的数值,不知道会不会有什么不妥。
; C1 V9 u, h+ R! Q, B$ f4 ?
1 @3 |7 b# _! C+ s3 h! m7 o+ gbegin P_read arriving
+ B* A# E" Z$ i2 \4 D+ n    while 1=1 do begin, a1 T: w% ~6 \& C3 F
        read A_tote from "data.txt" with delimiter "\n"4 i; ?. P7 e3 A9 X* X3 p! W; X
        read A_time from "data.txt" with delimiter "\n"
9 ?3 k  N$ M& ^4 h        read A_leave from "data.txt" with delimiter "\n"
. m" w7 y3 k' R        read A_picks from "data.txt" with delimiter "\n"% J* _# Q( K+ m+ }. L4 M
        set load type to A_tote
0 V/ m2 i0 S5 O        if A_tote="tote 1" then set A_induct to 1; Y; ]6 P2 t6 x+ Y& c8 O
        else if A_tote="tote 2" then set A_induct to 2' e' t3 E0 ~: r
            else set A_induct to 3   
7 Z- X' J9 v; P/ U) S0 }        set A_i to 0
6 ?9 H7 {4 [, K% d6 I4 \        clone 1 load to P_induction
% @* g% G) S! @; d        wait for A_time sec
  B' z1 p+ ?/ D& B6 Y    end: |! p8 l  m+ I: @: o) l: M
end3 a- D' f" t7 J4 G9 e0 \! J
! b1 V2 N; o+ d( R# r+ Z! l
begin P_induction arriving
5 c/ |8 t, {' C/ ]( O! U4 A    if A_induct=1 then clone 1 load to P_pick1
& ~8 {- G" |" O7 g    else if A_induct=2 then clone 1 load to P_pick2  A9 O$ Y1 b6 w
        else clone 1 load to P_pick3; v" O+ v' |- K. [2 R) `
end9 {4 p$ y5 |* |! _5 V" |) `! a
! P+ S4 [0 [. t
begin P_pick1 arriving
6 ^6 m, {4 f+ q% A$ c5 k! U. b  U    set A_i to 1
0 P5 U4 [% l; m# ?6 @    move into Q_induct1
" L+ G6 S$ X/ r    move into pickaisle.induct1% }. L& O! y% m* d+ Q4 c8 r- W
    while A_i<=30 do begin: |! c5 V/ L* b4 S3 ?% s
        travel to pickaisle.con(A_i)
4 V) g" [* h6 [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' }8 d* n' ~3 v2 ^. n+ G        else wait for 10 sec6 j' C8 w( F, r3 {0 \
        if A_i=A_leave then send to die0 ]/ w: C% @& D- a: }% ^+ |
        else inc A_i by 1
; \, d8 A8 ?5 |, L    end3 z0 s: L# ^9 h2 K* ]
end
+ c) q" P; q; _$ \' n$ p
0 p; |& Y* h' m/ pbegin P_pick2 arriving# B2 W7 ?8 m8 H! Y
    set A_i to 11
8 A- r5 \, x9 y, z+ H" [. Q. \# t  y. A" ?    move into Q_induct2
, N- [( ?; A- o: ^. B. j2 u    move into pickaisle.induct2
& {) K8 [* O: C( H! q    while A_i<=30 do begin2 F/ H+ k( H4 r9 \8 o5 K4 \
        travel to pickaisle.con(A_i)( l: Q2 e6 E* R) {. B/ a' A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 w! \& U7 o* Q/ w7 e
        else wait for 10 sec
, Y: n% v' U# ]$ F4 @. A/ U        if A_i=A_leave then send to die
# m2 |5 x/ K* O( l6 _" A        else inc A_i by 1
* y2 y- R, d1 O% a' {# C! k( y1 m    end
7 p5 U7 e& ]9 ^6 \. Oend) {* H- K, I  @1 [9 K2 R
* P, p7 y* ~: `* p6 t
begin P_pick3 arriving! O: N; ?; x; r+ s
    set A_i to 216 H, Q  ^' r: v4 B+ v+ p
    move into Q_induct3
7 ?! p+ O  G8 ]7 |! j* S9 }# L    move into pickaisle.induct3
2 G, c6 a  f0 J$ v8 W9 j+ O, U    while A_i<=30 do begin
" d  U9 s' u+ R* P- o& S" W' ~" @        travel to pickaisle.con(A_i)( O  \6 O6 P% P, ~7 P1 [4 D+ ~! E& e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ w' s% E  X( F3 z7 U$ o  r/ X        else wait for 10 sec
! ]+ @; G( N, D$ V; d        if A_i=A_leave then send to die9 ?- B2 K5 i4 T
        else inc A_i by 1, i3 Z: O1 }/ x* O8 J+ ]
    end6 l6 N1 ?  f5 j
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是个什么东东?% H& J  D0 v0 l& b& F' P: K" P
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
9 C7 p! O, D; i& g+ J) R4 L9 @$ L7 T  c0 y
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. [% e7 S* W( b

, P0 [0 W+ {$ j* k7 ]  t另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 e7 `* \5 t- P6 g& z- n& u
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 r# T! E6 w. |! H2 ]2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;  g! }4 p: K) K2 R  \1 n& u
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; ^8 _7 b' l8 r7 q
begin P_induction arriving+ s; P) k8 E0 ~' T8 P$ i
    clone 1 load to P_pick(A_induct)
' `7 e! _$ [* I2 vend最大的系, e# q5 f  R  V- |
  E0 ]/ D7 ?# w) s
begin P_pick arriving2 q: l5 S; k6 P0 c
    set A_i to procindex * 10 + 18 P; D" \: K+ {4 H
    move into Q_induct(procindex)' s: C8 y( R5 m" \( j- E4 |
    move into pickaisle.induct(procindex)
* j5 M2 S' ^0 Y/ }! c5 F    /*check the type of pickaisle.induct(i), for your last problem.*/" R1 Y$ I6 ^, y/ \& m4 H" e: `3 d
* W- F: [. r0 X( y) t8 g9 U
    while A_i<=30 do begin
6 G8 }1 _# J# x( @; q        travel to pickaisle.con(A_i)
8 X  r5 Z/ S6 C! D! y% @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, ]- Q; g7 ^* x' m' W
        else wait for 10 sec! ^2 W" l6 n) F# C. D- Q- ?
        if A_i=A_leave then send to die
3 |6 ~$ {! \2 W' }  p        else inc A_i by 1
" R; \) {/ e( O2 J" B7 U1 U: R; j    end8 `1 {( f2 u$ e: l1 w2 m. l
end
. J3 P3 J: F7 I4 }7 j0 T' V2 N6 m$ t& w% ?. b
其中的procindex为整形,代表当前process的序号。
/ k" O; A3 k8 {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-8-4 13:08 , Processed in 0.017763 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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