设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15426|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ e7 w# |2 S' M+ i
# }9 z' `/ X* o; z! I( L; c% @: y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ G( J) [5 z0 C2 U( I0 y
: G9 \' _) L, o2 A4 M9 i( `0 x6 f/ h
begin P_read arriving
5 g, g. S: M& u0 o2 t  m    while 1=1 do begin
' u+ Q8 U) ~/ m9 v$ P4 G6 y        read A_tote from "data.txt" with delimiter "\n"0 O- _, I6 A- J$ ?! ]
        read A_time from "data.txt" with delimiter "\n"4 A. c& m: N3 i$ Q0 S5 S
        read A_leave from "data.txt" with delimiter "\n"
" w" ]* [' N1 s        read A_picks from "data.txt" with delimiter "\n"
5 L% x( k+ r0 p0 N9 t        set load type to A_tote, s. f$ C# ^% x5 U, m
        if A_tote="tote 1" then set A_induct to 1% v% S$ U0 E1 F! I) [- p
        else if A_tote="tote 2" then set A_induct to 2
6 W1 `) d& w# t$ K7 I0 K+ V            else set A_induct to 3    ' J( P* ~) p4 v* R+ G6 }" U4 t. ^
        set A_i to 0# A' z$ ]. E. c2 [4 V  V
        clone 1 load to P_induction+ y- ~6 m) n! M% `+ N
        wait for A_time sec/ n% {$ D; g: p' P& u
    end
1 g2 Z" a" V/ W2 \" ?& ~end% f: i! s2 y0 r. D- T5 y
, [9 S7 o1 i% j: W4 I
begin P_induction arriving
/ q0 |$ O. E! K1 @    if A_induct=1 then clone 1 load to P_pick13 T0 y- K' }. j# F& S
    else if A_induct=2 then clone 1 load to P_pick21 Q3 t% O; @# F3 t6 V) U
        else clone 1 load to P_pick3
, }: L& @" i/ J! A, v) ^$ n5 Jend; m/ b' X( K5 [/ V8 Q1 e6 o9 M

% t/ l3 d. f& R1 pbegin P_pick1 arriving3 |  Z' }% Q4 g
    set A_i to 1
, ]& m) {' X( r1 i/ X) @    move into Q_induct1
, y" O5 o, x: F9 }4 y) b0 J    move into pickaisle.induct1
" E' m8 [1 a8 C    while A_i<=30 do begin
; v5 s; x; J% Z/ Q        travel to pickaisle.con(A_i)
) O# e7 Q" g5 Q( o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' i3 _+ T" R" f! P9 \: M/ c
        else wait for 10 sec
& n& _( R# V7 D9 d" ?6 F9 m        if A_i=A_leave then send to die* T) s8 b' ~  F3 {0 s! f
        else inc A_i by 1+ W' `2 b8 V, J" i# Z
    end
3 r5 @; d1 Q$ E! ^4 v2 {% ]end
; k8 I& U$ N' E: D8 m) u
; v" a- M, ]$ Jbegin P_pick2 arriving+ u& m! Z" g* i/ h
    set A_i to 11
6 {) m  R- a, w, h$ t0 u    move into Q_induct23 L) h# v' _% f% e2 o7 d* _  C( W
    move into pickaisle.induct2
+ E/ E) ]: `8 R% \    while A_i<=30 do begin- p! j& A. w4 L7 Z6 N
        travel to pickaisle.con(A_i)& x9 B" V6 ?) ?( @# V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' b$ z3 ]! O' x# J8 T        else wait for 10 sec" r- a4 o7 z: q1 ~- }* x
        if A_i=A_leave then send to die* d/ H1 ~9 y3 @& ^6 B* R
        else inc A_i by 1
8 ?: O2 A6 ~3 l  G! _! s' v: Q: [    end
/ e) N* P4 f9 _! Tend
. m6 |( [9 R2 z$ v
7 @6 p: s5 _. c0 r9 Qbegin P_pick3 arriving
3 K1 s4 E  h1 |9 a+ p    set A_i to 21
) D8 x  m1 w5 t7 ?" ^+ l    move into Q_induct30 n; b0 R3 i7 u1 M  i; W  c% E
    move into pickaisle.induct3
) y) z6 {5 k. \4 [; ?1 r& }    while A_i<=30 do begin
. _# H  d& E/ \6 ~. q' G) q' H        travel to pickaisle.con(A_i)
0 i9 D, ], x' i* j# ~. W4 x1 I* ?1 x3 D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 \+ n8 o2 E; c        else wait for 10 sec4 U$ f8 v0 E2 H# B
        if A_i=A_leave then send to die
9 W: z" u( n) n0 J  U        else inc A_i by 1
/ x4 S- ^  v! J* }+ K. M- u    end! }$ I! r" y/ |4 t/ O! o& L
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是个什么东东?
8 P* W, V! a; u* ]- @3 m( Jmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" K; L5 a" D7 G1 ~, M' K3 h& d
9 W( `4 T4 M# [  q/ Y
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
' }! e* I. Z9 C" Q3 [6 [* p1 Y) f6 c, O' q
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ T% _  s) W! I3 T1 H' k
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 N. S2 N- e5 O7 ?9 T
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;( u! S& \4 \$ `& s
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 ~! @% q' f  i6 B5 v! X1 f# @
begin P_induction arriving2 J, Q% E$ [0 h4 D& I
    clone 1 load to P_pick(A_induct)
: H9 Q# q$ e9 b+ O2 Qend最大的系5 a4 D' a, o" T' l) W0 [

) m& K! Q$ G% s* W4 pbegin P_pick arriving
9 S1 o& P4 B0 C" l    set A_i to procindex * 10 + 1
7 N. j. h& E& U6 o    move into Q_induct(procindex)
+ ]1 z8 ~- F1 @) m. g% E    move into pickaisle.induct(procindex)( E3 X: P0 \# i2 K
    /*check the type of pickaisle.induct(i), for your last problem.*/5 x7 W* `7 n  o* ?, j3 `
2 _  e7 y& K9 ^1 g4 j5 B) n
    while A_i<=30 do begin* R( K1 Y9 u  e/ a0 x+ `
        travel to pickaisle.con(A_i)
" [' M& e( I3 u1 ]/ V6 s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( b) @9 |6 M& k        else wait for 10 sec9 I, L4 v6 n+ \  w3 C$ i
        if A_i=A_leave then send to die
) e+ }, R2 Y6 I9 z9 ?        else inc A_i by 1
6 b+ ^. ^, Y/ {) S    end
( a( |2 Z& f' jend
' o5 r2 R( J6 V5 Z, t0 ]) l1 M. }( h& s* K8 [
其中的procindex为整形,代表当前process的序号。: Y5 K; z% B4 `9 t
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-9-10 12:56 , Processed in 0.014270 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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