设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15248|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ X2 t& {* j  g4 h- H3 g; t( a1 N+ }5 Q" c8 L
我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 a4 P9 t% k- @5 W( y
& \9 g- y. E0 A% [) B+ r
begin P_read arriving
1 W( B1 C, P$ W3 Z2 S" h% U# }    while 1=1 do begin. @, L( Q0 T! O! R7 O9 `4 v
        read A_tote from "data.txt" with delimiter "\n"
$ E, ]! b5 t7 M2 v2 v0 ^        read A_time from "data.txt" with delimiter "\n"8 m. O, D5 H! S- K( x2 M, T5 \1 a
        read A_leave from "data.txt" with delimiter "\n"
# M  D1 b* ]3 l& }- t$ W7 V% t/ _8 j        read A_picks from "data.txt" with delimiter "\n"
5 \- @' @% R7 q# n        set load type to A_tote
% C: n1 u' f5 w        if A_tote="tote 1" then set A_induct to 1
6 i2 `- Z& K5 J/ b; c        else if A_tote="tote 2" then set A_induct to 2
3 q. w5 N, {( o4 x& C            else set A_induct to 3    # K& m  O* N9 {+ ?/ z
        set A_i to 0: e& [; @$ L, i. v
        clone 1 load to P_induction7 u' C8 H( y0 c6 \5 v
        wait for A_time sec" p# x9 H1 ^) ?6 m
    end
# I0 {7 j3 N$ X" g/ Tend: Y2 C. n( J5 S1 X
! k! h" ~7 T/ ^7 F0 i* N' X
begin P_induction arriving
& Y6 j+ o1 ?$ U* m. l    if A_induct=1 then clone 1 load to P_pick1- j" Q. l1 i) [( a! I8 V1 N* _' {- ~
    else if A_induct=2 then clone 1 load to P_pick29 N- @* y- w- T- i7 H# k
        else clone 1 load to P_pick3
2 J% r* c9 E6 ~, \end$ o! [+ n; x0 e  v% r" `

- b, P: z$ J# e  lbegin P_pick1 arriving/ L8 N$ h6 x& [$ r5 m! u6 w+ d; g
    set A_i to 1
8 x$ m6 u( ^* [    move into Q_induct1
- u8 o% T" s2 S- }0 M    move into pickaisle.induct1
/ y0 `- p' \! P  R! h) V    while A_i<=30 do begin# d  J  W& J1 d# `+ m! I/ x" u
        travel to pickaisle.con(A_i)
, h' Z7 L( Y7 J+ F9 H0 |- v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( e' ~: i! j. y" M3 G# z6 g
        else wait for 10 sec5 B, K/ z4 ?0 p
        if A_i=A_leave then send to die5 w- I  J: L4 B# {
        else inc A_i by 1
# d1 w9 W( H% {. |    end
# P1 F! o; j& ^+ ~7 K+ x) Iend" K8 U  J  h( ~' @* ?1 p1 [' t
) }' I$ {( N; l" `0 w8 ]
begin P_pick2 arriving7 g- m9 \! ^7 @$ k9 L5 c4 T
    set A_i to 117 U0 y, H# s( Z1 D, r
    move into Q_induct22 ~; {# S- v/ F$ \3 U
    move into pickaisle.induct2
0 k8 l+ D( O: N! Q& K    while A_i<=30 do begin
1 R8 U$ ?$ b4 N        travel to pickaisle.con(A_i)7 {3 y  `8 B  z9 v: B9 ^9 U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' @! ]0 ^. S# C% n2 E        else wait for 10 sec
& r% `4 x( f  Q) ~        if A_i=A_leave then send to die0 A0 H1 [- \( W$ D
        else inc A_i by 14 D* A* R% R5 A6 j# d  `2 I
    end
& I" Y- o& @$ A) Y6 u( ^end( ^5 ]$ p) ]9 G' R; N; x+ A

# b+ o/ B9 _* x8 J4 L& [begin P_pick3 arriving5 a, ^* a( Q, U+ ]6 V) L
    set A_i to 21
$ w7 S: P: c9 z3 m8 J    move into Q_induct3/ }6 m; H! H( l  Z9 m& g; E
    move into pickaisle.induct3& o( Y! t' b' ^" l, W# q
    while A_i<=30 do begin4 @# @3 @5 K3 Y% T1 Y+ y, n$ B6 T+ Q
        travel to pickaisle.con(A_i)
; G, T$ D% M7 l9 m# V. Y. ]. w0 ~* T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 q! X1 o) c: O% f/ d; `$ ], Y        else wait for 10 sec
  k* S. M! H* `+ a        if A_i=A_leave then send to die
2 }; [& s* ^% v' P6 B% C5 x/ M        else inc A_i by 1
0 l- b& Y8 T( F" z4 _( _    end# Q- R9 \0 d' B
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是个什么东东?) t: y' t- m: T: I, m0 R/ Q: B
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?4 N  ^/ Y% ]1 @+ X) h  Z

* y7 }# H! `, i: |+ K3 KAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 Y# y) J5 G0 p( j) U; g' \; Y( @" ~7 n2 _+ n7 x
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: a: I, {/ H# E! m- k. |, M
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;+ S8 _( T$ w% C7 [+ X
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( F0 `7 i4 ?' |1 g3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, C6 a' O4 i$ u: j! ibegin P_induction arriving! P, B& r( B4 o$ }' Y
    clone 1 load to P_pick(A_induct). D: v; s1 |/ b0 W8 R( r8 B
end最大的系4 N) K9 j$ |, a+ q+ }: l5 P

( Q* z: l- N4 fbegin P_pick arriving
  P  L0 \- F* C% w- Q* H: p    set A_i to procindex * 10 + 1
" _0 k) _$ T# |" P  g7 ?6 H    move into Q_induct(procindex)
$ O  `( M% l8 V    move into pickaisle.induct(procindex)- j9 C$ V8 m" H7 I2 X# P9 `$ U
    /*check the type of pickaisle.induct(i), for your last problem.*/
, F- R/ m: [3 N
  q  m) D/ c; v2 b    while A_i<=30 do begin
  D# c6 O- |5 ~- A        travel to pickaisle.con(A_i)
5 n- X; a$ f! A; q3 g5 x% c1 v. G9 H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" w6 N4 i; o0 T6 ?4 k5 [2 i        else wait for 10 sec
) e8 w- ~% h( C1 m: R: D+ W        if A_i=A_leave then send to die
5 ^+ u% S* K) z+ t9 ?. F        else inc A_i by 1
0 E' W) k0 p6 ~" {    end
. C. b% R; m+ b) m# e- ]end
+ P% z  g5 ?! T% v! F: f5 y, _
6 M- \3 ^1 c. z2 o& Q2 g( Z其中的procindex为整形,代表当前process的序号。% }5 [6 P( R3 z+ d: P1 _
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-8-27 09:55 , Processed in 0.017742 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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