设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11822|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# \) k* Y& D; ]& A# `( e; g: L/ ]" K4 n, B
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 D* I/ F/ ?% b+ A) M  |6 g* w" K
begin P_read arriving
& D5 u3 o5 o. Z0 v    while 1=1 do begin
" Z  ]4 M$ r$ F* I5 v8 b3 X' G        read A_tote from "data.txt" with delimiter "\n"* A3 B6 y3 ?. Z1 b$ J. H
        read A_time from "data.txt" with delimiter "\n"
. \- p" O, j4 a: P        read A_leave from "data.txt" with delimiter "\n"
, A! g5 w/ g. f: D: [9 B0 M        read A_picks from "data.txt" with delimiter "\n"- P0 Y3 }1 t5 L0 K# V, @
        set load type to A_tote/ z7 k% Y/ R5 g& O, c3 S* l: m. B7 ^
        if A_tote="tote 1" then set A_induct to 1
2 {$ p0 F4 r: T1 j- f        else if A_tote="tote 2" then set A_induct to 26 }6 x% v7 I4 o5 V$ g
            else set A_induct to 3    " ?" u- L9 ~) `
        set A_i to 0  i9 G, O; c+ ~. }* b7 w5 o( V
        clone 1 load to P_induction
1 r& ]& n+ @/ o; k        wait for A_time sec5 A6 @$ P# ?# H. x, R0 T
    end
. g& T. p; p8 m9 N! mend
4 S% K+ G( `7 F6 E2 p
) l( {* y0 g( ^2 O! P  Q' Sbegin P_induction arriving4 G3 T4 u$ L- w- H' c% g$ c
    if A_induct=1 then clone 1 load to P_pick1
% k* v, {  C' ?1 F- [1 \    else if A_induct=2 then clone 1 load to P_pick2$ S( V# h) }$ U1 ]* w" }
        else clone 1 load to P_pick3% J. S: j' g& ^, i4 z$ C) a
end
$ n- Y: u! w+ m, F* p
9 u4 \* M! a; E% M7 b$ Dbegin P_pick1 arriving
9 M2 D& ?+ y5 b5 |4 ~- R' }) y5 w    set A_i to 1
: y# [# d8 |7 X. s. A, _& v    move into Q_induct1
, W8 I6 d  A7 Q- N    move into pickaisle.induct1
; W* A* `$ {2 r3 o    while A_i<=30 do begin+ R. j+ N. `6 p# A6 L7 _
        travel to pickaisle.con(A_i); G# Z+ r3 B+ N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 P8 I- M  U6 A$ G        else wait for 10 sec
2 ?7 {% @. ^  t* [6 q        if A_i=A_leave then send to die0 H7 B) ?& w& n; Q/ v# B% T$ s
        else inc A_i by 1
0 j  Y) n, f" k8 D9 ?3 Y5 V    end
" [3 l) C1 @6 c; q! }- Qend) r; x+ P( `9 j* J/ p8 ?# g8 o
4 a1 d/ ]# e# e3 X# F/ F
begin P_pick2 arriving
- d4 U+ e5 B& k; M: M' {# f9 E4 d    set A_i to 11
" E9 E& N! N/ ~$ w& j2 H( I    move into Q_induct2' }& w4 |, Y+ K* L2 H4 |
    move into pickaisle.induct2
! \: I, w# @' m6 |6 F0 }    while A_i<=30 do begin2 J+ g! @2 f3 n4 M% D* r# ?9 _0 N
        travel to pickaisle.con(A_i)3 K( ?* c3 b; t- j! p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% `; @# L' U0 g" `        else wait for 10 sec1 o# k+ H# N+ @" ^1 V! o. y& \
        if A_i=A_leave then send to die8 v/ f* c4 p# }& p# g6 E
        else inc A_i by 1( ?( Y" u, P- W; u1 Y% A8 `+ Z
    end
5 Z! B5 {7 a% J* X) i1 K( Jend. a# N7 G4 ~8 J( }& y7 m

# l4 H( u3 S  a4 f1 ]8 rbegin P_pick3 arriving
* Q$ h3 ?1 _& _- I0 e2 z    set A_i to 21
3 Y$ T4 n7 \; Y* O    move into Q_induct3
  }7 H1 u/ z0 F: x6 l! f9 @    move into pickaisle.induct3  g8 t. Q' h- {8 Q" M$ L
    while A_i<=30 do begin
7 P/ S8 _/ h7 I        travel to pickaisle.con(A_i)2 d( s1 Y0 c* y; z1 g. w8 D' O2 _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. p1 {- @' s: |# [        else wait for 10 sec
9 D) x6 F" b3 }9 I! a7 J        if A_i=A_leave then send to die
- Z9 B! v! V& r0 ]  R5 |9 J: _        else inc A_i by 1
* c3 [6 k5 W& {1 A) W  Z4 c    end
0 c- T. w* Q( E' L( 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是个什么东东?+ p: D) n/ S3 i' c7 X
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, H3 E" E1 f. n$ l3 w' d: k  b& i5 W3 B
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
" _  V1 p/ }- H  Q9 v  t& i
( S1 _4 x! M2 V8 a另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% ?6 ^0 G1 X$ P" ?( R! Q. K1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
8 F+ a: q) {3 ?% Y* ?4 Y3 |2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 P9 D2 S" u; y7 |: m
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
9 v& _9 T) Z6 x7 K% C& h) |5 R* Mbegin P_induction arriving5 k+ s- ~, z1 q
    clone 1 load to P_pick(A_induct)2 g+ Q4 r, T3 q, s8 D3 P
end最大的系
( B* d# V' w' z% \, [! `: I# B# i8 ]" ~9 R$ ^7 w5 E- u
begin P_pick arriving9 ^1 H& W3 }* O8 B, f/ [1 P8 `
    set A_i to procindex * 10 + 1
! U+ O: q2 T6 y    move into Q_induct(procindex)
  P0 Y$ q: y9 {    move into pickaisle.induct(procindex), I* |' t. I8 r+ }7 L
    /*check the type of pickaisle.induct(i), for your last problem.*/# k3 F' z% B2 i

+ @3 B0 j/ {( R    while A_i<=30 do begin
; y! H: X4 ]7 ~        travel to pickaisle.con(A_i)
. Q# o" Z: \$ z, r/ o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 M, U4 y5 D, C6 C        else wait for 10 sec
4 Y7 Q  C" X  p        if A_i=A_leave then send to die
1 x6 ~: C6 X! ?' o) C' O9 I& T        else inc A_i by 1
0 _% K9 Z# L- r" _8 I    end
9 p+ i% d4 s* |! B" @# U( C8 Fend
! l' ]2 [/ I, g, `# y$ Z% I, b, P* i& t+ X3 M. |! [- k5 Y
其中的procindex为整形,代表当前process的序号。" S  [% V! \( v8 m* ]' v8 F/ d: @+ @7 @3 }
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-8 04:14 , Processed in 0.016173 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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