设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15478|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' V2 Z3 D$ a: C  [  s# C4 o
, \6 D) P9 B# |: J& Q7 M
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
; J1 }* D* X# y2 J* |. Y
. U) e' A2 _6 V% ~begin P_read arriving3 s) v; d1 C4 b3 _3 G& \/ l
    while 1=1 do begin: L% F: K$ T1 M3 v, O: G3 k" D
        read A_tote from "data.txt" with delimiter "\n"% n7 |7 k$ s" F9 r
        read A_time from "data.txt" with delimiter "\n", Z: a* J1 F6 j/ B) E5 F, o
        read A_leave from "data.txt" with delimiter "\n"" w* v7 Q$ U# G, ?
        read A_picks from "data.txt" with delimiter "\n"+ K" B4 g& |% `. \2 x
        set load type to A_tote$ m! X0 E4 j4 \- R3 k5 B
        if A_tote="tote 1" then set A_induct to 11 G, z1 H2 ~1 E
        else if A_tote="tote 2" then set A_induct to 2/ W9 d% i6 D7 X7 e8 W
            else set A_induct to 3    2 W" S* M( n9 }& ^) [0 {" F
        set A_i to 0& ^1 ^4 d( J* k" p( u3 \9 Y
        clone 1 load to P_induction
+ n: D0 K2 C& R3 @        wait for A_time sec, \8 f  B& O6 s; k
    end, {2 s/ d( {. s) V1 W
end
) f8 b6 l# S: Q1 h, r9 M
$ I" }8 X/ ]0 H" l9 R( ~begin P_induction arriving
) D1 y5 P% m6 j" ]' I    if A_induct=1 then clone 1 load to P_pick1, t  |3 p7 z4 U4 o, \
    else if A_induct=2 then clone 1 load to P_pick2: m$ \( T# v3 u2 t) t
        else clone 1 load to P_pick3, ?, f- Z; q( G: _2 c$ c, j
end
! F6 f# u, B, ]4 c9 E
4 V( d( s* l1 o! nbegin P_pick1 arriving
3 ~( s# @- i1 ^+ G9 r4 \    set A_i to 1
$ _) |( m& W! U* Z& A    move into Q_induct1
# K# H: q- e& Z) e* G5 a- i    move into pickaisle.induct1
8 D! B8 Q% a: n    while A_i<=30 do begin* O% I; ?) U' I( ?
        travel to pickaisle.con(A_i)
: @3 Y+ s7 D5 S8 M8 s* e$ }8 T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* }% _' P' p  {' i5 o( E
        else wait for 10 sec' |1 h( U" P5 M5 n, S
        if A_i=A_leave then send to die
" Z- @  q" o+ R: n# t) r7 g        else inc A_i by 1
" Y# u1 F* K0 u6 P/ f    end
/ R( T0 }# i' a: H% T4 zend
7 {, [. q  D% J
. e" N2 S" s# obegin P_pick2 arriving
1 f! [5 x0 j( I* B) m    set A_i to 11
* [% p+ w# S3 t% y1 I5 ]1 Y# P, G    move into Q_induct2
- |& s" _$ L' w: ]& @/ G    move into pickaisle.induct28 _1 X$ B" Y* z0 t
    while A_i<=30 do begin( o6 r: U( G9 n; |  o
        travel to pickaisle.con(A_i)
: C- x( l# I& i9 a1 z  P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ p" Y+ Y  D+ b. g: B* S        else wait for 10 sec
( q+ D" l# S) T        if A_i=A_leave then send to die
) s$ E2 Z* A' a        else inc A_i by 1
, e1 M# ^6 d) g, X4 v$ }/ ^+ Z& P) n    end
- k* n9 Z0 N. j2 t4 s7 ?end6 T# X. O/ C+ G; X" N' s

8 j% d/ Z5 c+ Y+ K8 Jbegin P_pick3 arriving
9 J8 O7 T( w  k. v3 \$ [    set A_i to 21' T6 E& S0 U- N% }
    move into Q_induct3# M2 m2 C7 `+ {8 A
    move into pickaisle.induct3
* E$ Q8 F7 |0 A" T8 o  S    while A_i<=30 do begin
  T1 e4 z) x/ \- b4 D( G        travel to pickaisle.con(A_i)& u) j8 [, b1 c1 n4 H$ m. [' k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, E& r2 q6 |. x3 c* s- _; o' J  M        else wait for 10 sec+ }: e$ I# ^, q3 k
        if A_i=A_leave then send to die
3 W3 q) \+ o' M' I9 p6 ^* q% E        else inc A_i by 1
5 ^  f# o* k( z4 X    end. r6 Y, E# z: M( k& ~1 l
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是个什么东东?
+ W! P: {) I$ I* Emove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?# ?/ O0 [! Q2 {

! r) u" e/ [, C- m' iAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
4 C3 T& q5 o  f+ }# t0 x2 z2 A5 R1 ?9 U  B" w+ @1 X3 J# K
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
' G% x* q3 T  L9 e% R" e! }1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
! a; h+ Q7 b4 O3 A7 w) W" H0 U: w4 V2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: m( a4 k2 F: o. z3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
: V$ Y. j/ Q1 P. i3 x' U6 dbegin P_induction arriving8 C5 K1 e  X7 l
    clone 1 load to P_pick(A_induct)& \5 W# G% K/ E) e8 F
end最大的系9 F4 @% O" o: A6 a1 H

7 V$ h$ o. \; I" m' w, @- X$ jbegin P_pick arriving
( h4 O8 R+ K# c8 `% B    set A_i to procindex * 10 + 1
* F% Z$ H3 g6 l' Q% j0 L& O2 u    move into Q_induct(procindex)  t4 K2 z- w6 s( J* U" T: ]
    move into pickaisle.induct(procindex)1 X* D+ A  C; A6 G% Q
    /*check the type of pickaisle.induct(i), for your last problem.*/2 Y& `4 `- P2 O2 f( V% F

2 l, T  k3 T) ]    while A_i<=30 do begin
' M: Q4 Q$ u& }% C3 ^. a4 _" K        travel to pickaisle.con(A_i)
! V+ {/ }& J- K' H( V0 C4 o- F  n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ S: I6 W( m: N' W) t( \% \        else wait for 10 sec4 q( t0 ]: I' C' j! ~# r  p7 Z
        if A_i=A_leave then send to die
$ k# g- f; Q1 k        else inc A_i by 1: s' M2 _' P' G# f
    end
; d4 `5 t; K$ G2 tend
* g3 b9 m; r, {. P5 x# n4 n4 }3 u% Q& X
其中的procindex为整形,代表当前process的序号。
# i9 N- u, o& O2 a) @& \* m- e7 B5 V1 R) _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-9-13 20:10 , Processed in 0.016648 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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