设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10587|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 s/ O' D) C8 H* E4 g) w+ n, k5 ]% 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中的数值,不知道会不会有什么不妥。# W* t: z1 X. E' L6 L: l

# Z8 N  J- V0 C9 jbegin P_read arriving/ T) i' x% W: j
    while 1=1 do begin% M+ d. a4 @; w  u9 i+ b0 N- C
        read A_tote from "data.txt" with delimiter "\n"
- F' J0 Z2 s& f6 Z; e        read A_time from "data.txt" with delimiter "\n"
/ ~: ]# r) f4 v- v, h# _        read A_leave from "data.txt" with delimiter "\n"% _0 h, w- S# x9 L& N. o
        read A_picks from "data.txt" with delimiter "\n"  Z9 X! J: W+ Q7 Q6 ]. P
        set load type to A_tote0 r/ g* Z8 X# m1 x& |
        if A_tote="tote 1" then set A_induct to 19 i8 i- ~2 W/ K* ]! G' N
        else if A_tote="tote 2" then set A_induct to 2
6 Q0 y% C1 |  J7 o            else set A_induct to 3   
! w; i! f0 L& g- J        set A_i to 02 U  u; Q) K" ?8 i$ J! c
        clone 1 load to P_induction0 |& L0 N" |4 _
        wait for A_time sec
, g+ g4 `$ i3 p  D; L! ?0 D: Y4 q    end
' H0 X! D: I5 Q( Z. ?5 oend
% L& j; m: G1 d7 @/ T( s8 n. w# g: P' v
begin P_induction arriving
; i0 z+ @0 D+ }4 v    if A_induct=1 then clone 1 load to P_pick1" S6 [" o- e- h! i3 a# |% @' M
    else if A_induct=2 then clone 1 load to P_pick2
8 p5 B2 z9 ^/ S" d3 F7 l        else clone 1 load to P_pick30 k& h: K- q/ D+ y
end* s5 B, K  z. `; E/ Y  M6 B7 H4 G
  |4 m, \% w( S' k0 H* v4 D! r
begin P_pick1 arriving
* j3 |3 n3 B2 N& l3 |( b    set A_i to 1
* z' j6 h, [% L    move into Q_induct1' Q) M9 P9 R4 V) q
    move into pickaisle.induct1- O& _+ x' v1 o+ |6 v
    while A_i<=30 do begin
  K2 A/ Q0 A1 r( l, j( r        travel to pickaisle.con(A_i)
8 v  ^$ g5 c1 y" K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) e) f( S. R  K3 C        else wait for 10 sec
2 S$ e# J; ~& Q9 P4 y$ L1 R/ y% K% q/ d        if A_i=A_leave then send to die8 Y* a! ?$ @  `( f+ a- d! [
        else inc A_i by 1) D* ^2 p4 ?: Y  s% V0 D% n# y$ `8 `
    end- q; j  T/ h0 e4 {; |
end
0 |8 q8 f$ I6 P7 s8 {. o8 l( H- N# ]
begin P_pick2 arriving
1 P, ?! U1 j! T8 d    set A_i to 11
  f! v/ h" |  n9 w+ F- W# R8 o    move into Q_induct25 V- _( A+ v3 d1 C' {8 Z
    move into pickaisle.induct20 B5 H7 E9 T& C# \* {( H8 ^# J
    while A_i<=30 do begin
- D2 E" M& u0 p: Q3 X8 k; X        travel to pickaisle.con(A_i)
* i2 F8 X! G# x" `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 E* P' Q8 A, k( Q8 }0 r( S5 n& T, [( X) [        else wait for 10 sec
! m( c7 I$ |, f* A$ u! [        if A_i=A_leave then send to die
, J+ F5 _* b5 V, d        else inc A_i by 1
' f* j& Z3 M$ Y/ z7 @" i    end
# r1 l2 f% F5 \. Jend' W( m# `4 J& ?7 d9 {( G+ ?, l
4 s  M6 t" G" M: o7 @  o, k2 w( r
begin P_pick3 arriving
8 [& X# n4 x0 ?. ~. L1 y2 m    set A_i to 21
/ h3 l5 `  W! k/ @; U7 ~" J( ]    move into Q_induct3) G# e6 s( w8 i! m8 S' F$ r; l, u
    move into pickaisle.induct3* Q) p! v! r6 G
    while A_i<=30 do begin
9 O# n" r- ?' ^. i# d3 g        travel to pickaisle.con(A_i)
; n/ U. a( s6 h% P: `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; [) j% P' R3 q6 e2 ^; W% Z        else wait for 10 sec9 \* A- h0 h5 g
        if A_i=A_leave then send to die# j. N8 i% K2 C- ^
        else inc A_i by 1
* Q: F* a* K0 [% I( G4 ]2 [. S1 S    end
+ {2 W' P6 y: D8 w$ h" ?$ ^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是个什么东东?6 C. @6 `1 J; z  o& ]6 R
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?: Y1 D4 O! V& Y' E/ [9 T
1 V$ ^) P, F8 M) F) \! O
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: o- m7 X  J: W3 Q. d, o, c8 W0 P6 e# @

, n5 P* ~7 ~5 X) D# }( Y另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
0 H6 [! i. ~5 p- o# l4 b1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
8 M! [7 ]9 }6 ?& \8 C9 E3 z2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
6 I) x2 O/ l$ b8 g" }3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ @$ L8 Y- [- N$ h! l  N
begin P_induction arriving
3 c3 b2 X6 x# O6 F! h* C0 n    clone 1 load to P_pick(A_induct). u. y8 ^% o5 M; H3 H
end最大的系
3 R  k: b( e9 M
* K, M  w, O! Q# Mbegin P_pick arriving4 R0 ?' Q. h# l  g* r+ X
    set A_i to procindex * 10 + 1$ P( J' r  U; ^: Q) O6 Y
    move into Q_induct(procindex)  U" {) t5 {' t7 F" ~4 T0 w6 ]
    move into pickaisle.induct(procindex); U0 A: t2 E; v7 j
    /*check the type of pickaisle.induct(i), for your last problem.*/
/ L, V3 e$ a8 [+ }' g5 [8 I0 q5 i# ]0 `3 ?; z  @4 i1 \
    while A_i<=30 do begin5 l9 f* i! ]* @5 p$ F. u
        travel to pickaisle.con(A_i)
. z( N3 s6 }' W! C% g& G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 @2 S2 {- C$ h# h/ G
        else wait for 10 sec8 v9 _4 s* j" o  w/ u+ x
        if A_i=A_leave then send to die* V3 I7 ^2 j5 U% X+ A4 M1 o
        else inc A_i by 1; G2 L* |& g9 g/ C0 ~
    end
: z5 P3 w# ~3 p( H1 iend2 l/ O; J) \, @( F8 E# Y
+ h- K) s, Y; A
其中的procindex为整形,代表当前process的序号。1 L  m! |6 c9 N! q
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-9-14 10:23 , Processed in 0.024150 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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