设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15538|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 \5 m6 D6 W: N7 z  Y  l! @; _- ^# U& k7 O
我的问题是,在每个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中的数值,不知道会不会有什么不妥。% q( O; _% E9 ?" [' ?
, m) ^, [4 \! J2 W
begin P_read arriving5 H8 ~" X/ M4 o$ ]
    while 1=1 do begin0 Y  `. o' _- q# s
        read A_tote from "data.txt" with delimiter "\n"4 h6 q6 s9 |$ I7 J& S- o' ^$ U$ n+ n
        read A_time from "data.txt" with delimiter "\n"
4 f+ s* u/ w5 Q% Q        read A_leave from "data.txt" with delimiter "\n"
1 w( b' \+ {7 H        read A_picks from "data.txt" with delimiter "\n"
- C/ j- K" K, p, w        set load type to A_tote- o& }3 _: }( b  Q' j9 K* Z
        if A_tote="tote 1" then set A_induct to 1
4 }: w  M/ L9 G5 N  r* A        else if A_tote="tote 2" then set A_induct to 2
4 e) f1 ~* z' W1 v# R" Y            else set A_induct to 3    4 _6 Y3 v  l; w9 N3 N) f
        set A_i to 0
% s9 b0 v6 |- c6 J/ o        clone 1 load to P_induction* R5 d  t% k( q! K+ ^$ |
        wait for A_time sec8 j, ]3 z9 h: E) W, U
    end5 ]! s7 M1 E/ U; V
end
- f" l0 U8 N7 D5 n6 g" ?. B  U7 ^) ?' U2 C
begin P_induction arriving) s2 x4 l+ S/ _; b% S6 w5 o' |
    if A_induct=1 then clone 1 load to P_pick1
0 I1 ]3 A! a: m    else if A_induct=2 then clone 1 load to P_pick2
) d" [. ?% p" |        else clone 1 load to P_pick3+ ~  a% o- X* c8 o* T2 t
end
- i" s) z, Q6 z% G% P; N/ {
. [4 V8 o( u% u' Z' O; T. z( abegin P_pick1 arriving! R8 N# E7 x4 ?$ p* K. D  v
    set A_i to 12 S7 g4 h6 x7 e
    move into Q_induct13 V( Z; _  J6 M- {5 S$ j. i
    move into pickaisle.induct1
( u( A6 C1 x# r5 l% l  Z    while A_i<=30 do begin% y; U7 F1 ]4 ~% i
        travel to pickaisle.con(A_i)0 M; t$ ^- A. P, ^2 x$ k2 S* t$ E3 B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 [& c8 f1 ^5 V        else wait for 10 sec
9 Y. _' p2 \+ D' W, w        if A_i=A_leave then send to die
+ D1 L# J5 C# K( r: O+ A- @. l        else inc A_i by 1
3 n  y1 ~+ I2 ^    end
  P" T* r2 y) ~$ J" @end# ^1 e: P8 X6 d9 q/ g- ]
1 _" c! S( D0 ?  E( m
begin P_pick2 arriving
! B& j( m7 E% i! d    set A_i to 11
( P- o- k" f3 C1 b/ H    move into Q_induct2
+ \# _  Z! C( L8 \# g+ d6 v    move into pickaisle.induct2
. Q) T6 b$ R% e6 ]    while A_i<=30 do begin( O! R. J! K3 \% q: _; G$ }
        travel to pickaisle.con(A_i)4 i4 {0 L/ ~' z7 ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" U- P' f) D0 ~8 C
        else wait for 10 sec6 z1 Y0 s; I1 Y" {
        if A_i=A_leave then send to die' k! y6 R$ }$ q# E0 [1 t
        else inc A_i by 1
( L. u& @! E8 l$ F. K/ _    end/ d' N; [9 n; V! V+ y/ Q
end6 Z0 ?  |: Y( W/ X! [( D7 p) ~

/ y9 z0 N& G1 nbegin P_pick3 arriving( u& d0 }5 ^9 E( I( d
    set A_i to 21) H9 `/ l7 b* l) N7 f1 D# Y
    move into Q_induct3* {' n8 u. \: {0 ]/ w# K0 Y
    move into pickaisle.induct3
' J/ v* ?' ~' l; X$ i/ s! L1 F    while A_i<=30 do begin
% V4 v; V! ]# v% h  P# n" A        travel to pickaisle.con(A_i), K! i7 l& }2 Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' E* x, S% r4 G5 j% }        else wait for 10 sec! A& @# Z9 h9 n$ K% _0 n1 v: h/ a
        if A_i=A_leave then send to die
0 v( [$ Z" g* i. ~" S        else inc A_i by 11 U% G( s  h% k1 a
    end/ g# M9 ^+ `8 @* o) V# |/ {' R* u- u: ~
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是个什么东东?
2 L+ |( q5 u6 W5 P" n+ n& t& W5 |. jmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( ~3 m/ Z8 ^! N( g) u5 x) i  l

( t6 Z# S; l8 B8 `# k: aAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
/ r  x  l/ k$ u+ C+ ^% c3 `9 D1 t' G$ ^, p/ C
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- z' f/ d, T% E1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' Y7 b+ U6 J7 T
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
. {  l- r3 r" A% Z# Y3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
9 z6 X1 h8 y1 ]# u: Sbegin P_induction arriving
5 v- R# q( j& |! s& u& h# f    clone 1 load to P_pick(A_induct)
* L+ f4 w9 }! Q! `  Rend最大的系
% n9 ]3 _% a- O
* {2 l" F: K+ P% Ebegin P_pick arriving  V5 L- b+ K# l  h
    set A_i to procindex * 10 + 1
# _; Q& T$ q; a/ j, i    move into Q_induct(procindex)! m! W! K/ U. G& b0 @' p+ b& [
    move into pickaisle.induct(procindex)  {7 a, R- g: h8 d" `
    /*check the type of pickaisle.induct(i), for your last problem.*/% b8 N" C# Q4 b

& }% g, A& F0 S7 ~, }! |    while A_i<=30 do begin: [, X$ h. W# f7 y4 Y/ K( h; A
        travel to pickaisle.con(A_i)
: z1 A+ }  i$ W$ x0 Z; X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ a  i4 b1 d, w3 E7 G        else wait for 10 sec
' o' f5 f: e1 h4 b/ \        if A_i=A_leave then send to die1 j  q6 X0 ~% H1 [( d6 i8 B
        else inc A_i by 10 r' e+ i& }. X1 x) s2 Q
    end0 |% K3 J4 e2 e7 d2 S
end
3 F) s/ D$ P% J. v0 Q$ v7 n
% N0 |3 u0 }" y* a$ l. E" I* i0 \4 l其中的procindex为整形,代表当前process的序号。. n. l5 V7 k/ b9 B
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, 2026-9-19 04:29 , Processed in 0.015888 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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