设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15263|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) w% U1 O& p2 @3 ~/ l
+ F. U2 e; e2 i& C; Z  ~1 j' Q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, O: J* b/ _' G" V4 ^' ]2 V0 J# s+ I& p% H; b7 K
begin P_read arriving
: w, Y4 k& M5 K, A( p# u    while 1=1 do begin
/ b3 O8 @1 t3 F3 k7 ^& \        read A_tote from "data.txt" with delimiter "\n"
) g8 t# x8 R& H) c+ ]; {+ v) S        read A_time from "data.txt" with delimiter "\n"9 s2 m  o; `5 p+ Y9 O( z: C
        read A_leave from "data.txt" with delimiter "\n"  ?- F# k) U2 }  o! \6 J: }" u6 g
        read A_picks from "data.txt" with delimiter "\n"3 A2 W' _9 N1 g/ T+ y
        set load type to A_tote
$ a! e) G- V/ A/ k  ^% G' y        if A_tote="tote 1" then set A_induct to 1' o0 n. r- W$ n2 o5 B
        else if A_tote="tote 2" then set A_induct to 2
4 O2 S  s5 X& z% Q; I            else set A_induct to 3    5 x# v  \6 }  ]$ f% \) T5 |8 T
        set A_i to 0
  `+ ?/ e4 }3 T+ ]1 s# ?        clone 1 load to P_induction6 m6 J0 }- g8 Q' d6 A/ o) [8 F
        wait for A_time sec
% i$ |0 _1 F7 D; _/ T6 A    end
) }6 _6 K! `$ m8 gend2 Y2 H1 D' `* c  Y6 p+ l4 ~7 S" R

2 A# x  D& V2 i4 W4 j. ]1 }( n, ?begin P_induction arriving
4 r" H9 g; F; [8 M    if A_induct=1 then clone 1 load to P_pick1
6 D0 Q+ n! T9 t3 W& C+ \( {# W    else if A_induct=2 then clone 1 load to P_pick2/ W  P5 D4 V" C5 ^/ r: n. p
        else clone 1 load to P_pick3
) c4 d& i: A" m0 Eend
5 l" a, p7 o  e
% @+ Z1 t. O: pbegin P_pick1 arriving
" l3 H3 r! y1 _. @    set A_i to 1
) O3 [6 U- M+ ^0 L; U- P% g    move into Q_induct1
% S5 p' e; {& d' B) i* B; M    move into pickaisle.induct1% p' j% d; r6 f3 B' z
    while A_i<=30 do begin
4 R' ~1 [8 m# W4 m8 H: Q        travel to pickaisle.con(A_i)
0 }9 o4 n! I8 N) l- }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% z# E2 j4 {0 ~2 ?        else wait for 10 sec4 k- \: a9 t; h( {7 L- D
        if A_i=A_leave then send to die
' M" W" ^5 ^' r3 C/ Z        else inc A_i by 1
7 y: W; ^# b" W1 x  z: @    end4 T" ~# S* S2 ~) n
end: i: |, V  m% A( ~" P

  B/ D0 f- @. A1 ?5 C4 qbegin P_pick2 arriving
# N# F' z, Z) p3 f% q4 x    set A_i to 11
1 r5 W! U7 r( ]# c    move into Q_induct2
! t! G+ K# D- [, _% J    move into pickaisle.induct2
: e! P, T) J* W! N* D    while A_i<=30 do begin6 d6 \6 y" Z9 u& ]' b
        travel to pickaisle.con(A_i)4 }1 N# ?: L- l7 [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: F3 k( g  J# K/ x7 t
        else wait for 10 sec- h  Z* S% @+ L- j$ s) ]& ~
        if A_i=A_leave then send to die
) Q3 e' S5 T0 G3 y2 ~: S        else inc A_i by 1& D" A# Z0 K, Z6 `- `8 f( ?
    end! @+ @; _$ X; ?4 k" U
end
6 j: E9 `9 L9 {
, k5 o- x9 J1 ~+ |* x, G6 Zbegin P_pick3 arriving1 O$ K; H) F- A# P; T4 \
    set A_i to 21/ i: o$ \7 ]: L9 _& w* a' ]; d
    move into Q_induct3
5 C2 l9 g; N) {1 q' V+ [7 B    move into pickaisle.induct31 H" F9 w! ]  W% p: H2 _
    while A_i<=30 do begin$ v* P: H0 R) C5 }4 q& I- l! h! l
        travel to pickaisle.con(A_i)% Z4 W. H6 u& L8 L/ P$ ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; O6 C. p$ `. m, E( A, D% A
        else wait for 10 sec5 T. a/ l9 j) w1 G
        if A_i=A_leave then send to die2 e9 [* G. Z, [! ?7 R* w" U) r
        else inc A_i by 13 `1 b+ H$ V+ X3 N
    end
) H8 ]; ]% k7 Q. f/ ~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是个什么东东?! O' F% g- z- X# t# v, F# o' j4 ?
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ b9 Z* j) e2 [; y4 _# y* m0 s9 B. s
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。  N7 w- C$ k5 D8 @4 y

3 v  |4 ]( ]8 c( v" }7 F另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 L% D9 n& L- \7 F
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
0 F, V3 A- f0 @2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) Q* k$ d) m0 G8 `9 y! o
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:  L1 u  e1 L  A2 l
begin P_induction arriving
7 K" D% K/ ]* G' Y% Y8 B    clone 1 load to P_pick(A_induct)
4 Q4 J9 l, y* R* F# H* Xend最大的系
; X/ i3 d5 t: z% t0 G8 P) C* y. l5 E6 Q! c1 j; h% N1 Q$ [
begin P_pick arriving
! e5 {2 Y( N0 E7 v& V    set A_i to procindex * 10 + 11 k% N. y5 }. n. d  [# E8 X8 ?7 L/ u
    move into Q_induct(procindex)
' D' a# T* x( x' j$ ]0 [( q    move into pickaisle.induct(procindex)
7 U" `* f7 x  R* Q' \! _" s    /*check the type of pickaisle.induct(i), for your last problem.*/9 p3 s3 k& u; }- F# y6 ?
- T( N: H% N2 c+ p) P. I
    while A_i<=30 do begin( A/ |7 V5 i2 h# C5 @, h9 f' e
        travel to pickaisle.con(A_i)
4 [3 h& B& t- @9 z9 G- ?( o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% m, c2 r( `* Y# H* h% O8 y
        else wait for 10 sec, T0 N) e. D5 c  x1 X2 ?7 `
        if A_i=A_leave then send to die
2 c9 W5 X& C% D) O3 B- B. R        else inc A_i by 1. a: q& U; Y0 d9 ?4 E+ R- D" |# Z
    end5 Z/ g4 g1 f% Q% @2 x
end
  c3 b( |5 l( j  b, g  n3 ^0 V' t( V- G7 ?4 U
其中的procindex为整形,代表当前process的序号。
' v) F4 [( X9 K! E- Z& d: Cstation和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-28 07:50 , Processed in 0.016419 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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