设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9784|回复: 2

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

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

2 @& e& ?  l" q7 O- I" Z2 X) \我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ q6 s" B, Y5 E, S0 ]. L# k) P6 R9 E' \4 G+ l
begin P_read arriving" V) J8 R! t6 b4 w; W; J
    while 1=1 do begin# s5 ]1 C0 Q# S- s& R# R  H
        read A_tote from "data.txt" with delimiter "\n"
, S2 Q6 b  u1 y4 h        read A_time from "data.txt" with delimiter "\n"
! m* o3 V) Q' t0 _. }; ?9 g4 @        read A_leave from "data.txt" with delimiter "\n"
, A( c0 H: P& e$ e        read A_picks from "data.txt" with delimiter "\n"/ v3 x( x) E- h
        set load type to A_tote4 o5 l! X) I8 Y" O
        if A_tote="tote 1" then set A_induct to 1
; W/ B; j& o5 D# @6 u1 T5 u2 ]        else if A_tote="tote 2" then set A_induct to 24 \0 ?9 Z! ~1 I' ^
            else set A_induct to 3    + E3 R6 i. p9 M( @8 I& |
        set A_i to 0
# p  k) f3 a4 ^4 D$ D        clone 1 load to P_induction
1 _1 N9 r6 Q: F. I9 _        wait for A_time sec
! R9 U( f/ o. u8 y* Y    end
9 y, D" b& A5 y$ c1 |: n- Kend6 G. g  z2 [0 _" n+ w; }+ C

; b1 ~' e' Z4 @0 l, r6 ybegin P_induction arriving
) z' s* H  o! W6 b3 Q4 q5 z    if A_induct=1 then clone 1 load to P_pick1+ F. g5 Y" }% |! G6 t2 s& m& I# C0 N0 N
    else if A_induct=2 then clone 1 load to P_pick2
0 q. o8 q; j1 }4 g* r7 t        else clone 1 load to P_pick3  o0 S# K/ _# {) l6 l
end8 Z) Z  D1 D- l0 A

3 x( U: @6 L* w" a4 Q& W1 }begin P_pick1 arriving
* x( t+ }" z- P4 {    set A_i to 1. u2 o" J! Z: j0 @0 O/ K3 {
    move into Q_induct1
3 y- R0 l. |' \$ G3 E% c    move into pickaisle.induct16 l8 Z. |( m1 X$ h! X, ^
    while A_i<=30 do begin
. P9 v3 ^4 b+ Y7 J, K        travel to pickaisle.con(A_i)
9 S: s+ a& s9 s7 }; O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( m5 N6 V& M6 \% l/ _        else wait for 10 sec+ q# M5 M$ T9 }0 R7 H- t
        if A_i=A_leave then send to die6 {: h5 b1 m; T! P- y
        else inc A_i by 1
2 V$ n2 [3 p8 ~: F8 }    end
7 K4 ~+ ?; @' }$ Mend! V% V: P3 N3 {1 @! {3 V% F

; A; O) |$ y+ Wbegin P_pick2 arriving) x; l! `' H/ ?
    set A_i to 11' ^; ~* }# @8 x# X& U1 a1 n
    move into Q_induct24 N5 Z+ P7 b" u/ I, ^8 g$ s
    move into pickaisle.induct2. q+ \4 ~% `$ W$ o3 ]( D
    while A_i<=30 do begin
4 t8 o/ R! B3 b/ i! r2 u$ \0 X        travel to pickaisle.con(A_i)5 c$ M. S$ h5 S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 _; i7 M: |- q/ t, @$ u4 X' a
        else wait for 10 sec
' u3 B& r: |' P        if A_i=A_leave then send to die0 V0 v* ]9 Z4 V" w# Q) g4 [7 t
        else inc A_i by 1" ~9 i) }: U" V
    end
  j/ _2 d# R3 Z6 G- Gend
  t6 |* E9 r) C( }! O( O' \2 g7 z) h6 J' X$ A+ h# F' s3 e
begin P_pick3 arriving9 Q+ o# z( U; n- [3 g0 g& C
    set A_i to 21+ W6 F* ?6 A8 Z4 F; F8 T
    move into Q_induct35 X$ p& L& j, b! `9 u
    move into pickaisle.induct3
4 z* C. r$ ]! b' [1 J8 w' o' r: [, ?    while A_i<=30 do begin
+ c6 ]% V: e; a! q. ~        travel to pickaisle.con(A_i)/ {. o% {% l" t: j: \7 d% l0 v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; H; }+ H7 _* o
        else wait for 10 sec2 a! z. @+ ?8 F' ?; C& s
        if A_i=A_leave then send to die
( @8 A5 |, u/ q0 L4 B& l# C% O' r        else inc A_i by 1: R- w+ P3 z8 w2 J# M2 c
    end. }( l' @( a, v. q( z
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: `! }8 p" Fmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( K) a* W! N5 ~+ ]: A4 A5 V
" L+ s  U" R' b7 w3 rAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) r6 l& |+ ?8 n
. ~# l/ W+ I( S! Z) O: L. Y! Y! [另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:* E. a5 h* R3 k; L) G2 g
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 I6 Y# u/ J1 r! ^) u( h) U
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;. M% }: z0 K4 u2 l9 H9 o4 {+ A8 B" i: x: b
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
9 r1 m* X3 |; k+ Y+ fbegin P_induction arriving
( T  T1 r( A+ s6 @/ q$ D    clone 1 load to P_pick(A_induct); v# O6 A( `* w. {" A% x( X' c
end最大的系% t5 J( A: M% `3 E  e% j

+ O' L# F$ b' P! F6 P8 Abegin P_pick arriving# V8 S4 W8 l. T: F: t0 l) S
    set A_i to procindex * 10 + 1
$ n+ C. O  y* l: h. S    move into Q_induct(procindex)
6 J, }: ~2 K/ H6 q: X    move into pickaisle.induct(procindex)
4 m7 A; B8 |. a    /*check the type of pickaisle.induct(i), for your last problem.*/* r- P/ ~" ?& s& u) @) e* s* A

1 G7 L/ L( }) t/ B7 _$ {7 m/ w    while A_i<=30 do begin# b: F& @' c) y; z" A7 u
        travel to pickaisle.con(A_i)  B5 d1 y4 Y- N8 S) L) `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" B' f# K! s' x4 d3 ]
        else wait for 10 sec
* n/ h5 ?) U0 d% q# z        if A_i=A_leave then send to die
3 M+ o& [, C! v$ }  N* o2 P% N        else inc A_i by 1
, u. X/ i/ }' i8 B6 d, d- H$ U) R    end
4 b, r8 w2 o* ^. ]. ]! g( Jend& k3 P3 }' R. m4 L# O( G
# `3 _9 Y- ]! v% m
其中的procindex为整形,代表当前process的序号。% ?2 u) U1 B, M& ?) M4 X$ r
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-7-4 14:49 , Processed in 0.018739 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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