设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14194|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, E4 m2 `8 X# o! g+ s
/ {7 ~9 u: k% A
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
; c" p: H. [% Y& K5 Q
, e  Y0 l- c( y  t* |8 U6 |begin P_read arriving
% U0 k9 ?: ?/ A" s2 q    while 1=1 do begin
/ k$ e$ K- O7 c. z* f        read A_tote from "data.txt" with delimiter "\n"% P* U7 q3 v# d  ~! A7 x7 X3 a
        read A_time from "data.txt" with delimiter "\n"
' ?3 A5 G5 P' {5 F" X) B) M( e        read A_leave from "data.txt" with delimiter "\n"' R/ p2 F3 l7 ]  Z) {0 r+ V
        read A_picks from "data.txt" with delimiter "\n"- o# C3 S; B+ q& E. O$ L- {& a
        set load type to A_tote
& j' v! D: p8 k/ c0 x        if A_tote="tote 1" then set A_induct to 1
& a5 w4 |1 c( S8 S4 l, v; d3 S        else if A_tote="tote 2" then set A_induct to 2
8 y9 d( T8 G( \! R! q- t# I% i            else set A_induct to 3    ! E2 C- T; r  B  _4 F$ d
        set A_i to 06 n0 y: q# Z! f, G3 x
        clone 1 load to P_induction3 g( w, Y* e% X& M5 q
        wait for A_time sec
9 F: R1 D, ^3 w0 r: n6 {9 F) Q    end3 g* G9 A9 }7 {* {+ B
end' C4 M' ~% o3 v/ l/ h6 U

: I* W& Z' D5 x- O3 zbegin P_induction arriving; d5 p- `' `+ F( T
    if A_induct=1 then clone 1 load to P_pick1  s2 k; A! m/ `' N6 Y- i+ R( V
    else if A_induct=2 then clone 1 load to P_pick2
3 J1 g  O7 T' a4 b- x( T8 r        else clone 1 load to P_pick3
. J7 A$ I5 m- r( b+ y1 q2 qend
, w) B9 x5 H9 R( b( ~" a; S! t4 C- l. N" G5 p* [: e  R
begin P_pick1 arriving  ^8 _' y$ b' j8 A3 ?+ E
    set A_i to 1
2 ^& K; L4 F  |9 b- D) B; ?  r  j    move into Q_induct1, d5 t+ I; y( R" @% @
    move into pickaisle.induct1
; ~: X) Q8 z% A/ E3 A    while A_i<=30 do begin
. i; A$ L3 ^. V7 `8 L, ~        travel to pickaisle.con(A_i)8 J' i1 A5 f4 }+ x  I& I7 m: b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ Q# @& v) H+ P. `! K! e        else wait for 10 sec5 a* `8 Z9 P/ N+ N# d% U
        if A_i=A_leave then send to die
0 Y# n# o# j; x6 u; R7 l. l6 a        else inc A_i by 1
, V6 G' z) c7 Q/ i1 z& U! d    end! e" [% `  B7 ?9 h% G2 F5 [
end, I; c: k% k8 W  Q# a3 r1 y$ v
9 m( M2 ]& s/ B, H
begin P_pick2 arriving
0 S& Z) c5 f. p% B    set A_i to 11- D( \# ?) Y6 _/ u! j2 |
    move into Q_induct2
* Y! T4 N# K) I. Q8 W2 R; K    move into pickaisle.induct22 q; }; ?' r# W. L2 K! M1 C- R0 I
    while A_i<=30 do begin9 C4 I# `( J# f# p$ g; _6 J
        travel to pickaisle.con(A_i)
- q  B9 y! J1 v: ]1 @2 z9 ~" `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 T$ D/ M9 _: U$ E- g4 X# Q% w0 Q
        else wait for 10 sec
5 @- ^: H" i0 _        if A_i=A_leave then send to die
, {0 `5 ]5 A. B- T* g        else inc A_i by 1  j. X8 c, u5 ~/ A
    end
+ }" y! {% b. S& a; M/ pend
' [. S4 F0 o0 j# N. O, O, e9 h0 R; v% v8 c( R- Y
begin P_pick3 arriving
2 Y! P" }/ U, k! s    set A_i to 21
0 R% F. I+ g" ]* y4 v2 m    move into Q_induct3$ I7 i" V% d  i+ R1 U
    move into pickaisle.induct3
' B, o! y3 K* r) {* N    while A_i<=30 do begin, ?$ K. [# ?* Q3 W$ F; ]  F
        travel to pickaisle.con(A_i)
$ ?% l8 E  t* }5 U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 A- }8 n4 }2 a- T# K' m
        else wait for 10 sec9 |0 |/ W! @) l
        if A_i=A_leave then send to die
3 r" y0 a( C) p" M        else inc A_i by 1
- |- c4 c7 L, t; d    end
7 V. T" [8 T0 ~* t" o! Q* ?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是个什么东东?
- I. j! ]1 e! @! I& X. }move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?: [& S& i+ H( J- B

6 n5 z1 Y5 Q1 iAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ f! i0 ^% O% W! J& g6 W/ V
3 c# J, i) _) W3 U3 y9 f, u
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
. ]8 O& y5 Y. O0 K1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
: c( q% b% s9 r6 S+ ]0 s2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
, U& @7 x$ j4 |# X6 B, X' [3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
* G1 ^4 Z' R, x& Z9 X; ?begin P_induction arriving% s7 e+ }4 G# M2 i4 k
    clone 1 load to P_pick(A_induct)
1 w) {# p' y" send最大的系) D# ]9 @; o4 @6 u- h' U3 F8 j' \6 l
  j- T/ K: c3 I' u
begin P_pick arriving$ D6 ]8 P6 }# m, B# W7 k& O
    set A_i to procindex * 10 + 1; {5 n! s( N+ S  g
    move into Q_induct(procindex)9 |- s7 i3 T4 z  P
    move into pickaisle.induct(procindex)
+ Z8 O3 A0 j3 o- t2 r% f& f. C    /*check the type of pickaisle.induct(i), for your last problem.*/
) U' ?, `; a- k" A0 U2 }4 s( e" k- R3 k
) }3 B! n1 y2 c. O7 g1 h- a- v    while A_i<=30 do begin# r5 y: s& M9 \; a5 @: \
        travel to pickaisle.con(A_i)
' B( L8 o/ ~! l4 M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ }( p) i  [0 ^: a( s        else wait for 10 sec
) X% C( h5 ^. Y8 B" q1 ]        if A_i=A_leave then send to die1 \% m  U/ b8 k% W6 p- a" F7 q: Z
        else inc A_i by 1
- z8 ?9 P( Q/ v    end
2 i9 I4 y8 z7 ~3 G4 ^! B' Xend
' k: P1 y. i1 x: \% m: Y$ ?7 ^
9 A5 d) }6 Q% U# V) |其中的procindex为整形,代表当前process的序号。
( Y) B" G; S3 I( Q' kstation和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-6-19 01:40 , Processed in 0.018269 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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