设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15411|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, X) C, ^0 k2 F' m* \

: K( @( ^$ Q1 D4 O' X& O0 I我的问题是,在每个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中的数值,不知道会不会有什么不妥。; G# H5 ^" C( [3 }3 k5 W

: u- @0 n( L' u1 Z- ibegin P_read arriving
3 \7 `: J4 i) b, A, C' M    while 1=1 do begin
- f, Y. Y1 h' u8 O7 K        read A_tote from "data.txt" with delimiter "\n"
7 D( `! I6 j1 n5 [' E8 B6 t" i- i        read A_time from "data.txt" with delimiter "\n"+ B/ y$ R: X1 w, N
        read A_leave from "data.txt" with delimiter "\n"0 y( E( [% ^, |1 h4 y' ?
        read A_picks from "data.txt" with delimiter "\n"! s- K( y) ?" b7 c/ \, [
        set load type to A_tote8 k$ g+ U! h; K1 l
        if A_tote="tote 1" then set A_induct to 1. n+ W/ M# s' N3 c/ Q4 ^2 f8 ?" _- K
        else if A_tote="tote 2" then set A_induct to 29 p3 H9 l; j/ p6 R4 w$ V
            else set A_induct to 3   
* M# k) q# e# N7 I! Q        set A_i to 0
4 z7 Q! P; z" @4 l3 ~3 b' `        clone 1 load to P_induction
0 j- Y  P( R# a& D2 U8 ]        wait for A_time sec
3 c  r4 v3 ~5 {! w0 ~    end3 G! u. A& d( ~, z6 t- J; F' J
end
* W  }7 ^% K7 w3 B8 X5 a7 u9 G  \8 F* T
begin P_induction arriving- a1 E2 o. U$ y8 [# Z2 k
    if A_induct=1 then clone 1 load to P_pick12 \: T+ f5 O. j; `) U6 w3 {
    else if A_induct=2 then clone 1 load to P_pick2/ P- a, v/ Z( O" Q) _
        else clone 1 load to P_pick32 b! e* r& t$ ^3 D- Z: c# Y
end
8 b, B& F$ ?" k: o# }
0 ]6 F- v' ^8 a+ r  Y5 s- mbegin P_pick1 arriving! t) H3 N9 C- x8 X6 @
    set A_i to 1& C* d5 o% {( s
    move into Q_induct1! S) f" V$ J" ^6 {) v
    move into pickaisle.induct1
; |% Z; x8 C0 V2 |    while A_i<=30 do begin4 a* J8 J4 Q0 u1 D# n
        travel to pickaisle.con(A_i)7 j. d) t7 ~3 U% L9 W4 P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, {/ V, s- @) ^, H: |8 s        else wait for 10 sec' ]0 O/ F; l- Z2 S; Y5 Z/ _$ f
        if A_i=A_leave then send to die
* L' ^6 _9 x& L; t# [4 {. }        else inc A_i by 1
0 W3 k8 V, g7 g4 C    end
+ h4 N; p1 O9 s( R! o8 l& \2 ?- |8 Wend# N, ?6 r2 h, H) P

! |4 |6 G) c5 c$ d# G* |, wbegin P_pick2 arriving
' n6 W8 O2 I( I& I9 I, L9 Y    set A_i to 11
3 d9 p; K& W- }- f- h5 Z* ^% i    move into Q_induct2
3 B5 |' s* ~8 W; B    move into pickaisle.induct2
# w4 g0 Z# ~: v4 E    while A_i<=30 do begin
$ h+ E9 V3 L" p6 L5 O7 b        travel to pickaisle.con(A_i)4 N7 I9 L' l; t) ?: }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 R- Q/ e3 j7 X        else wait for 10 sec
/ m, p! t5 B" r  _, H+ j        if A_i=A_leave then send to die
# N8 m7 q& x4 K5 {" m0 Z1 ^        else inc A_i by 16 y' e. E3 ?1 J  t- v/ F2 M4 j
    end
2 G6 S+ w  t. w; R4 u+ A( ^! zend
- H6 o# d/ o' R! G4 w: x% ^! h& Q+ V" |# X' x( k* \
begin P_pick3 arriving
1 B% k% R; S+ K+ Z- j7 j    set A_i to 21
9 }$ X$ J  D- V2 L7 N' j    move into Q_induct3; H5 }& s1 w1 K6 ~
    move into pickaisle.induct3
2 i% U! [3 |3 P+ G- |; N2 Q: ^    while A_i<=30 do begin" ^$ m, I) W2 ?% X3 [" h
        travel to pickaisle.con(A_i)1 ^2 ~3 P% r( K2 x- t2 Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& _6 H! ^$ g1 y) M        else wait for 10 sec
8 D5 b% k: T. w/ Q2 f+ s+ b        if A_i=A_leave then send to die
! I) t2 e3 w0 s        else inc A_i by 1
# I# G/ _# W0 ?, x/ Y, G    end
) }8 p9 D3 q; wend

最佳答案

查看完整内容

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是个什么东东?; S9 Q4 V" x- V
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  k) `$ C- Y) u( H& d/ l  w, s

: \7 {6 Z$ d& _AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
# a8 w- A3 Y3 ]) v/ N8 K% p7 a4 c2 C6 j- H" A8 K  L
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
& F) t6 B: T3 A* N4 }1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
" O5 r6 {! o! G1 E0 _& N7 a: Q$ @2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ e/ ?. r6 W4 G" k: }% d" M6 I- ]! D
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
: @- x  m9 M3 Z( h  ?' vbegin P_induction arriving
& e8 G% F  w2 F$ j5 _" [    clone 1 load to P_pick(A_induct)  e+ C5 Y: R( p8 x# L- |
end最大的系
4 o* O6 N. I- w% ]: D
6 t0 I# t7 e1 f. l/ n5 ]( [9 P- Ybegin P_pick arriving) r/ E7 \/ N1 \( W$ g2 ^
    set A_i to procindex * 10 + 1
$ P5 v  b2 c" \. T* S4 ]( Y    move into Q_induct(procindex)( ?. R: F; C/ C7 W2 h% `, x
    move into pickaisle.induct(procindex)% v- s9 _  F( @1 d
    /*check the type of pickaisle.induct(i), for your last problem.*/
0 G& V% y( K2 ^
6 ?+ X* }9 |5 w8 D  o7 y% p    while A_i<=30 do begin
4 _' D4 y* m9 k2 s        travel to pickaisle.con(A_i)
3 C- z3 C* n- i! |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 v7 ], ]! U& ~/ }  E        else wait for 10 sec3 D1 N# [! W& n9 C9 M
        if A_i=A_leave then send to die
' L/ X: j4 F4 e0 c$ r        else inc A_i by 1
9 s( i: q& p- A1 y$ Y+ t    end
: z( Q* w% B4 o! h9 Kend, a8 D6 W5 N/ l6 v  x7 ?7 r7 {

: ~. C( Q$ G+ X0 y+ ^5 N7 o其中的procindex为整形,代表当前process的序号。8 R5 f8 T7 t* J4 I  K- j$ x6 ^
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-9-9 14:34 , Processed in 0.017445 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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