设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10667|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! \; q. |0 V+ _0 g8 i( I9 J$ H) u; K2 x6 z. T$ c
我的问题是,在每个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中的数值,不知道会不会有什么不妥。% Z7 ~: B8 S/ z3 U7 ^

; f2 @' U( y- ]: s$ v3 Z# Sbegin P_read arriving
1 U7 x, k! c2 X    while 1=1 do begin
' G( i/ Z) b* w        read A_tote from "data.txt" with delimiter "\n"
" S( H. r0 M4 v- i' H8 I7 P. |        read A_time from "data.txt" with delimiter "\n"+ Z8 u% I4 }5 t3 T7 e4 L/ m
        read A_leave from "data.txt" with delimiter "\n"! K& l5 e" @0 d1 H
        read A_picks from "data.txt" with delimiter "\n"8 g6 w6 M/ i& {9 {6 @. z2 `+ ]
        set load type to A_tote7 f% y  m# @. a, U% l9 d8 c
        if A_tote="tote 1" then set A_induct to 1) H# |" P2 n6 P8 d
        else if A_tote="tote 2" then set A_induct to 2
, U  a9 h# s0 Q1 q  I            else set A_induct to 3    2 w, J: L- v$ F$ S
        set A_i to 0
. p% ~: N/ Q! G  j, P, M1 w        clone 1 load to P_induction
  @- U2 }4 v% m- m- O        wait for A_time sec5 o0 c; {$ }+ Q8 {* r) V
    end
9 l7 v# B( P. h" I5 C; a) Mend
, y) H( n3 e+ q7 N- A
8 I. ?0 U8 j" g! R$ j  ebegin P_induction arriving' Y' ^( o# D* A% g
    if A_induct=1 then clone 1 load to P_pick17 O( K4 e; X: z  W% ]# N  q/ n
    else if A_induct=2 then clone 1 load to P_pick27 s! x4 H( U/ S! S8 \7 w
        else clone 1 load to P_pick39 H- [, f1 `# C
end
* L3 q: E; V5 c9 [) ?) K3 I" G9 C0 e. h3 C# o4 k; c+ c
begin P_pick1 arriving) {; q: e" f* j; _
    set A_i to 1
" n. p, K7 }, ~( q    move into Q_induct1
. `. f' f$ e& [: k    move into pickaisle.induct1
! r' r, [3 R" F3 D    while A_i<=30 do begin% X) x' m, o" ^: }3 ^2 \, g
        travel to pickaisle.con(A_i)' ]% d2 i* Y7 m- V3 i9 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! G2 |. `9 l  u( {. a        else wait for 10 sec0 K* ?5 d& G/ e
        if A_i=A_leave then send to die; b$ k) o! g* Y3 v! U
        else inc A_i by 1
( O( c$ A7 c; g4 i# a, b# R    end3 N, s+ p+ h' E9 D+ s" b1 O8 z
end
+ j; }3 R* u" V: d) ]5 B
: A* ^" s, d4 S+ ybegin P_pick2 arriving& L3 Y8 B# O& l/ n( m6 E# H
    set A_i to 11
) X1 C/ w4 l, c    move into Q_induct2
/ _3 [. ]  I6 ]  [1 S  F$ x    move into pickaisle.induct25 [2 w! V4 W0 R! x/ I' [# V
    while A_i<=30 do begin: V, L+ ?) I* d( g' ~: b
        travel to pickaisle.con(A_i)6 J1 k5 P$ }. d/ B' [$ Q/ j* k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( [3 e/ m$ N' A* V8 U
        else wait for 10 sec6 d8 A2 ^' ?8 E1 b5 H( {
        if A_i=A_leave then send to die, E$ N- o, {  p. }( l) m
        else inc A_i by 1* Y+ G* V5 H! d# a( R/ k
    end8 f& f  f/ ?. `; ]; e" S' u
end
, S$ [1 [) ]. ]% F" E# [6 ~  R6 M3 T, v
# e  B  z, X+ S! qbegin P_pick3 arriving2 Q8 E! _: Q. r& V* x
    set A_i to 21
4 L6 ~! x9 w/ e% Q* n8 u( d    move into Q_induct3' S  j7 O% L* i& ^0 O9 C. X9 g
    move into pickaisle.induct32 V( d# a; W/ o% @
    while A_i<=30 do begin- u; E9 O3 N; H' g) J& g
        travel to pickaisle.con(A_i)
. R+ B2 s1 c' g5 ~0 u9 F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ Y; y, R0 C/ n8 Y
        else wait for 10 sec) x0 K& o2 G3 a# `: Q( M: e
        if A_i=A_leave then send to die1 x3 `# B% C$ Y' j# p
        else inc A_i by 1  {" V' Q  e8 u" B
    end
/ i: V+ _& k* {: rend

最佳答案

查看完整内容

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是个什么东东?
1 I$ L- q! d/ W! V* p, [move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. l9 U$ d3 D2 J! M: T0 z
) p+ k2 S) W5 Q8 V1 tAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 `6 Q3 h" W! _/ {7 P( O& L9 r# E
0 t4 r; s& A0 A3 I  Z. |$ M# \5 v& Z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:" ~; m( D$ {' L5 V
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;1 u) a8 I- _+ F: z4 w
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ A; G# E1 j9 J: t) u3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ j. ]( f5 s2 H1 u
begin P_induction arriving8 g4 }/ A- c8 `- ~
    clone 1 load to P_pick(A_induct)9 ]; Z; {; @/ ^8 H2 _9 o$ Z8 ~% I
end最大的系" [1 ~' G2 c5 h; o: p
4 T) ^3 u% a+ U
begin P_pick arriving3 y/ |& K$ f: h$ v- e: Y
    set A_i to procindex * 10 + 1
$ U9 n" F  o% x2 w. x% V    move into Q_induct(procindex)5 w' h3 K! \) S) l% {1 h1 H- @
    move into pickaisle.induct(procindex)2 m. G: Z" S9 K. t: P( X+ `
    /*check the type of pickaisle.induct(i), for your last problem.*/
; D) k' X1 L2 A6 _, V1 N# y' v% V& n7 _5 L, H# ?& Q) z0 k- I2 {  Y
    while A_i<=30 do begin
" h1 z0 n5 [; ~! c        travel to pickaisle.con(A_i)
! ?1 E3 Z, \& \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% Y0 v/ w7 Y+ x7 I: y! D) W        else wait for 10 sec' F9 |2 x. v5 d: Q
        if A_i=A_leave then send to die
" [* N* F: q9 O& y& ~( X        else inc A_i by 1
! t4 Q+ J( e$ x. j4 d    end
' \6 I1 F2 z; y0 E: z& cend
0 d" X' _. C# o% u( V: F# h. h6 O6 p! o4 F& P3 C
其中的procindex为整形,代表当前process的序号。  J1 I) V) @) E- n+ s5 U. B# G
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-9-18 03:57 , Processed in 0.015510 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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