设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11912|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* L9 x) P# a$ z  |5 v
/ |( F1 |. t/ W7 y0 `- H1 h/ \
我的问题是,在每个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; v$ ^) M5 M7 o! x: e& \+ |9 x2 \( i' u6 ^8 |
begin P_read arriving
# ]3 U+ H, W, R9 t    while 1=1 do begin
, ?8 a6 x. }2 O$ E        read A_tote from "data.txt" with delimiter "\n"$ J& J: Q- ?: f$ E# j, w' P& d
        read A_time from "data.txt" with delimiter "\n"
3 A8 J/ E' Z% o: k# |0 C0 }        read A_leave from "data.txt" with delimiter "\n"
  |: D, l4 n* J6 h& o7 ~        read A_picks from "data.txt" with delimiter "\n"
+ S+ s# X& z; E, Z4 S% d        set load type to A_tote
/ B( p! Z1 r, e& n9 Q0 l        if A_tote="tote 1" then set A_induct to 1# k+ h  Z8 g/ E  v
        else if A_tote="tote 2" then set A_induct to 2
" k: Z! m# ]2 Y) G4 y            else set A_induct to 3      p6 A/ U& o9 p/ b- f2 C
        set A_i to 0
0 z" O7 y/ |" z( b        clone 1 load to P_induction+ H. x8 ?8 q" Q8 s* v* l. `
        wait for A_time sec; x0 ^: Z+ H! J) O4 f
    end
3 M) r! o! ^  z2 l0 N4 Dend
2 `0 v  N: v3 O. V& I
9 k  X. C% u; C% L; U0 Mbegin P_induction arriving+ Y6 g$ |, ~/ v
    if A_induct=1 then clone 1 load to P_pick11 P  y3 Z6 Z9 O1 w1 N' R, I# `
    else if A_induct=2 then clone 1 load to P_pick24 D( O& ^3 n1 z
        else clone 1 load to P_pick34 a' e& b  X8 X3 x# K2 Y- L
end8 L" J: ]% @, u/ ?( a1 m

0 f, p% c  \3 r2 L" n0 x  Xbegin P_pick1 arriving0 K7 T/ E2 L7 m% }- t3 Q
    set A_i to 1# H: S+ M7 |5 e
    move into Q_induct14 H7 h: Z0 ^/ Q6 }9 L
    move into pickaisle.induct1/ W% B. W# P  l3 d
    while A_i<=30 do begin
0 T% U7 [- K" ]$ F0 B0 |        travel to pickaisle.con(A_i)& m/ r  e. x; D# D: o' b9 [7 C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 Y; a! l: ]8 C, a$ _        else wait for 10 sec
6 G, [8 N3 K  W: y/ P; p7 |        if A_i=A_leave then send to die
" Z! N1 j8 q7 U3 Y. q        else inc A_i by 1
2 a# Z* N2 ]% s& y& x6 u    end
. Z' y; X4 C# d$ hend
, O5 V8 b8 }. M+ T
; P& d6 s5 L# |& u: V5 f0 ~7 cbegin P_pick2 arriving( a( l+ W9 P8 j( |: s
    set A_i to 11
0 _( z' f9 S) T8 _; `    move into Q_induct26 c2 |/ s/ v' G. Z5 h+ o# W
    move into pickaisle.induct27 |8 r: E; R' {& V2 r% `% F, g
    while A_i<=30 do begin4 {) v2 L  w/ X. I
        travel to pickaisle.con(A_i)2 H, F# i! h$ Q4 O2 i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ P* a! r& C; }/ Z4 C" x7 K
        else wait for 10 sec
; Q; v; s- K) ]: B- P. N4 e4 c" H& V5 d        if A_i=A_leave then send to die
, }- N4 C: o( H+ }( i        else inc A_i by 13 S+ }+ m, W* m* Q- B+ h$ ~
    end
+ F+ h2 ^/ k1 `# `end
4 W  K, W0 Y3 K* D
0 ^+ P% U2 u) d! ?5 [% Vbegin P_pick3 arriving. x+ C5 n9 n! Y$ s9 E" ]2 r5 ]
    set A_i to 21
7 H) b+ M4 k( G; n/ r3 C    move into Q_induct3
% d# u; \$ i, U' A( b9 r/ h    move into pickaisle.induct3
/ J% D4 r, ^2 x; E( c, D" N    while A_i<=30 do begin
& l8 V  o4 ^, D7 l. e7 `2 v0 J: l6 E        travel to pickaisle.con(A_i)
+ i+ V8 z- o8 f' t& t' `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 Z7 t. R! O2 {$ Q' q        else wait for 10 sec
) W) q: r8 S! d. B; Z; t        if A_i=A_leave then send to die3 _' ~+ c' c- m& K
        else inc A_i by 11 `1 t6 Q4 S; ~0 p. z
    end
% A* \  R3 |# k4 h; D- s- Oend

最佳答案

查看完整内容

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是个什么东东?2 n' G% O/ K  Y/ ~9 V+ g# h  a8 A6 f
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?; T9 `0 K8 x" l4 h! [6 v

/ s7 G0 f% z- X$ k8 J+ M3 fAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 j* p. P$ q" A
" L- R' n0 @" k& G; D# h
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
. h. N/ M6 O2 p- Q' U4 b1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* |6 R- t, {/ b8 ~- O! u
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 j* U8 i" I4 F" H) I9 r) I3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 x# J9 n* a/ j% b3 |0 I9 W
begin P_induction arriving
; |8 i. m) G9 ]4 A    clone 1 load to P_pick(A_induct)
+ ?) ~* q' o( [6 Vend最大的系9 ~+ Y6 A7 B' E- I! h* H8 @

7 ^% h6 w$ N7 `4 [" X) tbegin P_pick arriving5 {* O% I( H7 e" I
    set A_i to procindex * 10 + 13 H/ a6 V3 ~/ g& J. l# I
    move into Q_induct(procindex)
6 A+ T* ~( n# x# D( g. v: A: s    move into pickaisle.induct(procindex)
+ U  O- p5 K, O. i* [* ~) `    /*check the type of pickaisle.induct(i), for your last problem.*/4 B2 W% X' e$ b

; x$ o! _8 n- I8 h# ]    while A_i<=30 do begin
; d( R* \% ~) z+ i        travel to pickaisle.con(A_i)0 }5 D& N( Y9 B. m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 m  O$ m$ Q$ n! w
        else wait for 10 sec
% y% ?# u$ ]% J8 }1 P7 q& W        if A_i=A_leave then send to die5 T+ e- X. T0 i( i1 T9 ?
        else inc A_i by 1. `: t5 }% n7 V" F6 e6 w) i& W5 @
    end9 O$ _) s+ o$ E! t* {( `' E. [
end
  w6 t& f+ Q- S/ N8 V# c/ j+ k3 V  ?9 f" B1 s- `' Z
其中的procindex为整形,代表当前process的序号。" o: s% V3 y% }) n, a0 w$ V6 r3 ?
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-14 18:59 , Processed in 0.013647 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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