设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12565|回复: 2

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

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

& D6 a( v) W$ }& ^9 R* s5 e' F我的问题是,在每个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中的数值,不知道会不会有什么不妥。" T! ~( c5 B- {

# m4 U& h6 @* e; Ubegin P_read arriving1 P& q1 w) d4 N
    while 1=1 do begin5 L! J9 E5 v0 v
        read A_tote from "data.txt" with delimiter "\n"4 e2 D) Q9 n+ J, e6 _
        read A_time from "data.txt" with delimiter "\n") t; Y: d5 y4 M7 s. f
        read A_leave from "data.txt" with delimiter "\n"9 u+ S* E3 m& M' T
        read A_picks from "data.txt" with delimiter "\n"
) v$ c5 w7 g7 I/ x        set load type to A_tote8 i; y8 u5 D! b& f9 y
        if A_tote="tote 1" then set A_induct to 1
2 a6 h% E, }' i1 o) c) E+ S        else if A_tote="tote 2" then set A_induct to 2
7 ^- ]; D0 J0 M6 J3 F            else set A_induct to 3   
* ?  x. n" l6 d& U$ t" |        set A_i to 0
0 ^* g$ O8 k" e4 Y2 n7 d# _$ \        clone 1 load to P_induction
( M% M* c- |. A        wait for A_time sec
, J/ ?% ?- d" j! g    end0 ?: s/ p5 H9 ~% k6 `8 s* t+ |* b( c
end. e7 ^* A+ N% \4 \4 ^
0 Z7 f- g+ @' c
begin P_induction arriving
! t4 A5 L% `0 @3 A. ~    if A_induct=1 then clone 1 load to P_pick1
& Q1 B5 U& q, n- j    else if A_induct=2 then clone 1 load to P_pick2, E) l5 x/ N- j: F! Y" \* J- n: Y
        else clone 1 load to P_pick38 b& _6 I: t9 P
end/ b5 [9 m8 d* G2 \9 n* T: k

9 u1 E4 c0 l4 q  j. x+ {begin P_pick1 arriving
( ^8 K+ ?1 q+ |$ W8 n    set A_i to 1, j8 H  L/ {/ g$ ~" c
    move into Q_induct18 q; Q  Z: t. V  |# f
    move into pickaisle.induct1
! ]. W" @: W2 Z    while A_i<=30 do begin7 p: e/ |/ G) ]6 V
        travel to pickaisle.con(A_i)
1 B5 t& d# s& {1 I# z: `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! u6 C& j; R9 D7 I/ u        else wait for 10 sec
# x5 j* Q+ V% ?* x$ l0 }; @        if A_i=A_leave then send to die
' [% m4 ~, g! z  J8 z. q& i        else inc A_i by 11 [2 R/ U1 ?4 n0 _2 b% ?* y; V% x
    end
8 B- o; e! D: z+ p1 Dend. W4 ^- c$ Q$ Q/ K. U3 D5 X! ?8 O

0 {) y8 K/ l# |1 f# Wbegin P_pick2 arriving
8 {; r2 Y* E7 ~; C: t0 b8 c. `    set A_i to 116 I$ Z/ }9 x! R/ T1 f" t8 z
    move into Q_induct2
' G+ R7 F% ~* g+ T1 {& q    move into pickaisle.induct2
3 v% [! v( `" ]' b    while A_i<=30 do begin
, W# Z" J- }$ y% ?3 e        travel to pickaisle.con(A_i)
- X' G/ \2 R  o$ V) r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, |5 Y5 v! o- `: P. b. {        else wait for 10 sec/ e% k! \1 l! G/ I2 ]$ U
        if A_i=A_leave then send to die
# S3 X" @/ D5 c; @. C; K        else inc A_i by 1
% D' \. n$ n( h+ z8 u    end, D% W7 b1 }2 ]% J& h
end# s, p, o- y& E' D) G( L

$ C3 {' N$ @. O9 `begin P_pick3 arriving; ~$ d- w9 I9 l6 q
    set A_i to 213 t" F5 v1 @, w# r0 ^/ V! a  R
    move into Q_induct3
6 Y& }1 N- S! t- q% [" k3 U$ f7 O    move into pickaisle.induct3
/ @5 m1 e8 t& j$ l; ?0 k+ g/ O    while A_i<=30 do begin* N  H" H; |) z
        travel to pickaisle.con(A_i)6 b& i' l" r9 H( Q2 |% A+ i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  P, ?$ D' k& F& n( N8 Z( q  e
        else wait for 10 sec
& `* A/ O; _; l6 a- b  e: J( F* [        if A_i=A_leave then send to die- B% V/ @/ N0 q( z* V
        else inc A_i by 1/ j% r, o% ^1 ~1 E7 h2 F6 j4 D
    end) G4 V# \. U5 ^& ^. S' D7 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是个什么东东?
7 R2 g% T! f. a3 A6 z. V. dmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?, e. ~: |4 d) z( _3 v9 n: v: {
* n% L9 o/ I" j( E2 w( x+ J5 ~
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
, U5 [4 L' {/ [- e
7 r2 |! h; {- l/ Q* x另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 f1 {% L7 E# ?! z
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;0 c( q+ U! [) ]& p. p) @
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;, ?. b7 |3 D8 v) f; u
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ N/ f( r2 E) i8 Y# W
begin P_induction arriving' d; o- d% |0 z/ `
    clone 1 load to P_pick(A_induct)
9 c% h* F8 m. E+ H8 @- q: J/ V8 N" Cend最大的系
. O  S8 V( q; }6 Z6 z) S7 j% ?  Z1 @7 O( D1 q5 E5 l
begin P_pick arriving8 [* f1 m; z7 E# y; q. m
    set A_i to procindex * 10 + 1
2 Z. H2 C9 ]/ l( g7 B4 G0 n3 d0 k    move into Q_induct(procindex)2 N" X" B- A: R$ m' O  M. x
    move into pickaisle.induct(procindex)
& P' r& x1 h' ]5 `* M    /*check the type of pickaisle.induct(i), for your last problem.*/( p1 Q) n7 `; _# S4 P

! O2 r$ d/ [0 d8 p    while A_i<=30 do begin
' v( j7 Z. Z  P2 t2 x: }        travel to pickaisle.con(A_i)( |! @  T' }, ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- E5 H, n) ?) ~/ M( l: a
        else wait for 10 sec$ f" q2 t7 ?( y1 T* p; T% @% X
        if A_i=A_leave then send to die
- ^3 z; R# G5 n" b+ V3 C        else inc A_i by 1# ~2 |/ a8 ]% |; p
    end* \3 R6 d8 @1 V3 x. g. ~: d
end0 C; L) T! ?) G
# ]8 L7 ~, x9 i% v# N& S
其中的procindex为整形,代表当前process的序号。( Z- y5 J2 |2 l9 y! w
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-2-1 13:20 , Processed in 0.018366 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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