设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15498|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ j% ^; W* k8 g$ L) b$ X
+ u: t" `' ^9 U; g我的问题是,在每个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中的数值,不知道会不会有什么不妥。, q0 [7 C6 p. T, G, B1 c, `

# X) r" z, v; n2 f* Hbegin P_read arriving
- F8 M% t) _9 S' C$ C) P1 g    while 1=1 do begin
; G3 y* |3 ~8 m0 m+ v  _% B        read A_tote from "data.txt" with delimiter "\n"! ~. n' x% I9 v7 E- u+ r
        read A_time from "data.txt" with delimiter "\n"
* e9 s4 w' n+ E8 l) y        read A_leave from "data.txt" with delimiter "\n"
: u/ m: a" M( p% N# b        read A_picks from "data.txt" with delimiter "\n"- I* f3 l5 }& S4 ]; p
        set load type to A_tote" o6 \& Y. |4 e( F3 [
        if A_tote="tote 1" then set A_induct to 1
0 ]2 V6 ~6 n  o        else if A_tote="tote 2" then set A_induct to 24 n" V8 T. i; ?5 A. R
            else set A_induct to 3    ! ?$ a9 z  ~* H) s
        set A_i to 09 j' [) ]$ g4 D. p  ~) A
        clone 1 load to P_induction
' U' \; l3 g: o6 m/ w" Y        wait for A_time sec
: \' @3 G3 @7 K6 J  s    end8 {/ |1 V$ C  s, s: a9 G2 M5 T
end
* k! z7 ^$ e5 ]! P' r
- s; _0 U9 p6 L3 qbegin P_induction arriving
2 r7 Y" H& K8 y5 \; R    if A_induct=1 then clone 1 load to P_pick1
' K  m$ I7 ]0 }' L# L0 t& n    else if A_induct=2 then clone 1 load to P_pick2$ U: O; P7 Z+ ~/ E5 y* Z3 e
        else clone 1 load to P_pick3
# [; r: s' p9 P" j0 i" a7 M* Wend
( N( J" S, ^0 t9 M/ }& t6 s8 P  @* A( K; ~8 P6 t
begin P_pick1 arriving$ n- h: \" F3 G: |) k: B; U
    set A_i to 1
# w+ w9 f, D( Q6 ^    move into Q_induct1
6 J+ L4 D* D6 j" y. ~4 U    move into pickaisle.induct1: Y  z  ^3 H! T: Y$ C  t1 Z6 k
    while A_i<=30 do begin& j1 z3 R5 Q- c$ u" b. G, U
        travel to pickaisle.con(A_i)
7 T' v4 h! n5 a" ~7 i: G/ U' k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 P1 M3 @; }. ~+ w        else wait for 10 sec; P$ m' l1 K# i3 r( h$ U
        if A_i=A_leave then send to die% X2 K9 {5 T1 V; Y% s2 ?, O
        else inc A_i by 1
/ {- q4 t) j3 y; _9 X; d! H8 A    end! r5 Y1 M: T$ i7 U$ o, P4 I! T
end
. ~1 i+ B2 O- o) r* R
# \" _* n3 a& d. Y- v/ d( [9 wbegin P_pick2 arriving
4 o! f# W  \! X3 D8 N, X    set A_i to 11
& v3 H' @7 T! E$ g! q6 @# Z    move into Q_induct2, c4 g( n- v1 V# q
    move into pickaisle.induct2
9 H. s$ p' `* I, H  M    while A_i<=30 do begin
) d0 W3 R: m% `        travel to pickaisle.con(A_i)
& X, n- ~6 L2 a) b/ I7 S) X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 M# _7 {4 l: f- t        else wait for 10 sec1 Q3 t7 B7 p; o. h5 \
        if A_i=A_leave then send to die
- ]' G& z+ u; O3 o/ M! o        else inc A_i by 1# i! ?" F& u1 C8 @6 ?9 E3 x9 T
    end% J* T3 ^6 V+ ?5 H, C$ b
end
( i# m' z( C% E! [( M0 Y! n% G  Y0 n
  j4 q1 X( ?, F; J3 abegin P_pick3 arriving# C+ p4 x* H6 M8 p' \
    set A_i to 21
$ o3 g' G! L$ a    move into Q_induct3# A+ q5 I7 s  `5 o
    move into pickaisle.induct3# M0 o/ ?1 W; L0 m: N6 Z, s9 S
    while A_i<=30 do begin! c# H2 K# g/ S9 u# l7 J
        travel to pickaisle.con(A_i)
- ]% d+ \$ O1 I0 ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ V& V9 z& U) D8 T
        else wait for 10 sec- j* @: h+ G% y2 S. I/ J4 A
        if A_i=A_leave then send to die7 d: U% Z" m, D. `, P
        else inc A_i by 1; u7 b, p# z  b# z& v
    end4 b$ a2 y; v0 f6 T
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是个什么东东?
3 {: h8 }/ q9 J& u  Nmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
; q9 N$ l. r. Y: E; A+ N4 ^* r- K7 P  o0 U2 e; r  N/ y% k
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ L* b9 `3 ]9 W) s6 ^  Q' ]

0 m. G1 l' H% }, z# j: K另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:* o& t3 F& D, _( q. l
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 a) W" b( I0 P* W: b+ k2 E2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- C( B7 N) O( T' Q& D* q% `+ F) h3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  H( i' S, |* t3 T7 gbegin P_induction arriving
" \4 R$ ?3 A. k  K2 V) p    clone 1 load to P_pick(A_induct)8 U8 B9 ~2 o1 f% ~
end最大的系- v" D( h! s$ R+ q

3 e- B# d% c) W1 gbegin P_pick arriving7 f/ {1 A, M1 C; U
    set A_i to procindex * 10 + 19 E7 K% X/ N* s2 V* m1 O
    move into Q_induct(procindex)
( H1 u1 b6 ]% J, d7 K' v+ c    move into pickaisle.induct(procindex)
6 |  {; N) E% z    /*check the type of pickaisle.induct(i), for your last problem.*/
7 |$ j# n/ X5 B7 A$ N; e. Y4 l: X1 p  j
    while A_i<=30 do begin: V/ U) m" k/ s7 O. }4 u+ I
        travel to pickaisle.con(A_i)6 _, u# I, J7 W% l7 o, m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ b( C% o" a% J+ o) x        else wait for 10 sec% S' |! r2 @% P; z" x
        if A_i=A_leave then send to die
( R! B# L$ ^6 K3 h1 ]1 G7 `        else inc A_i by 1! t0 e! k& e! ~
    end
5 c; b+ f# N  A8 h8 Vend
: l( u+ H0 m: r# f; s+ x9 S, c2 s; e4 P$ t8 I/ G' A
其中的procindex为整形,代表当前process的序号。" p, K! Q  r4 C; ?
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-15 02:35 , Processed in 0.017059 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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