设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12706|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% Z3 W: G8 {1 d% x" |+ K( T7 U) j

" O4 n2 B$ E/ q$ z( ?% N: T0 ]1 ~6 @我的问题是,在每个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中的数值,不知道会不会有什么不妥。# Y" w0 L8 m* O0 O: `

% O0 W5 P! p4 dbegin P_read arriving- L- M. U3 H6 [) `% g
    while 1=1 do begin
: {* z. M+ s1 Z" K1 P$ ]+ [& K        read A_tote from "data.txt" with delimiter "\n"1 G9 ^- x1 H/ o" ?1 h( j
        read A_time from "data.txt" with delimiter "\n"- x0 s- e* N$ j4 O
        read A_leave from "data.txt" with delimiter "\n"
' O. H$ l) i! F$ y" F9 i        read A_picks from "data.txt" with delimiter "\n"
1 X7 e6 c( n  E" J: u) R) X        set load type to A_tote. p+ g! |, F6 q2 Q2 n7 `
        if A_tote="tote 1" then set A_induct to 1, N' m5 ~7 Q1 I
        else if A_tote="tote 2" then set A_induct to 2% X! i1 W  R* @1 |' A, V) I' i. ]
            else set A_induct to 3   
2 z: e0 Y( ~/ q3 B! q        set A_i to 07 Q2 W: {2 f! f
        clone 1 load to P_induction
+ K* B. P* W' t+ D9 f        wait for A_time sec$ H# V' {9 P! k& C( \
    end
9 |, B! N3 b- S4 @- j# d3 Xend3 ^6 L# ]% Z  [' o& l. u  Z' {
; Y2 E- ^2 x2 \) I1 y+ L) E
begin P_induction arriving
4 k9 K  F8 t6 l+ G' W& ]7 }    if A_induct=1 then clone 1 load to P_pick10 \: w+ @) t; W5 _2 \2 R
    else if A_induct=2 then clone 1 load to P_pick2
1 l5 k; `/ E; I( p        else clone 1 load to P_pick3; {8 q6 L7 U( a3 _( w" Z
end1 b" _& t3 u: \* v( r+ C, E0 @

. g8 [* X6 a, U; ^) \6 J6 E9 kbegin P_pick1 arriving, F) e6 P0 L' F# C7 J
    set A_i to 15 x+ z: x8 w/ [, @7 ?9 Z: x' g
    move into Q_induct12 j& p7 |6 Y( `& W+ A) H
    move into pickaisle.induct1
* l6 o% l& X& [( \. ~$ a3 V    while A_i<=30 do begin7 e: l/ W+ A% ?- Y1 j6 {2 I5 P2 V
        travel to pickaisle.con(A_i)
* f7 K, Z: ^# O9 U  J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, ]  |4 T" j' T! ]0 G2 ?: @# H/ v* e0 V
        else wait for 10 sec
+ A: x# C  c; Z. W  A1 G        if A_i=A_leave then send to die
/ _2 S# A3 m" X" _. S' l) `        else inc A_i by 1
, }6 r: @8 c. A, V( j% i    end/ S( e5 X7 Q3 s" d5 E
end& P) R9 P2 H3 P; i9 w& u8 Q
9 i( B3 h0 L+ ^8 m
begin P_pick2 arriving
" Q1 {* k; Q+ L* ~4 J    set A_i to 11+ R' {) H: E* z. K: b" S
    move into Q_induct2
5 E- u, ^6 g/ T4 p    move into pickaisle.induct2
" W' j, K2 p$ o5 ?1 B    while A_i<=30 do begin
9 b3 W8 L% a4 r  ]$ H        travel to pickaisle.con(A_i)
6 v1 l, m& X3 X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ S+ Z+ S5 i1 ~% O' v        else wait for 10 sec
; u3 H" x* b) J. n, y2 M        if A_i=A_leave then send to die2 b3 n+ o- v  J; I1 ^
        else inc A_i by 1
7 ^8 o* J* {* n( ]; T- o. [    end
, l5 w% o* |: {& r* T6 H. q  m6 W, }end( w2 k( I& ?; j' U! U- O
* E8 I: e& R' \
begin P_pick3 arriving
; w8 B0 K9 s( q2 O    set A_i to 21# j2 X3 k' B+ \. H' T
    move into Q_induct3$ {' B, R4 I$ A5 Z
    move into pickaisle.induct3
5 ^7 v6 K9 V! N% ~0 T  N# z: S* q    while A_i<=30 do begin7 K  L8 y1 }/ j, g! V  I
        travel to pickaisle.con(A_i)/ _+ P: N# y7 ?1 o1 Y4 G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- c6 M5 K; x" f& K7 k+ M- y, _
        else wait for 10 sec
8 ~  {2 i0 @6 ?) ?        if A_i=A_leave then send to die
) r& m  f2 a# x, v, A        else inc A_i by 1
6 L. g: }# D: R6 U6 t3 N, ]) k1 t8 d    end
+ n7 t7 c' t3 z- d  L. f. Jend

最佳答案

查看完整内容

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是个什么东东?* A' c% V/ p3 X* C- h) L# f! U6 }6 L
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?) w" U: ?6 G2 h3 k, }

% e' L4 `1 \! X2 f9 W: {AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 |( h: }5 m) V0 x7 a6 k
: o3 f; u; {; K8 Y3 ?另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' z! L. I! Y" O) ^# [  M
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
6 G7 g6 O+ k. W& s2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( D6 q) Z- J+ W! \0 B9 M3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:9 s: }! [# T9 U- E0 l
begin P_induction arriving
7 |$ S% u, `3 W3 V    clone 1 load to P_pick(A_induct)$ Z& N" ~5 p, e: Z4 ?, P2 y
end最大的系% R; O4 e! [8 x2 b: `# `
8 Z' ^4 i, P% x+ }9 D7 b
begin P_pick arriving  P0 O+ ?0 ?1 G7 m. n% u
    set A_i to procindex * 10 + 1
! E4 [7 _/ P9 Q    move into Q_induct(procindex)
5 M. Q+ @+ A/ N% ^* l- {0 `    move into pickaisle.induct(procindex)3 Z4 I3 C8 |$ e' M/ Q" R: ]( h3 J- {! y' J
    /*check the type of pickaisle.induct(i), for your last problem.*/
1 y0 c$ x& u- Y1 F' H9 i. [! E/ t* ?3 M& ], C
    while A_i<=30 do begin
) W, b& ^9 [- M- W        travel to pickaisle.con(A_i)$ S. @1 W) _- d2 C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 G& u* ^3 p: }) R$ _1 \- Z        else wait for 10 sec# \% K+ s  q8 [4 g" `
        if A_i=A_leave then send to die
6 Q3 l# ~6 `, I( Q( |        else inc A_i by 1
) Q) j+ H4 X, H$ s# i2 h1 l4 R    end
- X. G- G$ k- q1 d3 c% d) N" `  Send% z  l& s* s5 m7 B+ t  B

5 ~& C' w+ E; K( p8 ]其中的procindex为整形,代表当前process的序号。
2 B, Z2 x( U$ s9 M, rstation和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-2-13 00:14 , Processed in 0.027405 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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