设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14146|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 v) O5 F5 n4 S; G) [' s) x

* s: p- q5 h" ?1 V+ Q$ n我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ ^. `$ f3 D4 ]
+ P+ j, x+ b' m- H( t, M  u, cbegin P_read arriving
3 G5 s, [* e( m+ O( p3 E    while 1=1 do begin+ }. K, `4 `* k3 \+ w" f  N( d
        read A_tote from "data.txt" with delimiter "\n"
8 q' d, y& Y- t- c2 R        read A_time from "data.txt" with delimiter "\n"
/ J9 t+ G' g5 c5 Y6 a        read A_leave from "data.txt" with delimiter "\n"
. E; E, z7 e' l5 n( g        read A_picks from "data.txt" with delimiter "\n"5 n0 ~5 K( a- w8 }, P8 R
        set load type to A_tote, a+ @+ ~( D% ~0 ?9 y6 u3 w
        if A_tote="tote 1" then set A_induct to 1* E3 N0 L# j1 k: i& [) S
        else if A_tote="tote 2" then set A_induct to 22 p/ K& p1 v" I! }
            else set A_induct to 3   
- E, t" N. G( W2 V8 I/ [! V        set A_i to 0
6 ~4 l; C  _' M8 w* U4 H- H5 A+ D        clone 1 load to P_induction
- P( R( u+ L( I9 v6 g) t        wait for A_time sec% n" @' r$ \" f6 O$ P8 A9 j
    end* _$ _- [8 u$ B; A
end! q) @  M- D* C! K' T

/ I1 c* ^) _4 l0 Ybegin P_induction arriving
( |9 S" D* n% h5 e) F0 C6 M    if A_induct=1 then clone 1 load to P_pick1) j$ D/ z1 K; h% d& }% a8 f
    else if A_induct=2 then clone 1 load to P_pick2
! ^% Y; {3 a# n, |( q4 A2 @        else clone 1 load to P_pick3
. o/ `# g# ~2 J# N- v* Kend7 q/ \. B- t' n( m2 n
$ q( j$ o6 C2 m/ U. H9 c; M5 X2 U, r
begin P_pick1 arriving& a- `5 i- D( `
    set A_i to 1
* S: i4 S2 l* i/ t/ J    move into Q_induct1
3 {, U& y/ U- r6 @    move into pickaisle.induct1
* E) g" j: a' K8 e% F3 t( y- X5 C2 ~  G    while A_i<=30 do begin& [' j. b6 T. R# k: A7 F- ~
        travel to pickaisle.con(A_i). n. F1 W+ ?; P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 T. t- `, q( K/ o0 d' u/ f  t7 L* m
        else wait for 10 sec! d) ], ], ]$ j+ J/ Y$ |. a& ^
        if A_i=A_leave then send to die2 W- T2 F& Z! w. V: S
        else inc A_i by 1. _) o3 N3 j1 v$ @0 q- Q
    end
# c$ H) e; V# G( Z8 Aend2 ~6 y' }( {) i& r8 Y7 `

+ f  ^0 m! D) u0 c" X) U" pbegin P_pick2 arriving6 v& Q( N; r2 [; A6 t4 C
    set A_i to 11
" j, |3 v" D/ T6 L8 }( t. u# U3 A    move into Q_induct2  S$ z6 Z* X# G6 _9 X8 Z# E& [& {( l
    move into pickaisle.induct2
' Z0 l; w: J1 I4 r    while A_i<=30 do begin! e- ]  c8 {& o4 h* B
        travel to pickaisle.con(A_i)
& u, h7 d  \% h1 c# J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- c, B5 w% n0 p  e  E4 g* J, [3 c" O
        else wait for 10 sec
% E' J8 X# n6 X2 l' V5 G% o& m) J        if A_i=A_leave then send to die5 R: f5 x# X( j( C' c
        else inc A_i by 1' V  K/ e3 u. v3 A! }: E
    end" Y+ \# s8 `! x6 Y4 P/ W
end
  l+ y$ v2 m- _0 }! X& r1 F) _: g' w7 Q) \- s( L1 ]) x) Y; f' v
begin P_pick3 arriving" i: Y) W. y5 q* O" Z. T/ t
    set A_i to 21
+ v) v: i) w# q0 r; p1 X! |    move into Q_induct3  r" }7 @; C0 f7 n
    move into pickaisle.induct37 x0 z7 }$ |  U9 Q5 O0 t! F
    while A_i<=30 do begin
" W2 u2 n/ G6 [' z) w" D  q        travel to pickaisle.con(A_i)
7 R' l9 S9 X7 k' C, i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( X& E0 \; [( M$ m4 k        else wait for 10 sec# x/ m# w  w9 @* V
        if A_i=A_leave then send to die; K; ?( S. ^: o# S5 c7 p2 ^* N
        else inc A_i by 1/ v* `2 L; J' Z2 [
    end; E7 Z6 J( L+ |
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是个什么东东?- [; A$ H# u4 e) A7 _& S: q3 B
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?; k1 f* u: M  F( [

  m6 {* `6 v  \! p! n  x3 FAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。; R3 d8 q! a0 w, Q' }' k7 g% y

9 }9 @+ ?* p# N另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; @) i' X! L$ k) G- O1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 l* v9 }. Y2 x2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
, k1 `# Q$ U3 r) u3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
4 Z$ R" E' q" jbegin P_induction arriving
6 _/ ~8 i9 i0 S. X/ o6 A8 v    clone 1 load to P_pick(A_induct)
7 {! d4 N( ~8 G! T; M3 Eend最大的系
' Q" r0 r8 j2 V2 e3 c5 i+ q2 t% r- b) x( @9 ?& G8 n  B  S8 E
begin P_pick arriving
- `7 r9 M& k( b  x; P2 Q# U* E7 g    set A_i to procindex * 10 + 1/ T* A2 ]& t5 r7 I" o4 y6 M
    move into Q_induct(procindex)
( r4 S. K$ X- c7 Z' g    move into pickaisle.induct(procindex)3 s" h2 ]/ Y9 H' S7 c0 ^+ t( ]7 i
    /*check the type of pickaisle.induct(i), for your last problem.*/- r" O2 P1 q4 S2 y; G
8 ]. l# c3 S. X: |
    while A_i<=30 do begin
3 [0 L# j; Y- ?5 v6 X3 F* @! ?        travel to pickaisle.con(A_i)/ ?9 Q: _- g  B4 R) c! ~8 {6 h3 |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ i" J# R2 c9 f; z8 Y! ]8 T        else wait for 10 sec% c: F3 U! x2 Q6 H* J
        if A_i=A_leave then send to die
* p$ ~& ?) d! J1 G3 j        else inc A_i by 18 |/ L" g+ v6 N0 h
    end
) h6 m* Q" W5 E4 hend6 V* a+ [- [  T  J

9 b4 b/ {' o+ o' A: D# \& f其中的procindex为整形,代表当前process的序号。
1 T7 x4 y. J7 ystation和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-6-14 08:58 , Processed in 0.015969 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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