设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14027|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: ?8 Z+ n& x& L1 }0 T- v
$ F7 q: y0 w2 N- J% V  y: `" E我的问题是,在每个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中的数值,不知道会不会有什么不妥。  x2 W- C. C" C4 }* V, i3 l
  V0 R7 U1 P: ]' u
begin P_read arriving# V" |! b' I6 L$ G
    while 1=1 do begin
5 y2 b" O: @1 G: V8 R. \        read A_tote from "data.txt" with delimiter "\n"4 t4 l2 M2 X4 r7 O' I! x3 @, @
        read A_time from "data.txt" with delimiter "\n"  v+ j$ K5 ]& ^
        read A_leave from "data.txt" with delimiter "\n"1 C+ Y8 P' p9 ?
        read A_picks from "data.txt" with delimiter "\n"
% y! v+ `% B; s' F8 h        set load type to A_tote
) G4 p. T+ _& u, o0 E) y        if A_tote="tote 1" then set A_induct to 1
! {% h8 `+ x0 [1 u& s        else if A_tote="tote 2" then set A_induct to 27 S5 |5 E! [3 G$ u( M  B
            else set A_induct to 3    ; q9 s8 D9 B# H$ Q+ F3 K2 T5 w0 A: P% Z
        set A_i to 05 \% j; x, i! {5 t) [5 a7 T  y
        clone 1 load to P_induction0 Q' p* Q% [' J# e( F( _$ {
        wait for A_time sec
3 b; V( a# Q2 b3 `5 Z    end
: i1 C* S/ b) o3 N) p# P  ^" Eend
5 ]* M  O3 S; x" P5 m( ?8 }
9 T$ u, i7 |& v# I* c) Q" u0 cbegin P_induction arriving
: g4 O9 y( `) g& R! ]3 S    if A_induct=1 then clone 1 load to P_pick11 s2 l+ N# I+ X8 N" o
    else if A_induct=2 then clone 1 load to P_pick2& S2 C* F2 H; a3 @; M! C' f
        else clone 1 load to P_pick3
6 Y5 E* o5 c/ mend
$ N9 D  O( }9 R. F+ b& w$ z+ x. [/ c, C: f" Y; I- U
begin P_pick1 arriving
. {$ L6 R4 b: F: ^. }" o    set A_i to 1
3 r# ^3 o3 Y2 }% W    move into Q_induct1
. H, o4 k* g+ Y0 `$ C: o" b& V  n    move into pickaisle.induct1
% F! B* I9 E. t' f. n* l! ]3 C    while A_i<=30 do begin( Q( w; [' V0 l- M. m9 h7 j
        travel to pickaisle.con(A_i)
  s6 Q( W- ?% z5 s1 c# ?8 r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 q2 u2 P  ]0 s7 i4 u& K/ F" X7 ?; r        else wait for 10 sec6 m8 }2 S& v. V" G
        if A_i=A_leave then send to die$ c" i* i" F0 F' @
        else inc A_i by 1
5 V; I3 j: r4 C/ W$ R    end
0 A5 U/ G+ Z) U: g, zend4 ~/ S) G# P& K, P- T
1 e% `( `' e$ H; y& \
begin P_pick2 arriving
" {8 G) Y0 M6 o7 U6 L5 E" D    set A_i to 11
0 ?8 v. [( ?2 G$ c+ a9 [    move into Q_induct2
4 f* w/ {6 L1 t0 M! u    move into pickaisle.induct2
& c2 P8 E( I* U9 h7 l0 P    while A_i<=30 do begin- ~6 t' N% B/ S) o! B4 x8 M' R
        travel to pickaisle.con(A_i)
9 @! b7 K: m4 U2 _6 v! b$ n. S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* f7 h* c; K; `4 R: O; H* M        else wait for 10 sec7 [9 [' @, F5 c: z" a
        if A_i=A_leave then send to die, F8 n/ A$ w) ]4 _. y
        else inc A_i by 12 ~( k0 [1 w6 U( a: p# U7 Z
    end6 s  ]  O0 Y* i2 x: C  B2 f( ]
end% x; ]. t% W5 y  V$ z

( e4 Y: H" d) Lbegin P_pick3 arriving, d3 C3 Q9 b) {# C- D
    set A_i to 21" }5 ]7 R" f8 x5 O- Y6 f* j
    move into Q_induct3
/ j2 W3 n; e% H6 d: G    move into pickaisle.induct3
' {: Q6 T9 i/ o/ E    while A_i<=30 do begin1 n' M0 M7 w1 p* F% o( @0 I
        travel to pickaisle.con(A_i); L( L' g8 V8 h& G& t( D) d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ ^, h2 U. P( w% E8 A' z: d0 O8 ?3 j9 ?
        else wait for 10 sec: k# a4 ?- G* G
        if A_i=A_leave then send to die
) y) ~  Z; ?) {. P, }        else inc A_i by 1
/ S' C# B9 t& ^/ ^    end
- y. v+ E4 R8 C% y- Z0 jend

最佳答案

查看完整内容

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是个什么东东?- Y/ U: Q" K/ C8 I; S- t* p# H) X
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
- B& O' R# [0 c/ i* |8 \+ ^, y2 Q* t2 ]
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
; A/ p, Z6 h! |/ Y* v
' z: G3 \. L4 X5 X% ^, u/ u. X5 d另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 N( m7 A) x. `$ S
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 Y. ^3 V) c. a" j7 X
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;/ {6 s3 f2 M# x0 J
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
# G3 D, F8 A/ V. w- D$ G( D2 rbegin P_induction arriving- a; ^  O% Z* A6 c' B/ b! K
    clone 1 load to P_pick(A_induct)
/ a1 d0 M" g7 t5 |- R0 jend最大的系6 G, a& I) j) \# t, e

0 Y! s0 k. ?& k4 S! |4 i& jbegin P_pick arriving
0 o; P1 d9 x( K. |    set A_i to procindex * 10 + 1! i6 w4 E% Q: a3 Z5 b; n- P
    move into Q_induct(procindex)2 j( H9 `& X% X+ J+ q% h0 X4 H
    move into pickaisle.induct(procindex)# V& P5 f+ @5 q7 q# v6 v; T0 M( a
    /*check the type of pickaisle.induct(i), for your last problem.*/1 ?( {# J$ F2 u" [
4 {/ [4 W" Y( ?/ a
    while A_i<=30 do begin  |5 z3 T; g( G2 f9 w' p
        travel to pickaisle.con(A_i)7 S! @0 s8 l+ {, ~% }2 s" C% i2 M" B8 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' q" i6 r/ H5 T, P
        else wait for 10 sec& w; o& G& u' r: }' `
        if A_i=A_leave then send to die8 Q6 n, m# L4 ~
        else inc A_i by 14 a% I9 O' X1 M
    end8 v# X& N% l* `' @# q* Z
end
( M+ K: ^. ~: j1 X( b8 B( C- s4 P# Z# ?" M
其中的procindex为整形,代表当前process的序号。
# I& O% _2 u; s- U" d1 |$ R$ Bstation和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-1 08:50 , Processed in 0.013902 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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