设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12818|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 Y2 R  x- W2 ^
  F2 f4 X4 Y! d7 Y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
- e9 ~" @4 S5 q; @' a, i5 h6 p* w9 K- @4 A( ?# a5 H  r7 X
begin P_read arriving  U8 ~  N2 _4 D) l* Q
    while 1=1 do begin/ l! o6 I4 `# y" h
        read A_tote from "data.txt" with delimiter "\n"
2 I  o6 a# M. P, d        read A_time from "data.txt" with delimiter "\n"5 ~+ `" c" P/ g1 R, ^8 P
        read A_leave from "data.txt" with delimiter "\n"" G9 G: U+ h. m9 P( j8 @: g  J
        read A_picks from "data.txt" with delimiter "\n"; d; p; i( z& [/ |
        set load type to A_tote
( `/ K8 W, g  `! _4 O0 M+ Z9 l        if A_tote="tote 1" then set A_induct to 1% |7 ^6 I; Z% x" N
        else if A_tote="tote 2" then set A_induct to 2
2 e% P5 r0 W. _. l8 U5 |            else set A_induct to 3    1 d$ y! @) c9 l2 }/ B9 G( V6 v
        set A_i to 0
3 n+ k5 C  @& F0 y# O- T        clone 1 load to P_induction
- w0 Q- ]& t  e9 w) }7 i        wait for A_time sec
  i: [3 `3 b% E% U- U  b# Z  L. T    end
2 j- |1 b0 k& c0 }. x4 o4 Fend
$ q- n0 F8 H0 P7 E
: y) j0 |9 r  T, j4 I% O0 f/ Zbegin P_induction arriving# I* P  H$ o5 V! }
    if A_induct=1 then clone 1 load to P_pick1
8 \% T  T" K. N7 C% X) y    else if A_induct=2 then clone 1 load to P_pick2
  X' o* m! c0 [, K        else clone 1 load to P_pick3
' ^' Z) B3 {6 O7 P/ B( Bend% ]) O# s  P, T8 N+ w

: W. `0 ^1 X) U: m; c' V8 {begin P_pick1 arriving  D& O5 N% \" q! E+ B$ V
    set A_i to 1, B5 W8 E% g" p
    move into Q_induct1
8 `" H; ^2 ~* h; T1 s    move into pickaisle.induct1
' C- n0 I5 f, [7 T    while A_i<=30 do begin
- A) y1 e+ f+ A* q( K9 `        travel to pickaisle.con(A_i)
1 O: v+ O# f' C% Y5 D% V9 d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ F$ v/ b/ n" b9 f) p        else wait for 10 sec
/ T6 D- t) E4 K        if A_i=A_leave then send to die
) e- V% n% q) {; }        else inc A_i by 17 X& S& v( }) N
    end
! p: P% V9 h$ w4 o6 F# N3 aend# d7 L; ~4 i5 D4 @% m5 U- d% F

$ o; R0 J  D  N+ F0 K6 G4 a+ fbegin P_pick2 arriving
* ?" H0 _; V/ B; B4 T/ D  v    set A_i to 11
% Z! k: b, T  n* Q) i. L7 k6 V& J. d    move into Q_induct2
( I  b* H, Q3 v1 U. I' s    move into pickaisle.induct25 b! L+ e* j3 V
    while A_i<=30 do begin- X% \" C- I! r) ^1 j2 Y/ F
        travel to pickaisle.con(A_i). N1 Q2 q# G# s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) |2 x3 _0 L. f* s4 Y5 ]1 f        else wait for 10 sec+ w* k1 [# K; F1 h7 \1 V4 o  v! B
        if A_i=A_leave then send to die* A4 \6 U  S$ Z2 H/ Z) ?# ~9 y4 w
        else inc A_i by 1
7 s9 k/ v5 J  o  g    end
3 ^% k& W8 c0 [! j" _1 s1 Iend
! L7 I+ p, O) X2 L- a( z, H7 C% s: h1 S5 O
begin P_pick3 arriving
" x; p5 |1 {# {! E- \) \2 ~! h    set A_i to 21# N' T' A+ k- t, r/ A
    move into Q_induct3) l$ D/ L1 F# J: x, N
    move into pickaisle.induct3
/ u8 m* [4 M  S' I. V" h    while A_i<=30 do begin
8 s- T: M/ e$ Q& U        travel to pickaisle.con(A_i)
) Y) e+ E% C+ h* e2 u# c% P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 N" n" X% _3 `
        else wait for 10 sec
" Z9 O# J+ ]- F$ Y6 i) d" t        if A_i=A_leave then send to die
( }4 q1 z- |& A# x* ?        else inc A_i by 1/ K; V% z) b1 l5 Z/ n% p- H
    end
- t6 c8 G, U1 @! M; W  z' `2 Hend

最佳答案

查看完整内容

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是个什么东东?8 O4 Z/ o* [6 X' I: I7 M
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
3 r  Y' C. Z  H5 Z) u) v# P' p# D  [) R$ n: p# [
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& Z" }! d( O: T" z" p9 r4 d! e! K. ]' O
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 h5 |  f" N. y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;) U: W$ ?' I5 S
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 N/ t$ b) b: z: S3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 ]0 q4 w, ~9 J" K, ~7 K* r3 Qbegin P_induction arriving- V5 _9 G& O& M" J6 G5 N
    clone 1 load to P_pick(A_induct)- c9 F: Y0 K8 q  W
end最大的系+ T0 P. ~% m# g% _7 P( i5 M4 ^

! H, I, I8 x; \% ]begin P_pick arriving1 {2 M7 T5 ~, A
    set A_i to procindex * 10 + 1# t' F+ H1 N8 l' Z1 S
    move into Q_induct(procindex)
( y& Z% i+ a$ z- _# v    move into pickaisle.induct(procindex)7 H! S& E$ X5 K- b
    /*check the type of pickaisle.induct(i), for your last problem.*/6 G, \2 n( k$ S+ ~6 N
% _; j- G- X# ^. m* j" @" g
    while A_i<=30 do begin
! _8 a- g! j( }7 B/ B+ c* z  Z        travel to pickaisle.con(A_i)
4 k. m) ?5 p3 Z) c" c5 f7 k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 N9 I7 D4 N$ N! F5 a  r
        else wait for 10 sec2 w5 R8 P" J% L" v" f6 h# l/ c
        if A_i=A_leave then send to die3 h1 x' E- j/ G1 b
        else inc A_i by 1
7 ]; v  q: X! t- x$ Q    end
& {7 F0 \. U" g3 h& R4 E# Fend( a0 u5 z: a0 F- P) ^

+ A5 a3 e! \, J6 J4 o( y% g1 X其中的procindex为整形,代表当前process的序号。
3 t  w  @, o7 l: F% d4 X- Mstation和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-2-22 14:29 , Processed in 0.016444 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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