设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11881|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& J/ W' [) d. K- r. |' V% T7 Y5 f  E% a  g" I- K' N8 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中的数值,不知道会不会有什么不妥。/ m6 g# x  W0 S+ S0 z

) F0 b* t' ^. D( Z! ?begin P_read arriving1 u) H& }) @* x$ c
    while 1=1 do begin; M; d% G+ s2 \2 n: n9 N
        read A_tote from "data.txt" with delimiter "\n"& g7 i& L" d' l5 d5 f& ^0 H
        read A_time from "data.txt" with delimiter "\n") F/ ^: E$ R7 ]
        read A_leave from "data.txt" with delimiter "\n"
8 r+ H7 [' K# p3 Y        read A_picks from "data.txt" with delimiter "\n"- h1 L& i8 C) o4 L' }4 `
        set load type to A_tote% `5 w& \8 c. H) a+ N$ G+ h; D
        if A_tote="tote 1" then set A_induct to 1
* y, r- |$ |7 B& h& D        else if A_tote="tote 2" then set A_induct to 2+ u  d3 F2 b( x9 S, F3 e
            else set A_induct to 3    " r4 R1 B( g. Z( a
        set A_i to 0" H8 l' X( f* t; j
        clone 1 load to P_induction* e, i9 P* l+ i: a
        wait for A_time sec" m# C# M$ W6 o  `1 ?$ F* ~! I
    end  d; d9 w" `' L8 b% ~
end) Z% b) m8 E8 X% ~9 s6 d8 I3 e  t, }

" V$ a" B9 f" u+ I# J2 Ibegin P_induction arriving, O" K" r2 P  U" U* N
    if A_induct=1 then clone 1 load to P_pick1
8 H2 {) H! E: y' V" G' K1 A, @    else if A_induct=2 then clone 1 load to P_pick20 J" ~- e1 N% r9 Z$ o& B8 Y
        else clone 1 load to P_pick3
" q3 }0 d  K+ L; Z1 Iend
8 r( k+ O: j! R; s+ B, ?( x# w# U5 e; l
begin P_pick1 arriving, T1 r8 J6 d$ _0 i
    set A_i to 1
6 \% j" w! p' g# K    move into Q_induct18 Z' r% W- o* b
    move into pickaisle.induct1
/ E  x+ q- f- R$ n    while A_i<=30 do begin
. k! F2 g9 y3 w$ [4 X5 _        travel to pickaisle.con(A_i)  j5 n0 s* S6 O( c) _8 Y3 a4 O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 ]: v3 g0 k: P6 B- U        else wait for 10 sec
. r* x' r; R+ N% P' f. I        if A_i=A_leave then send to die2 g, y$ O/ ?5 v& |3 @
        else inc A_i by 1  b* H+ I# {. x( n0 C- I9 O
    end2 n/ _# J- B! q0 v+ S
end
' ^) ^$ |/ C# O# j7 C" ]
# ?0 c: c' N( g' c5 }begin P_pick2 arriving4 T3 R& U% M3 e8 y3 s
    set A_i to 11) w- A; _8 N7 S- [1 @) ~
    move into Q_induct2$ D/ \0 V: J. E$ w+ G
    move into pickaisle.induct2
, z5 G9 s* d$ X, R    while A_i<=30 do begin9 h' D: |9 w1 J; ?. ?4 W2 b
        travel to pickaisle.con(A_i)0 \6 w$ w5 c9 {1 J0 j& r1 }5 p: O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 y5 H' B+ X( R2 ?) d        else wait for 10 sec- m/ s( p; y! e, r
        if A_i=A_leave then send to die
8 V1 d! B; l9 j0 i9 m0 J2 ^        else inc A_i by 15 k3 L( J( e7 B: n! l
    end, D  [* a+ ~) F- @! W
end, W- x# @2 v* m

6 c" P$ P  q: g) ], d  Cbegin P_pick3 arriving  A1 {% x/ T: O: r1 C. v& z7 e1 N
    set A_i to 21
" b0 ~5 [/ e& N3 x$ Q    move into Q_induct3
  R* v* x) B# G7 m+ `. X    move into pickaisle.induct3
3 n2 R9 Z6 j9 |- _: W7 X    while A_i<=30 do begin
6 ]# e& R) o- N: J! B/ Y        travel to pickaisle.con(A_i)8 k9 H4 }# b7 ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ Q4 Q0 `5 E5 c& z2 |: ~4 q        else wait for 10 sec
% `+ y& n0 @+ b/ o/ d        if A_i=A_leave then send to die
0 K9 q+ i6 G0 W  y! Z8 e1 O. @3 d, N) M        else inc A_i by 1
4 f* B  B3 M4 j% N' M    end) y. l4 y5 ]( E
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是个什么东东?
; j; o8 \- s( \) G% A& H4 O& E2 Hmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ X/ R# z; n+ j: z* @8 O7 w! E  T  y, V8 [( A, {  \
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。1 ]" f# _8 A, g" [4 w1 X2 v

: H  T  @. d( e- _8 o# \) d6 g另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ Z5 j# D0 i( b$ J' L9 y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  S9 C8 S/ G8 O( a% J. M2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;3 {# [' ~2 l6 w# {8 N' r
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
4 }! e# F  g: X7 w: @1 Y7 _4 ^begin P_induction arriving! p# b6 [; e3 E8 Q! [- j5 _) X. U6 u
    clone 1 load to P_pick(A_induct). S, z4 W9 O3 l/ H% a6 F
end最大的系. S( t8 J! ]0 b' A/ x
# i$ N" ~- V6 v9 `
begin P_pick arriving" P/ _& A! j, `' \' D( Z$ i1 [
    set A_i to procindex * 10 + 1
4 G( U9 V( y* |. t, v( x& O    move into Q_induct(procindex)$ J8 I$ w* Z. f9 O
    move into pickaisle.induct(procindex)7 F! \1 Y# j% {, Y; N4 q3 R
    /*check the type of pickaisle.induct(i), for your last problem.*/
: }! ~3 Z" a) F# i" Q9 m# }8 \3 G& a3 L' |0 z" c
    while A_i<=30 do begin
* E8 Z$ l2 }  {% w        travel to pickaisle.con(A_i)
. h8 g& o3 v9 L9 b  y. ^9 M+ a! J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 R# |8 g9 J7 C8 w3 w2 X1 J
        else wait for 10 sec
' A: J# N8 d6 w        if A_i=A_leave then send to die# D, _% l5 {$ z. c, P
        else inc A_i by 1- ^/ n# a* r- ]$ L3 [0 _2 F
    end" o+ S5 A( M7 L# B( N
end1 {  e6 K1 B7 [0 {) R" L
1 Q% Q$ \2 @$ E( e
其中的procindex为整形,代表当前process的序号。9 U  A$ r6 F; B7 K
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-12-12 14:57 , Processed in 0.019019 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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