设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12251|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& r9 B& s7 o9 x. O! b; W6 J) f
3 g, _9 r" S8 z# W0 f: y8 B+ E8 w, |我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ x9 u4 w# r$ U$ G* L+ j: y+ C/ E' L, ^+ H0 U" w+ f& C
begin P_read arriving! C% _2 q2 Y  B# K6 ?
    while 1=1 do begin
5 V3 e- j/ D3 k/ o  z  s        read A_tote from "data.txt" with delimiter "\n"
) [8 f4 @/ L! u( @9 T+ ?        read A_time from "data.txt" with delimiter "\n"  W5 C' e  i. K& N: O) x
        read A_leave from "data.txt" with delimiter "\n"
5 _' a  s- d# F" `; f6 s) H        read A_picks from "data.txt" with delimiter "\n", q2 v: X9 a+ T+ R
        set load type to A_tote' H  k" Q! s# h3 d3 ^3 S2 m
        if A_tote="tote 1" then set A_induct to 1/ h4 A7 Z, P" B6 U( P' N3 K& k7 D
        else if A_tote="tote 2" then set A_induct to 2
1 u3 Q% T/ V: w: A            else set A_induct to 3   
; f9 a& {( Z; ^2 V6 Z- t        set A_i to 0
' b$ N: E$ W3 i0 ]; U5 }6 [) {        clone 1 load to P_induction1 V2 t+ U& p$ Z2 ]& i
        wait for A_time sec
; H4 @) p- U9 R# o7 s    end
4 V  Q& W2 q) S! {" i% iend4 i5 c6 a- L" d2 G  F7 x3 R

9 [9 V* `; d3 G( R+ Nbegin P_induction arriving
$ P& i- ]' w- O5 R) \" p6 n( ]    if A_induct=1 then clone 1 load to P_pick1! a( i5 s, A3 o. }0 }
    else if A_induct=2 then clone 1 load to P_pick2
( m! e; [0 U0 V  n        else clone 1 load to P_pick3
. [0 D  a! }4 w/ o- F$ {end
0 a4 a; s+ d" c- k7 a. a7 K$ h& E  M1 N  L1 f2 ~' L% q8 T4 x
begin P_pick1 arriving% |3 ^0 C; d$ l
    set A_i to 19 ~7 h( Q; c4 A" V( b% e3 V
    move into Q_induct1
& Y/ Y7 I' \2 g* l. `    move into pickaisle.induct1
, ~* l$ ~" D" e: u  E7 [    while A_i<=30 do begin
' P! x% I5 q5 D- R        travel to pickaisle.con(A_i)
0 V2 }, ]% J: j9 y& r1 S( x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 {# U7 z1 X+ m        else wait for 10 sec
/ p  \2 m& O. A5 Z6 ^% h        if A_i=A_leave then send to die$ ]2 D' n( W  l  W$ Y. H
        else inc A_i by 1& R7 J6 c+ E8 V( h0 Q
    end
& M8 j! U- b) {8 fend
( B% |! ^4 `# ?
. h! ?/ Q  H" R9 f' |begin P_pick2 arriving
" D3 p) s0 p* b1 g/ I    set A_i to 11
6 u  Z4 a  @9 [    move into Q_induct2/ |' T) s6 R$ G) O0 s
    move into pickaisle.induct2
8 v  ]& E4 ~$ K9 [    while A_i<=30 do begin' P3 F% y0 l1 `) m  `
        travel to pickaisle.con(A_i)7 A4 i2 ~6 `, A! c8 Y1 o) |% d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ E+ N& l& {: O& g: [8 n% T        else wait for 10 sec
# x: p9 U: Q! e# u2 ?1 Z0 `        if A_i=A_leave then send to die, z- t( K* f" g1 J0 ?, B
        else inc A_i by 1# j1 J0 k$ c5 i1 k/ _9 f
    end% h- K; p( `1 _2 I3 P8 d9 z
end
; q8 `  w0 A7 j4 z7 w
1 @" v8 R1 j! i0 a& S2 Gbegin P_pick3 arriving
3 v) m: S2 W/ s5 r9 K4 _6 i    set A_i to 21
, E7 H% O& U0 C+ o6 N    move into Q_induct3. y; x% c- w' t7 O( T
    move into pickaisle.induct3+ ^) W: s$ N4 [
    while A_i<=30 do begin5 g4 d- `3 L4 _1 y9 o
        travel to pickaisle.con(A_i)
6 I! L" s, u: X! k% t/ h, Z5 V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( \, z+ x! z/ b4 T. Q        else wait for 10 sec$ I, o4 f8 V: Z2 O( L
        if A_i=A_leave then send to die
4 D5 O5 v; J( J- h  s9 |        else inc A_i by 1
# V1 e  e5 C" }    end: s3 }# b/ F* W2 a4 }3 _3 r7 [
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是个什么东东?' W8 @1 v: J" I; i$ d; }3 e. U
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
$ {  s& o* B; q3 [" U3 y) g9 ~% t  Y. K8 v, R! h/ _
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* r& L6 x; Z! A# K* ]" |4 c2 A$ C2 k
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
2 H5 M* ?4 z+ b6 J1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
' d) ]" f2 v0 E% j% a  \2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;; C6 z" u$ U. D0 p  B8 w2 }' d1 O
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  b% }7 J! R) J) {. rbegin P_induction arriving) _- ^% {8 A* Q
    clone 1 load to P_pick(A_induct)
  {( M/ e# T: z8 d' mend最大的系
' ?, h. j  l/ U# J9 s- G9 Y  m9 I$ U& P9 y3 s8 d
begin P_pick arriving
6 J% k3 B( ~6 Y/ i* W0 u2 ^    set A_i to procindex * 10 + 1- e% s2 _' x' f3 l
    move into Q_induct(procindex)
: o8 M! J- b3 S5 W9 L; j/ {- G6 u    move into pickaisle.induct(procindex)
7 E- e6 B  W7 B. f* \    /*check the type of pickaisle.induct(i), for your last problem.*/
( F* Y1 \0 T9 K, U' B% |0 |+ ?2 L1 _. @" K7 K% }
    while A_i<=30 do begin
* G( l3 Y5 @+ [1 |' H! b+ P        travel to pickaisle.con(A_i)
9 q/ f' Z2 Y" X3 a, e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ O4 F% ]% o% q+ v3 Y2 r
        else wait for 10 sec
3 I4 K, C# O2 n& G( a) \        if A_i=A_leave then send to die, V' l" A, v1 [5 |+ m
        else inc A_i by 14 V! k* D* F) m( c  T/ h! D
    end: s2 t/ l- g  W9 P  U& `
end: Y( [) O! g. u! {

. ]; T0 i6 r3 _9 @" B  D: j其中的procindex为整形,代表当前process的序号。
8 A# g! H9 C7 k' y8 }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-1-7 16:59 , Processed in 0.017307 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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