设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12070|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& S, P' P! R" h6 P

  Y( C3 Y6 z6 K: H. E+ e, r我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ y3 d* J  w" s
9 R1 H  n# m. j  Z3 q
begin P_read arriving: h$ T  d- ]6 R5 H( N2 o
    while 1=1 do begin
  F% ?3 y% B' I- G2 }4 z  H6 I        read A_tote from "data.txt" with delimiter "\n"( S. o1 M3 {( u) F1 W9 K
        read A_time from "data.txt" with delimiter "\n"
( M/ i$ f) u( ~7 N  ]        read A_leave from "data.txt" with delimiter "\n"1 f6 t! k& t5 A9 m* v; o! R
        read A_picks from "data.txt" with delimiter "\n"
* K0 Q6 r! o" S+ U: K, E        set load type to A_tote
' u: R: |5 ~* K0 r' i        if A_tote="tote 1" then set A_induct to 1
9 r7 e: o# m& K* z6 o1 k0 E        else if A_tote="tote 2" then set A_induct to 2# |0 _- Q. s/ [& I7 d1 r
            else set A_induct to 3    1 R& \& h% ]# o! A
        set A_i to 0
* H. S. q- i7 d% Z        clone 1 load to P_induction
% a% l! i3 F6 Q$ ~' |        wait for A_time sec& y: v% E: F& o0 R# _2 w
    end
# M4 ]* s5 a& send  ?" h8 C9 n, ]

9 O6 l/ a& P1 ]0 Fbegin P_induction arriving- j- |- k( J( h6 P) R
    if A_induct=1 then clone 1 load to P_pick1
6 g+ |, X  `) ]    else if A_induct=2 then clone 1 load to P_pick2
' n- n7 M! o3 P  M2 o! Q        else clone 1 load to P_pick35 u0 F6 W  W3 A3 y
end6 c* }0 u" t$ o% X0 X% L; [

; k, i5 a9 Q/ P  E9 @% h, Hbegin P_pick1 arriving+ o! C5 {  Y# k/ V1 _8 h: h4 [' v
    set A_i to 1% j) y: d4 C; [/ R
    move into Q_induct1
7 |5 i+ v$ X9 `) y8 X4 G    move into pickaisle.induct1
. n# a4 f- J0 a$ t- i    while A_i<=30 do begin" e, R7 @' ~0 `! T; q' u
        travel to pickaisle.con(A_i)
: y$ C9 \0 d" B( @5 E( p+ m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ P% k: N" d! X+ _$ R1 r
        else wait for 10 sec8 z: E. e1 V* Q# g
        if A_i=A_leave then send to die
& U5 h0 ~3 i7 n. [        else inc A_i by 1
$ X% [" ^- M% u    end" O, d$ j  K1 Z* ?, d
end9 c+ j& O7 U: }" |

4 H: r4 w1 p' C1 cbegin P_pick2 arriving
; W! I+ U8 T% \" s  T    set A_i to 11- B" D( `( n* \- U
    move into Q_induct2! N* T  }1 S) X! I6 e  y7 D9 t& C
    move into pickaisle.induct2' v4 u6 m8 j' Q- r/ }4 S5 g* z. y
    while A_i<=30 do begin
0 Y  @4 W; a) F/ f        travel to pickaisle.con(A_i)
" [3 y, O& @8 L  v" M8 d6 o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* q4 g/ `8 b. r* F8 U% G3 k        else wait for 10 sec
* ?; x' [. @% E  ^' n% w        if A_i=A_leave then send to die
+ Z1 L9 |7 m, J% d: ]% v8 [        else inc A_i by 1
9 S$ O! `8 H9 H& c, l" V0 N0 T; Q    end' h. O: r5 j; ]/ h
end
7 Z9 {& U* Z  \% Q: [  B. y) c5 G
begin P_pick3 arriving2 v; W+ U* W7 s# A. ^. G7 V
    set A_i to 21* N* N5 ^8 f- d
    move into Q_induct3" q  |. C; T2 W8 o8 X: s+ l1 U$ w7 _
    move into pickaisle.induct3
) i8 N/ _; Y* `: A    while A_i<=30 do begin
4 V1 O2 ^) a4 I        travel to pickaisle.con(A_i)) x' \' J, c6 l8 E( P9 _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! l4 c" A2 @9 ~8 n  z# x8 n( v        else wait for 10 sec
- ~9 [0 L; |' B. |5 P  n% M  O        if A_i=A_leave then send to die
9 N5 V6 c" b6 }9 ^: r4 k1 n* s1 v5 [        else inc A_i by 1
: o+ P$ A. v1 F0 l0 l    end
0 x. e4 Z. a/ q) Cend

最佳答案

查看完整内容

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是个什么东东?. b. E* S  E1 [
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?0 E7 |: y  l; W) y( }3 |

" [0 x. @( T4 E+ \6 j1 GAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 N# |/ i& U' U  q( }2 Z6 z& M4 x
- b+ N( f2 U% C8 q( r2 I另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- `+ C9 \  s( X1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
9 Z/ @7 m, k2 z3 }# ]2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;, ?- ?) p6 R8 Q! p+ j7 Z& L
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:' A1 L8 `4 |' c. d' p* f
begin P_induction arriving+ f2 K0 ?# @2 _- R9 Q
    clone 1 load to P_pick(A_induct)
( H# r9 ]! u) A+ Y5 Uend最大的系2 D. E2 d6 m! F, a! J
+ [  J" d- ?% A2 Q+ m
begin P_pick arriving' r0 b8 }- h! L) R" d1 _; i
    set A_i to procindex * 10 + 1
# K! M, `( @( a: B    move into Q_induct(procindex)
+ |0 w0 t8 k) K8 e% o    move into pickaisle.induct(procindex)( u5 c. F. s6 c. ?7 O2 K- n! @
    /*check the type of pickaisle.induct(i), for your last problem.*/6 I% J, R: v5 j: w& w
: F( S4 X( M! a7 T
    while A_i<=30 do begin
( A  V& U* @3 p* C2 A        travel to pickaisle.con(A_i), ]; |, u% [( I" F- }! C0 R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 a: z* r, X$ g9 y        else wait for 10 sec
9 J* T* r5 W% U        if A_i=A_leave then send to die! f) |3 j9 j/ f$ _9 P+ c
        else inc A_i by 12 }) k; l9 [& k* Y8 G* @9 T
    end: M$ Q. D7 i" H! [" J' [0 X% `
end
; L$ s. v2 T+ {1 x4 X  [. t5 V) H( E6 V2 B0 Z* F7 ]
其中的procindex为整形,代表当前process的序号。# a' }& m2 C2 a. F: G$ W( T
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-25 12:43 , Processed in 0.024382 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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