设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13726|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 O- ^6 J" K1 g! s6 n6 b
9 K: \1 q) r3 D% a& K9 }" I
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" D( `' V9 _" ~' l7 F3 D& ?- m3 `0 S- ?4 t- d7 L! M
begin P_read arriving. U) @) l0 G7 u! U7 [2 @5 `5 g
    while 1=1 do begin  r# Q, t: j1 R: p2 w
        read A_tote from "data.txt" with delimiter "\n"
, a+ S0 O" q6 d        read A_time from "data.txt" with delimiter "\n"
0 W- I+ U! M6 y' f$ m1 c        read A_leave from "data.txt" with delimiter "\n"2 @; h$ Z& w9 i1 q- E% i
        read A_picks from "data.txt" with delimiter "\n": |3 Z! d6 E* a5 I, h5 b+ `: j
        set load type to A_tote
# j( h+ E+ g& P" X  j* G        if A_tote="tote 1" then set A_induct to 1
6 p" z" q: v* `. D        else if A_tote="tote 2" then set A_induct to 2& y! V& N2 g7 O3 P; D
            else set A_induct to 3    + D+ ~' E- i) L" J& |
        set A_i to 0
* u( h. x0 A; G6 l) u9 f        clone 1 load to P_induction1 ?2 {5 c, d# G) _0 D6 H& [
        wait for A_time sec' F9 q' t; |% Z2 t7 G* [
    end
' Z6 F3 q; D# L! o; dend
; T5 i  D3 V9 W# o, G& A' J/ C+ n: G4 a$ @; U2 O" m- V
begin P_induction arriving
' V. ?/ }* n. b: b    if A_induct=1 then clone 1 load to P_pick1
0 K1 N0 ~& J; z1 z( A    else if A_induct=2 then clone 1 load to P_pick2* H: ~2 \3 w  [% r5 Y$ f7 b
        else clone 1 load to P_pick3
% ^" {( F! V% T* m8 N0 i- s* aend' u  l' b: V0 D" o9 U* w* Z/ b1 V

  h- N1 C! t' u& u2 y5 Q  ubegin P_pick1 arriving% S- A1 I+ v" l, H. M( E) {
    set A_i to 1
2 N' K6 [! O3 J; ~    move into Q_induct1
/ J$ t5 @3 K: S9 P" L    move into pickaisle.induct10 v6 K, |& _. a
    while A_i<=30 do begin7 w  c& x4 B% B" N
        travel to pickaisle.con(A_i)
% J: y7 [, y' N! a& @" X# O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( i0 A9 C& Q) h+ w" N# ^
        else wait for 10 sec
" @3 ?, m4 T6 x9 M        if A_i=A_leave then send to die8 Z+ c2 e8 a& |
        else inc A_i by 17 N0 l4 L, d- \, f4 Q" z* ^
    end
. q& N1 o% b4 r" \end; D2 \7 G; J% t' t/ h9 K3 i- C
3 {/ \. q! P' D6 X) N) K' \
begin P_pick2 arriving; z, y7 j: r$ n4 R: v0 @6 A! j) F7 z8 V
    set A_i to 11
+ M" L. J5 ]! E* W. t! e( q. `1 a    move into Q_induct2# W" i/ `2 J5 D% n4 F
    move into pickaisle.induct2" s( U5 s+ H4 M+ b
    while A_i<=30 do begin
+ ]( F$ G0 d+ n1 V0 v* a. v, l        travel to pickaisle.con(A_i)
0 K& l) ~5 b5 a/ C" C8 o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- T+ o3 g8 y7 f1 k$ r        else wait for 10 sec+ ^9 r$ M3 F1 T3 M9 V/ f0 d; d- H: E
        if A_i=A_leave then send to die2 v/ {7 e3 t: s
        else inc A_i by 1
' p5 s; ^" w3 a    end
7 J" E5 \% y. z7 _. }' o: c! qend
! y0 X5 h) f) A" Q: E+ ?' E+ n
* M, \, s% }) n6 S% A+ pbegin P_pick3 arriving
# w" x9 m) h, O$ I2 q    set A_i to 21
. u4 a/ x3 \# i9 {7 q* t% \4 [$ w- I    move into Q_induct35 Q3 B- h' P! r1 j* b2 Z
    move into pickaisle.induct3# y- x8 I' Q- U2 g6 j1 c( I
    while A_i<=30 do begin
& c5 {, {2 c! f! K        travel to pickaisle.con(A_i)  Y9 V/ m% g2 U- s2 y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  ?, F# @( A$ G: M( T% {* U
        else wait for 10 sec* `% R$ B5 L: w! H# v: p
        if A_i=A_leave then send to die  \( e: g  H# [- N
        else inc A_i by 1
) i! l. d2 t! j" u8 N. C- n- ~    end' h" z/ k. o# B
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是个什么东东?  `# {  r5 f) g+ x
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
4 B1 [9 M) }% P5 ?2 [7 O
$ X' v" g9 f1 M. vAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。, J( `, u9 ^9 n3 p- ~& z# O
+ l* ~7 t6 ^$ a1 H( ]# O$ i% }7 T
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, I8 Y! d3 `5 R( t. k$ Z$ n% l
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;& V) G5 `% ^) V- R
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;. L+ O. P6 @% Q; O4 g
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) \& J% p& e! h5 a+ c; @3 i
begin P_induction arriving
$ O7 F/ I. j& b. q. k    clone 1 load to P_pick(A_induct)+ j8 ^# ?9 @7 y2 g" X
end最大的系( R# ^4 s* s! e, r0 A, i

4 t# V: L1 k1 `3 j. S. b( ebegin P_pick arriving2 ]/ U5 R, ]7 m  i  s4 F& c
    set A_i to procindex * 10 + 11 _( _5 R: K3 e. e
    move into Q_induct(procindex)
' q  k) H/ `; `! F8 v    move into pickaisle.induct(procindex)4 I8 v7 R* K. B5 P
    /*check the type of pickaisle.induct(i), for your last problem.*/- m$ |( e8 y( l8 _; J# V
& C! ]% H- N" `# Y) {, z
    while A_i<=30 do begin" X- m% w( I0 k" k2 X, A6 Q4 O" i, {
        travel to pickaisle.con(A_i)1 i$ B# @1 P. x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& {& `. b" X% d7 m& ^        else wait for 10 sec
3 ^5 _: K; Y+ R3 H6 f        if A_i=A_leave then send to die
+ h2 d& g9 [+ B' ]+ @+ y) {        else inc A_i by 1
5 A) W0 v' I: g0 G% U    end
+ U  u* N) O5 x* Lend' l4 E+ U2 m( D4 G, N
. f5 C. e  i; T3 D0 C
其中的procindex为整形,代表当前process的序号。
8 h* `- ]) ]- ~8 W" Q4 Ostation和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-5-1 07:54 , Processed in 0.017025 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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