设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11919|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 i1 c; p% A; s+ z+ q5 D( K; R' ?. o' V- {, e3 B
我的问题是,在每个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中的数值,不知道会不会有什么不妥。- v, n" i( _. S0 _" |% g

6 C* @3 C$ D6 ]6 I4 J# Dbegin P_read arriving, N' d  ]* x0 U* r, w9 s
    while 1=1 do begin. `$ k$ K7 J" O" y- h* p" h, [
        read A_tote from "data.txt" with delimiter "\n"
  ]6 x3 b7 w7 H6 P/ M) e9 f        read A_time from "data.txt" with delimiter "\n". B2 a7 n) d5 C0 a7 d) G
        read A_leave from "data.txt" with delimiter "\n"
2 M6 c# C) n, \/ H: T7 B        read A_picks from "data.txt" with delimiter "\n"$ B8 O$ w. U: G( t0 D
        set load type to A_tote/ `( }2 C5 q9 U( x* u
        if A_tote="tote 1" then set A_induct to 1
; V3 w. H2 l( T9 n        else if A_tote="tote 2" then set A_induct to 2
4 D+ g$ ?7 b5 N( Z5 R1 C            else set A_induct to 3   
! ~: a5 D, E$ M* _# ~' L        set A_i to 0
! m! J6 s) g$ S, _6 d        clone 1 load to P_induction
. R3 t/ C0 S2 g        wait for A_time sec9 O6 o( V& Z! \: ]. `3 k
    end9 v1 }! q; W& j2 A+ A
end$ G8 L7 T8 s( S+ X/ @
& D9 w2 }$ v* d6 \+ r
begin P_induction arriving0 f3 o, D3 y. H$ }# t
    if A_induct=1 then clone 1 load to P_pick1
3 Y: N- ^% l0 a3 f( E. L    else if A_induct=2 then clone 1 load to P_pick2' d, z' i& ]" h! X+ G$ g# I- J
        else clone 1 load to P_pick3
& W0 G7 I7 w  z6 n2 bend
' o+ L- d, c0 r7 {" W4 B* \" @- L& p* K0 K
begin P_pick1 arriving
$ g/ C8 d. [+ n* R4 l0 \3 ^    set A_i to 1+ Q, W* j: X1 I% U4 [
    move into Q_induct1
. ^0 f" U7 U/ V: T    move into pickaisle.induct16 e/ u3 v: r- a" x5 H3 v: X& W
    while A_i<=30 do begin
% Q2 B+ j9 ]* }' H9 s        travel to pickaisle.con(A_i)
) `0 G2 B' Q- T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) ~. m& X5 E# e7 V        else wait for 10 sec4 H2 G( t' @, s: c! b" d
        if A_i=A_leave then send to die
) K2 ~5 g3 y9 K        else inc A_i by 1$ i( r7 ?% B7 R" L& f0 {
    end
9 u  O, S6 g. y% M& lend5 o6 l- T$ W& A3 W- a
1 Y$ _/ H, Z, |$ l8 V" a  g) A
begin P_pick2 arriving
' i9 Y' L. N; S- M1 _7 V    set A_i to 117 I5 E/ E6 Q# u5 Q3 a+ V
    move into Q_induct2
" |* ?5 ?& I. \! Q0 W* b" F' C; @    move into pickaisle.induct2
! m. q4 k! s: D6 X& Y9 d    while A_i<=30 do begin
5 k% v9 Z7 P- U; j1 @        travel to pickaisle.con(A_i)$ F% @- s! F& f6 j: i$ j9 }" T2 o; E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- t# i9 G2 E4 n+ ^4 o        else wait for 10 sec; t  D: _8 Q8 q% m5 a8 `
        if A_i=A_leave then send to die* o1 t* F1 ^6 {" S2 k5 V& y: d6 [& p; b
        else inc A_i by 1; A- x/ b; i  @. b# I" e6 {$ U3 ?; V
    end
% S0 n* b. ]! s! W7 V: yend
) R+ z9 g3 l* m" P. F4 r( x. _% |3 R7 \1 E! A# K' z
begin P_pick3 arriving3 {, o( K4 d2 T( I: G
    set A_i to 21( o- D2 V7 ]2 j8 X& ?
    move into Q_induct36 C7 {9 V, s) u1 l% f/ X
    move into pickaisle.induct34 g# H  p% e: _! ]( c
    while A_i<=30 do begin/ {5 B5 l* S$ I" T" f4 y1 e: \) W
        travel to pickaisle.con(A_i)
' R' b! y0 ^0 z; c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, ~3 l' c6 X8 g4 d" [% n, i        else wait for 10 sec) t) ^$ K' B9 Z  i6 c& `) J
        if A_i=A_leave then send to die: B# J/ d8 f* r$ n. N
        else inc A_i by 1: p7 a2 K* e! Z& ?: I  ?3 Y
    end
8 B9 ^) X5 G  Qend

最佳答案

查看完整内容

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 ]+ e. R, r1 Q) S
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?+ j  j3 {* |. Y

9 e6 F  |) m  d1 b. ]- p  P$ [AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 p+ [2 A: K3 _) N, c8 Y$ [0 Q2 [2 u* l
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:3 c: ~: p' z9 x* W
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 s/ m5 b( H2 c7 R  V# T, M3 p2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;- r* \' [) x* H
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 g; U1 e: C3 r
begin P_induction arriving
* m( C7 W0 e9 {! }* k: D/ Z# }    clone 1 load to P_pick(A_induct)$ I- ]# [4 q4 e, k/ W! ]
end最大的系3 ?4 U0 Y  t  X: l' H  M3 e* ~7 t

6 E$ J$ d+ B2 ]& O9 jbegin P_pick arriving
% T% [5 d# U! C- S- B    set A_i to procindex * 10 + 1/ h5 ]5 v9 C7 G
    move into Q_induct(procindex)
3 ?2 {: X2 ^( |9 \    move into pickaisle.induct(procindex)
7 P% J2 f/ q  J$ `3 O    /*check the type of pickaisle.induct(i), for your last problem.*/
6 c- U  |4 b  C( {7 i+ P! ?' f. g2 @) v( U: ~4 {
    while A_i<=30 do begin6 l$ t8 o+ [8 x' y; V
        travel to pickaisle.con(A_i)
2 i# p! \( s: p& e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- ^$ d1 o/ s$ }( ]7 Y/ @  i7 u
        else wait for 10 sec  E8 X& _) o; w- a
        if A_i=A_leave then send to die
, Z0 g- I9 |( m        else inc A_i by 17 X( G- [3 S+ ]
    end
; _) M5 J; h/ o, D( b# y7 hend
3 e1 @0 b, C; B4 w* S8 o7 |9 ~, q& D' J
其中的procindex为整形,代表当前process的序号。7 p+ ~2 k9 A: S, w8 M
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, 2025-12-15 10:56 , Processed in 0.015898 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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