设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15361|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢9 S3 I% G1 P  N+ |# I" r
6 ~4 ^; V  ?' b' a; x
我的问题是,在每个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中的数值,不知道会不会有什么不妥。( m. ~! j& _" V' W: T6 j/ z

$ R4 @/ y) Z% s3 X, \begin P_read arriving; s$ S* G0 B& F, V
    while 1=1 do begin9 W8 _; \, s$ L% A. b
        read A_tote from "data.txt" with delimiter "\n"
% ^( v, }$ P, K) I' c% H        read A_time from "data.txt" with delimiter "\n"
7 b% w* C! g+ P7 d. ]        read A_leave from "data.txt" with delimiter "\n"
; p* k1 N; o4 k8 L& [. l+ {  A        read A_picks from "data.txt" with delimiter "\n"
- y, a/ u1 @5 D        set load type to A_tote8 Z! q* h; S3 ^3 d# D; w9 k
        if A_tote="tote 1" then set A_induct to 19 H! R& `! Z  Y' M- w! P# x
        else if A_tote="tote 2" then set A_induct to 2) }' x) B+ t4 B- m- ]$ D: W
            else set A_induct to 3    : p9 s+ M+ S  N1 L
        set A_i to 0
5 o3 i+ |1 \6 V+ U        clone 1 load to P_induction8 Z' ~% p2 d( S2 Q; F3 e
        wait for A_time sec
$ s6 h/ w) x4 c9 {    end
/ U- V# t! T5 |" z1 J- n  z0 hend/ T0 K+ g+ R$ q& }

8 z$ K% I* D0 xbegin P_induction arriving
. b' p/ ^/ i% H    if A_induct=1 then clone 1 load to P_pick1
- `" ]% X2 E2 g# _/ t7 E. I    else if A_induct=2 then clone 1 load to P_pick2
4 o; c& ?% t5 L        else clone 1 load to P_pick3
. o+ B8 K+ L- |* `: ]' Jend
0 M6 e+ a" Q6 i1 X, `
- K( r3 ^9 G; K9 ~1 S: y$ obegin P_pick1 arriving
& g* o8 D" J4 h! s3 T; |% g0 q3 R    set A_i to 1' h6 y+ K- \: G  [, J
    move into Q_induct1# _8 S& X. c: {2 [0 t2 B" F' C
    move into pickaisle.induct1' ]$ g5 j  G) u; F- l
    while A_i<=30 do begin
; s- T+ ~  B! V  |        travel to pickaisle.con(A_i)
# F; [- q$ N) q: G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ _) ]8 E5 i9 I3 o9 ?% F
        else wait for 10 sec8 V3 V. S( X: U
        if A_i=A_leave then send to die
; h, E, N5 T* E' R5 d( g) o        else inc A_i by 1
2 _  h% T' n% `5 [5 O' ~/ b3 T8 I    end
" S! c) o) {& jend
8 I( o( l- m$ p* V: G8 j, N& [! A0 l  ~
begin P_pick2 arriving
+ e, @4 h  ~. {+ J4 i9 o) |    set A_i to 11
5 u, Q( b0 B# v    move into Q_induct2
2 S- N7 W+ m" t7 o    move into pickaisle.induct24 v/ ^" j  c6 h% J3 L/ k, X
    while A_i<=30 do begin
: y& Y, m  X: k0 I9 c        travel to pickaisle.con(A_i)% C) a0 ]0 W" ~; c/ S! @  m- \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, N3 u( [* H9 i( V  E% k
        else wait for 10 sec
& f- s$ F0 e  P: {' W        if A_i=A_leave then send to die3 l9 h. E5 [4 s* t* m/ L
        else inc A_i by 1
; o: R* s4 ^1 v- T8 \& a    end; o; P  j  `! I% {% ]( T
end6 I. A+ r. J5 v0 c, s

; N2 F# t  `( n' Sbegin P_pick3 arriving
0 V+ i7 I; _# f    set A_i to 21
; b) E% b0 O: @" y$ D4 s7 a$ @3 J' T* Z    move into Q_induct3
4 `% G% }" z4 r, Y7 Z4 x: c/ p    move into pickaisle.induct37 J# L8 o/ U6 S, b* ~
    while A_i<=30 do begin
9 k4 I( Y9 r, n+ f: p) m        travel to pickaisle.con(A_i)
3 V; p& K' x8 ]' ^% g: g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ _& L7 @: [: f7 V5 L        else wait for 10 sec
2 T" ^9 [. \" W        if A_i=A_leave then send to die
: T2 g' i5 q5 \        else inc A_i by 1& t6 R# _2 Q# S. m
    end8 I, x6 ~8 G; a7 b. |$ p5 ?
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是个什么东东?
0 W1 \5 @/ a1 a4 ~7 F$ X3 }move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
9 F- ~" W. J% Q4 t+ Q- }6 s! k
, v+ m* s. M0 d( t9 ZAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 d" O* u$ [# ~/ F
1 C& i! }; H" ~% _- \9 q另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:9 p4 U4 e/ ?+ W$ @0 }1 x) r6 _
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
' S2 P' u; h5 t# w8 J% f2 ?& Q2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 k0 n; g- r; W, N) y6 n. N: o
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 ^4 W; U. K2 k5 }: a! Y
begin P_induction arriving
1 u4 v( z, ^$ u( W    clone 1 load to P_pick(A_induct)2 V: ]( R; I4 i  G- E# N
end最大的系
; J+ R9 D- M: x4 m# ?+ z0 G" `6 _! k8 @7 D- @
begin P_pick arriving5 Z- I& g! t: Q
    set A_i to procindex * 10 + 1
* r3 o- q+ a% y5 g8 F4 ?4 g& z    move into Q_induct(procindex)! l- f8 p9 f# Z6 U4 Y: i5 k6 b/ j' }
    move into pickaisle.induct(procindex)
) I; Z& d5 ~4 ~. Z, a, D    /*check the type of pickaisle.induct(i), for your last problem.*/" L) ?, m" l) I. t$ f  p

' u7 _; Q$ r$ O0 ?; E    while A_i<=30 do begin
8 Y& h2 S1 A' X6 E) z, k" h( b        travel to pickaisle.con(A_i)5 B5 z- P8 F9 A  H& d8 @( t5 O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 U  o# E/ k' Y  ~& y        else wait for 10 sec
# M+ ]9 g$ ~' E5 u" L8 W' o        if A_i=A_leave then send to die
- i" z4 E: m+ y( X) Y: P        else inc A_i by 1
+ ]  [; |* G; ?, o- @    end
- B/ M8 T  O& ^6 u1 g* Yend& F) T) u8 r* p( {  q

3 I! |6 E/ P  ?% p1 Y其中的procindex为整形,代表当前process的序号。0 T- T3 b- E4 E: d
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-5 07:39 , Processed in 0.016809 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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