设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14228|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. X: J8 G# \" q# ~# U1 p3 G5 m; c9 S% V
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ c1 h% Q: d- R- ?% `0 h* I) B* C1 e' s( A: K
begin P_read arriving" w3 F3 \4 N) R2 ]$ l( R
    while 1=1 do begin/ z0 ^) e" r# {: m
        read A_tote from "data.txt" with delimiter "\n"3 g  a4 t1 M! ?. w. a) l. h  ~* v% o4 g
        read A_time from "data.txt" with delimiter "\n"8 V9 O3 ^2 [4 J8 N* I6 f
        read A_leave from "data.txt" with delimiter "\n"  j4 G0 P$ [1 i+ I/ f
        read A_picks from "data.txt" with delimiter "\n"
  c" B7 g7 S7 K: ^  {        set load type to A_tote, z5 ]( J, a5 t3 \
        if A_tote="tote 1" then set A_induct to 1  A& z- y9 w" d6 c* x
        else if A_tote="tote 2" then set A_induct to 2
6 F, X. F& |7 e- `) y4 i3 Y, n            else set A_induct to 3   
. ^' P6 m6 ]4 k, G* g        set A_i to 0
1 A# W" o# S$ ]$ N        clone 1 load to P_induction
5 n0 V( a) W& |& M1 Y' ]        wait for A_time sec
+ V; S8 j) K2 }, y) I/ W. T, w, S    end
% m! c5 I: }* J1 Xend
3 r! m; y! m2 c! O: U+ X. G" {
' L! L$ n) Q/ e2 M- Rbegin P_induction arriving! T0 v0 z  W0 \/ V
    if A_induct=1 then clone 1 load to P_pick1
- v- d  b" d. W& Y$ _    else if A_induct=2 then clone 1 load to P_pick2
' d3 D3 p* S6 V0 n: ~* p6 k        else clone 1 load to P_pick3& ^+ r; D6 h4 \
end
' m6 |1 q. n( o+ q/ n4 O" n2 U2 p8 _* c" `* h! }
begin P_pick1 arriving
6 u" r9 b' M6 J& ~3 Z: `1 r    set A_i to 1
8 x0 n4 U4 r1 ~% D$ w8 H# G" Q    move into Q_induct1" d% o  _9 v$ p9 C0 R* g  I) ?. n
    move into pickaisle.induct1
) ]! I# F! C5 ]    while A_i<=30 do begin6 L% R0 e& @( R* y, _. D) I( s
        travel to pickaisle.con(A_i)
6 {* i1 w) }, m0 r5 O8 p, `1 N# m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, P# W% a; g5 ]! |& N4 U
        else wait for 10 sec
, x, C" N: c  T1 k8 Y. S& ]5 `3 C        if A_i=A_leave then send to die: O4 C- p% y0 N8 U8 _
        else inc A_i by 1
2 A- \) h( g5 a/ T" h- o' p8 ?0 D    end
1 q4 Z3 f+ R1 C# _  ?/ E. Lend
4 h- q7 h1 V7 v, f+ ]
% l% K- `! `) R( ebegin P_pick2 arriving$ G0 C5 k8 \4 }5 d4 ~
    set A_i to 11
' ^- Z, o2 I7 x( D8 N    move into Q_induct2, h9 o- S! }4 r  w  M, A9 }
    move into pickaisle.induct2
% q0 u$ m, U1 d" c* b, C$ I    while A_i<=30 do begin0 i$ d; Z% K! L2 r3 A! E
        travel to pickaisle.con(A_i)
6 t9 r( s4 R+ M1 t# N* R: m5 n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. t# {5 a" s; I4 I. U        else wait for 10 sec
* H0 X8 y+ D8 `1 `9 X% X# v7 j        if A_i=A_leave then send to die# ~" O' }2 m8 C5 K0 x
        else inc A_i by 1) l  L9 Q4 e$ C. x. x4 D& j$ b
    end" ?: s. Z, O/ W9 n/ w: S
end
8 _# z. z$ F- T: g) O4 t
  _. Z* C# ?( ~, ~4 E" Abegin P_pick3 arriving- m, m4 M8 Y- R8 K; |
    set A_i to 21
6 w0 k: m' I$ ~; m' o, ?8 N+ j: b    move into Q_induct3
$ [3 a, Q6 X& R; w    move into pickaisle.induct3' E4 k" t# b* Z% b+ v
    while A_i<=30 do begin4 ^, M% p& t; m6 L3 z  Z' q
        travel to pickaisle.con(A_i)
( K, n* j! M+ H3 k' ~" z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" |) t/ \. e. y: N1 n        else wait for 10 sec9 c% t( a+ Y4 U0 T
        if A_i=A_leave then send to die2 {: O+ F! g" n3 R% b7 I
        else inc A_i by 1
* r* @# d, Q8 t: @( q4 s  M, `$ G    end( v- w- z" }6 U
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是个什么东东?% r5 E7 p8 `" f1 U( G
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
8 r8 K1 o1 z8 y3 T
6 b5 Z# ^0 D6 p- j7 R6 e& cAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) u8 N  S8 b5 z

) h) U  E3 l3 d+ F2 f另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
# g+ i+ K& A7 a: q4 _' \+ C1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
0 u: s2 d- M( P2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) ?7 t  J2 n6 |# o
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 Q4 l- D) h/ E: L
begin P_induction arriving
  j2 g2 l4 h2 p$ A6 R    clone 1 load to P_pick(A_induct)2 b$ I4 r* |. ^5 B2 r
end最大的系
& j# t2 ~3 R  g- d! l$ J: d$ ?9 Z: d  h( d0 ^
begin P_pick arriving) T" d' ^- _2 B" ]* D6 l
    set A_i to procindex * 10 + 1" g' B: ]7 K6 f! N0 |/ L
    move into Q_induct(procindex)
& v0 x5 q5 k: S% L& [) X4 F    move into pickaisle.induct(procindex)* b" k; H# {  q  P
    /*check the type of pickaisle.induct(i), for your last problem.*/( u! ~. L( T. s5 N; Z1 q, h

8 e2 w, f8 E  N7 s" }" X    while A_i<=30 do begin
( k0 [% p" w  g- b; w8 L# m        travel to pickaisle.con(A_i)1 p) y  ^! O2 C- g) M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 {9 ~" B# x- b' Z7 u7 Y3 b        else wait for 10 sec
  V9 ]& ]  v# u# d$ {. l        if A_i=A_leave then send to die: F$ G. H/ \3 m/ T
        else inc A_i by 1
1 q/ E4 Q; T0 d2 D    end
2 T+ c1 y2 K. {9 W) hend% G( S6 l2 q9 e$ p
4 L5 @$ V# i6 i
其中的procindex为整形,代表当前process的序号。
! E& s" Y7 ?* D6 p# zstation和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-22 22:44 , Processed in 0.014764 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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