设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14337|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 P, e4 J, _' X! q& c- e3 Q  `" O7 m9 V& H, {) S* E# F  V# J0 I3 d1 {
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
  J0 [3 E2 g( k4 S& T" i$ p" w
' l- c0 Z) P* X+ `2 Z4 H, Sbegin P_read arriving/ }( F+ r- g6 V. r# K  p
    while 1=1 do begin
. `( x5 ]0 R: u8 d. O8 E2 q        read A_tote from "data.txt" with delimiter "\n"0 c" ], y" j; J# s
        read A_time from "data.txt" with delimiter "\n"
, F7 G) T1 I( l1 }+ a2 f, a        read A_leave from "data.txt" with delimiter "\n"! s0 e8 S8 G( c0 |5 G5 o
        read A_picks from "data.txt" with delimiter "\n"
+ l( ?. T+ C. F, S7 w& G        set load type to A_tote( W  k# a' k$ d
        if A_tote="tote 1" then set A_induct to 1: ]* n- S! d' b7 P  t1 ]
        else if A_tote="tote 2" then set A_induct to 2- }2 S/ f% a4 l* E, l- x; u
            else set A_induct to 3   
2 W8 @% M. r4 t5 W        set A_i to 0! m4 z- B, V* V" x& z! A& E
        clone 1 load to P_induction) b3 o0 {" L; e0 s/ S" `
        wait for A_time sec# |+ A' f4 c/ q) ?
    end7 A. A) I( q  i
end- X- j' _1 ~( r  g
# M( e5 J( k( G  ]+ o4 f0 |
begin P_induction arriving
. N/ H9 |- e, E; U" I7 y    if A_induct=1 then clone 1 load to P_pick1+ v  E2 M+ \1 s- W$ W
    else if A_induct=2 then clone 1 load to P_pick2
+ m5 q' X4 [" D9 U/ p6 y1 f        else clone 1 load to P_pick3
; H6 Y  M2 a6 A6 I; g, x. Tend
  t. M9 H2 E  j* R: V5 Y+ X5 @: q! c$ j% M: ]/ C( u
begin P_pick1 arriving
. z8 ^" L3 Z, f    set A_i to 1; r' k0 a' a: E5 {- ]4 E
    move into Q_induct11 A& D* v2 k3 A* I  A
    move into pickaisle.induct1
) p  \/ x( E5 A# ^4 D    while A_i<=30 do begin# J) |# k9 H1 m. c
        travel to pickaisle.con(A_i)
0 d# R, x. z3 j$ U2 F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 G% W) h+ F2 l6 E" C        else wait for 10 sec7 _; N- K9 o/ b# J9 s
        if A_i=A_leave then send to die4 v, l. Y" j: u
        else inc A_i by 1
$ d6 j5 v2 q! ]4 F    end# K% J3 f% b$ w. i- s4 Q5 Y
end
+ v0 L% D+ ^: @1 }6 Y" s
' S  |' M* F' B$ V1 Fbegin P_pick2 arriving
* j# R" n1 F) O! {    set A_i to 11( q: ?& P2 X/ ]8 K# t9 n
    move into Q_induct2
8 {3 I4 @" M& ^) ~- I+ j; m  R: K    move into pickaisle.induct23 M9 n1 v. w- J/ W2 G- o+ n
    while A_i<=30 do begin
7 M* h. Y5 I' X# [0 U8 l, y        travel to pickaisle.con(A_i)
1 I1 p) c, R, {; \# M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' a* A% b* X( ~# ~% R5 O) @  N: `
        else wait for 10 sec
8 R* v8 V, p. S1 |* p6 W+ Q7 t. j        if A_i=A_leave then send to die
6 D- |* m: `3 z- @9 \2 K# R" M        else inc A_i by 1+ ?* }/ G. N+ B( [
    end% L. M# J/ ^$ n3 F* h/ b' W
end
( @5 a6 R+ G8 F. {* b8 G$ d/ N, P( G8 ^; S9 n2 X
begin P_pick3 arriving
" k/ h+ H/ E, Q2 d) P" C    set A_i to 21: D" {! |2 G/ ]& q- w8 O6 r* v
    move into Q_induct3
4 P9 ?3 R/ N8 o3 ~9 O: `    move into pickaisle.induct3
/ T$ j/ M! u5 g  X. S7 U    while A_i<=30 do begin
5 U7 Y  i+ V6 b! C0 B5 O/ f        travel to pickaisle.con(A_i)% C# L6 v/ X9 l0 Q! ?/ J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. y- F6 l9 z5 a" a3 D; r# q, e
        else wait for 10 sec
1 _1 h3 h3 g1 G        if A_i=A_leave then send to die5 r) }  f8 G) x3 u
        else inc A_i by 1' b2 r3 h7 M7 x: Q
    end
5 W6 N: ?1 d, z' yend

最佳答案

查看完整内容

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是个什么东东?
6 V* P1 @( t6 `' O& }6 Nmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?5 F0 \, ^' E( u4 ?! M" Z, q

1 x/ P2 M9 I# x& k+ gAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。$ ^+ }: @9 H, s0 T) ~

6 R8 x$ P$ K0 N4 Z$ w另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ ]! ]) K; I& ~1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 B' z1 q( H$ A  L2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& u( x% y( Z' U1 r
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 u* x) @# P- O2 w
begin P_induction arriving
, @% I8 m2 ]: Z' w6 L( o" z% E    clone 1 load to P_pick(A_induct)8 R/ z2 g  |9 e
end最大的系  j3 O, ]% i) E1 O+ u  ?
1 H% g) P$ }  I
begin P_pick arriving
  i, n1 @# R7 S* R! n    set A_i to procindex * 10 + 1
" }# B% A8 L4 f2 r. I) _, U, T( k, `    move into Q_induct(procindex)
2 O8 J* H! s! H8 h    move into pickaisle.induct(procindex)
& R: p  z0 ~8 f2 d# H( S6 B6 w    /*check the type of pickaisle.induct(i), for your last problem.*/+ t4 r3 N% l; l2 ^8 o- L9 w

, V  b+ B: o0 ?' }' w' L    while A_i<=30 do begin
! A' Z" T8 T" V! v3 n4 t, @, m        travel to pickaisle.con(A_i)/ `4 M* {1 n# f8 s0 |" b  ?/ b! w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 T% V+ I( l  X- b" Y# G3 Y* L        else wait for 10 sec9 U& S  |$ Z% ^+ B/ c% w2 ?
        if A_i=A_leave then send to die$ ~) t* d7 E5 O* r; ]2 \
        else inc A_i by 15 V& ]" e8 |/ [& T4 ]: a, G! V
    end$ I, B. W2 d% b
end) n1 C! ~/ }0 i7 G8 H: U5 E' ]7 a
( r) a6 m9 f# V5 K, U7 ]1 ?$ H* @
其中的procindex为整形,代表当前process的序号。  {& h5 P6 v9 a8 G" k4 t4 k
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-7-4 07:10 , Processed in 0.021069 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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