设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13987|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& e  |- k9 I% ?3 m: C
( u2 a2 z* m' l: x; _" B. G  N我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 W  Q6 l. W' m1 b8 |3 \$ Q6 }- |
/ t% l% ]* ?4 N& \begin P_read arriving
$ e8 K9 b+ D% G6 n    while 1=1 do begin
* I, W( x4 Y6 |        read A_tote from "data.txt" with delimiter "\n"2 L2 U* R" F0 b% a
        read A_time from "data.txt" with delimiter "\n"5 k, Q5 g! t7 _6 k: n4 D
        read A_leave from "data.txt" with delimiter "\n"
5 |8 F5 m( O3 U* d9 a* Q& o3 T4 Y        read A_picks from "data.txt" with delimiter "\n"$ _6 {0 w& V' d. C  f+ `( j/ K
        set load type to A_tote
( b3 T/ N' b) g3 ^3 S' s- r        if A_tote="tote 1" then set A_induct to 14 ~- r0 K. I# R/ U
        else if A_tote="tote 2" then set A_induct to 2# }+ k# c. S- Z' }0 L) y  u( R
            else set A_induct to 3      e. ~- y, C: E6 F
        set A_i to 06 O# u! L; k& l$ \7 h+ Q
        clone 1 load to P_induction
6 y. h' @0 V9 C# S        wait for A_time sec
) Q; |  [( v! g+ h    end4 W* B; O+ G9 B4 C) r
end
; C. Y0 A. g1 T# R
- T) _9 u; n/ |" d" Obegin P_induction arriving; I+ j; J5 w" L/ \- c; A6 d
    if A_induct=1 then clone 1 load to P_pick16 _! _. y( I1 i! _7 \
    else if A_induct=2 then clone 1 load to P_pick23 I& W$ `# s0 ~+ t$ m* ~6 Z$ ]
        else clone 1 load to P_pick39 B& k, ^, L4 A: E
end
) g7 f! l% u' P3 Y( H% A( V8 {2 r8 ^* ]. F. u0 d
begin P_pick1 arriving. i7 ^$ u# i1 y: _/ u6 L! g
    set A_i to 1. g  H* W' N6 V
    move into Q_induct1
' k" m7 C& c- H: K; K( x3 K    move into pickaisle.induct17 b" j9 C/ d  d- t6 `  t# ~
    while A_i<=30 do begin) G1 r4 L, @9 N! Q" s4 `8 |
        travel to pickaisle.con(A_i)3 @9 [9 F+ H; A& w) \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) V4 d# o2 ~8 |. d4 P6 r        else wait for 10 sec
3 K% m$ e3 z- N        if A_i=A_leave then send to die
5 o& O$ T$ H1 g1 B. u        else inc A_i by 1  F. ^0 b8 C) R, M
    end
& k9 Q; e' ?6 N; `4 e# F* Kend
+ N7 a: w2 B2 ~# |! o) `, W5 L: h: A8 @
begin P_pick2 arriving
# _/ U5 L/ C4 ^" ?' l    set A_i to 11
8 |" V$ M3 D" l7 A  O    move into Q_induct24 |' X; B, G9 d: N8 [7 e+ F. V0 _  {
    move into pickaisle.induct2. |" B  \9 ]7 p
    while A_i<=30 do begin
1 u0 l+ }0 b( m" j        travel to pickaisle.con(A_i)
: b; Z$ K8 n7 i. L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 y3 W; A' J* E" \0 e        else wait for 10 sec
# _2 j- @* g, f$ m% R6 T! T* c' F        if A_i=A_leave then send to die5 a/ ~- }5 J) e9 p& O5 ~& h
        else inc A_i by 1
$ L& Q' E. m+ A- `; [2 e# E( y    end
7 G) ^/ U1 V+ Cend
) _& v" z) l( @2 \9 P8 i
9 p' R% K$ @; ^1 ]begin P_pick3 arriving- O6 B' C+ f6 _; O/ M
    set A_i to 21
6 z0 o# D" Q. K* b# [. T" \8 A    move into Q_induct34 _/ y: S2 [; H3 V
    move into pickaisle.induct3
  X# g& G& M* d    while A_i<=30 do begin) k0 m6 F# b2 N
        travel to pickaisle.con(A_i)
& ^  R' v9 s* ?$ s* J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' L$ R( _' }1 _" ^7 w2 H3 p0 u1 R        else wait for 10 sec
* C, o$ {* U. Z2 P& [! i+ k        if A_i=A_leave then send to die! V& }7 i9 H1 o* I' P
        else inc A_i by 1
* ]1 n- y. Q* m" I* e: \: ~    end4 N/ v# }5 s, R! M0 \8 R6 ~2 z4 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是个什么东东?0 V' [. `2 q$ r: t3 N) l
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?7 O1 x# i, Z/ f

: T! x. U/ q7 ~- y9 R6 f+ HAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。4 {: H* u! @5 w0 M+ }

& a2 g( y. m5 d( i另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:9 p& Z9 ]8 I1 C$ s0 B
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
* U  u5 T" D9 k2 [; L. O/ q2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( D- v- r9 E3 r9 E% ^3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
# x4 W9 ~4 h- Pbegin P_induction arriving$ ?" e4 i- [) X' F. N" Q$ b5 O  h0 U
    clone 1 load to P_pick(A_induct)
; h. G/ h5 s9 F% y3 A1 Eend最大的系
: I- k% ^  I9 O/ ]4 {* n& R; H
) g+ P' ~0 Y8 p% Mbegin P_pick arriving) j$ H" z' t7 h" G* ^& Z6 A8 H
    set A_i to procindex * 10 + 19 r/ m% a4 p7 R6 |; N9 @
    move into Q_induct(procindex)
( n+ Y# J0 h$ B5 q) T  e; |    move into pickaisle.induct(procindex)
$ z1 w) @9 Q, n, D- G1 G    /*check the type of pickaisle.induct(i), for your last problem.*/& e8 h. S6 a! ?" j/ e6 |9 `
, V) ], d3 |) _; k7 n
    while A_i<=30 do begin4 P/ E- J; @# D. e& R, {+ I% T
        travel to pickaisle.con(A_i)! Y" r+ ~! ~9 P( K8 y! Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* ^- `/ F% {0 J( x3 l        else wait for 10 sec
2 Q! x0 r3 K+ N. R9 `5 \. T        if A_i=A_leave then send to die
7 B7 X/ T1 t2 Y$ ~' p: [& ?        else inc A_i by 1& l% R. Y. k9 B3 T
    end/ y: j: W* d4 T; l2 V- q8 [
end) Z6 f! M/ O% b  L

! R! s) r  \9 F* L3 ]/ y其中的procindex为整形,代表当前process的序号。# {2 B7 V, W5 @; k% j
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-5-27 19:12 , Processed in 0.013221 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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