设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14516|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% Q# @5 T8 ]+ q  M
8 b# E% y' q' 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中的数值,不知道会不会有什么不妥。  A- B: x" F8 Z4 a+ [
$ `) R; x( I6 W1 q3 i, ^
begin P_read arriving
- J7 v4 \$ Y  U' o" l, ~    while 1=1 do begin
* M- H2 W4 B2 H  x. q# l! @7 Y7 ]        read A_tote from "data.txt" with delimiter "\n"" o0 l7 ^6 i( [
        read A_time from "data.txt" with delimiter "\n"% @* }# z2 w& b3 Z1 M
        read A_leave from "data.txt" with delimiter "\n"8 _1 ~2 [# p& m5 \3 G
        read A_picks from "data.txt" with delimiter "\n": {# z' y* X% z2 }9 a6 R
        set load type to A_tote
  N3 Q/ n: S1 x+ e. e        if A_tote="tote 1" then set A_induct to 1- S4 O' ?! s# A$ V5 j- C% S
        else if A_tote="tote 2" then set A_induct to 2) K2 Z4 g" i# t4 I! D/ }
            else set A_induct to 3    : ?& g5 B' W* Z; h) E! K
        set A_i to 0+ j: N' p' B& m. l% Y6 B1 E
        clone 1 load to P_induction
( n3 E( Y  Q. {' u        wait for A_time sec
3 E9 `/ w$ |# h4 P    end3 ?/ \" ]4 d/ @
end7 ?/ f( P4 a: S: ^/ t
, s# w' f" E8 F! P7 N1 F2 j) K6 e
begin P_induction arriving- y( d" O6 T" Y2 ^4 C+ }5 j
    if A_induct=1 then clone 1 load to P_pick13 Q( w! x2 E% B+ V- O
    else if A_induct=2 then clone 1 load to P_pick2  |" m$ s) D* s+ S5 y
        else clone 1 load to P_pick3
. ]0 o9 ^3 `$ f7 g( }+ E9 Wend2 |' O3 L# y2 h( @9 ^$ x

$ u. y3 ^$ I0 F: f3 Y/ fbegin P_pick1 arriving
, ~0 O) P! ~( _: G& Y" a0 Q    set A_i to 1
' b+ W, n( _6 D+ G8 G    move into Q_induct14 K! A* Q  u9 J: n, f- {
    move into pickaisle.induct1/ B. A: G# F$ W& r
    while A_i<=30 do begin
8 i& \. M  v0 I& H        travel to pickaisle.con(A_i)
/ z! }( A. B; m. |2 }5 q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" e( J$ i6 X. }. m7 q
        else wait for 10 sec
+ @. t5 X) @, B0 b: @- m4 J# u        if A_i=A_leave then send to die( F9 m* L$ H. X. @. ^1 h
        else inc A_i by 1! G9 Y: B; K0 p
    end
: t* m; b9 v! E' V+ A7 c* Wend) c1 x  U: _0 n& U: y* @
2 n( k1 n7 [  ?5 |5 z# f5 B  H8 ^
begin P_pick2 arriving
4 i; |: t/ t" H9 ^/ {' D    set A_i to 119 k8 w0 S, v9 y1 i! a( ~
    move into Q_induct2" H3 N# T+ e4 R) r0 l+ |
    move into pickaisle.induct2% X6 P3 h* L  E/ o% I2 W
    while A_i<=30 do begin' c% x/ A& S) ?! `& h9 c
        travel to pickaisle.con(A_i)) _' c! l- u, P) T+ ~2 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 N  K* _, E% P1 W, @2 l+ _$ @* p9 a        else wait for 10 sec
; r$ W* B7 M/ D. {' A8 n        if A_i=A_leave then send to die9 V9 T) ^: h6 ^/ l( D' E1 t
        else inc A_i by 1
9 X7 c  H: ]8 o1 Q; a# X. [    end
! c2 \8 x4 Y1 Lend' O6 e$ J5 v+ G5 U4 r
- P9 y" c$ S) B
begin P_pick3 arriving" l3 E0 k* W6 f7 _
    set A_i to 214 N1 {: u2 c; k
    move into Q_induct34 G8 `7 B( G- Y$ \$ h
    move into pickaisle.induct3( U; ^8 r, |. V
    while A_i<=30 do begin8 _# _4 R, R; f% [/ [6 Q% U
        travel to pickaisle.con(A_i)
% Y* O5 X! R  r: N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* k* P9 }0 \3 m
        else wait for 10 sec
4 f+ q# b9 p; `: J) y        if A_i=A_leave then send to die
" y7 C7 ~+ k' w# b        else inc A_i by 1
8 ]9 T5 M5 }% _6 Q! W    end6 G: e# l- Y! y% ~
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是个什么东东?, P( G' F8 E" h* }" k+ c$ @
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
* w/ |- x$ {/ }$ N* \' n7 }5 `& v
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。* |6 H" ?' e* E5 H; u5 s+ S

" W! r& H8 d' N另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- ^  @; V( V3 e' Y0 |! j& [1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
! f; c' b7 `& `& D) |1 D2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;2 C; ~' R0 c& ?1 \
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 e/ p% R9 b( e: v- o1 `# W# R( q0 u
begin P_induction arriving3 \2 C3 P4 U" D+ i
    clone 1 load to P_pick(A_induct)
" n! y( v4 {7 W0 N& S! iend最大的系$ S" X, R) F, M& Y, r

* J6 J/ S3 }$ `: S& D( R6 D8 i. W$ mbegin P_pick arriving
5 e: k4 b& r9 X8 C+ a    set A_i to procindex * 10 + 1
4 G$ x; p& I# k" U& E& a    move into Q_induct(procindex)* ^2 i4 l& R" l. y6 K1 {5 [# D
    move into pickaisle.induct(procindex)2 T% ^$ n9 m$ Z' \2 I
    /*check the type of pickaisle.induct(i), for your last problem.*/
7 j: U/ {) Z" L6 d, g  I
  b2 y% N  n+ @    while A_i<=30 do begin( a9 ?2 }% ^  D. R: q
        travel to pickaisle.con(A_i)
8 N, r  ]5 O& G, {% E( \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: \: h+ T! P0 ?. H
        else wait for 10 sec( N- c0 C3 j, i! F( C8 r, J# w6 U4 J
        if A_i=A_leave then send to die; G' L; |6 v8 D& V
        else inc A_i by 1
+ {5 m2 ?) D( r1 |5 d% t# @    end" k- Y) Z% h" S4 J5 |* h3 f
end
' Z5 a8 ?) J+ `) O( X) b3 v! Q6 P* y) z
其中的procindex为整形,代表当前process的序号。9 z2 f1 L; v/ z$ a  [. ^3 b& v
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-7-14 23:39 , Processed in 0.017508 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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