设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15133|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" z! F/ y& s2 t! v0 W( ~" a% L9 O
" S( p( D$ J5 C. G% 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中的数值,不知道会不会有什么不妥。
! @7 Y4 M  t8 ], r9 ^) {$ W2 t1 r3 z8 c- B
begin P_read arriving3 h3 e' G! J9 c
    while 1=1 do begin
$ |* m( U6 c8 W: y1 g" F        read A_tote from "data.txt" with delimiter "\n"0 W7 X# J( c9 J& ?3 }
        read A_time from "data.txt" with delimiter "\n"
& w8 l) m: [& n: }6 q& ^8 x0 Q        read A_leave from "data.txt" with delimiter "\n"" I  \( U' I3 Y# ~" g$ J
        read A_picks from "data.txt" with delimiter "\n"( o! z  Z$ Q9 |$ W' O
        set load type to A_tote: z7 b2 `7 X, B# Y. U
        if A_tote="tote 1" then set A_induct to 15 N  Y, X9 O: }/ e8 M! X) `
        else if A_tote="tote 2" then set A_induct to 2; O: a+ L8 M7 v# M- W2 D+ d# M
            else set A_induct to 3   
7 B# e  j6 V3 m+ @/ x$ k% d, ?        set A_i to 00 |5 M1 D8 {. j) ~/ v$ b
        clone 1 load to P_induction# F3 S6 \+ \+ z6 ]: P1 _9 O6 D+ X
        wait for A_time sec' p  g3 o* s9 O" S7 B1 L* r7 _4 _1 T
    end/ f# X: I5 I1 v' w3 ?/ w+ C
end. ~9 z( R6 c3 n7 B5 n. i
, e9 X# Z2 g! C, Q
begin P_induction arriving
) t$ e) Q  H4 D% z( n    if A_induct=1 then clone 1 load to P_pick1
) v& g+ O- f7 _    else if A_induct=2 then clone 1 load to P_pick25 y: S6 M# N* H7 E7 i1 L5 s
        else clone 1 load to P_pick39 r: G9 V  d; M" [
end8 A. N4 B; [( |5 q" {& [! A

1 w- h) F# K* d/ J  nbegin P_pick1 arriving& {$ t: A0 Y* s0 E, U
    set A_i to 1
  b# H# z7 _: I: R    move into Q_induct11 ~: O  ]# U2 e1 Z4 G, t
    move into pickaisle.induct1" B; ^3 ^2 d+ G) @8 G
    while A_i<=30 do begin
8 T! g$ _. b6 Q; X% b        travel to pickaisle.con(A_i)3 W" e6 |7 n& Y; C6 t* G  A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- s9 @" v& A  g9 s1 @5 \+ k+ `        else wait for 10 sec! c( q1 ]" B" i4 P
        if A_i=A_leave then send to die" ~5 B8 f( ?* l) Q
        else inc A_i by 1
, r. N8 {  _- g$ P- R    end  e9 N  _' v) P  V# h
end, q, g+ @; t& W2 U- m) G
0 k: j; S  v7 y' L% N8 p
begin P_pick2 arriving
- S2 o5 X6 i' L& K7 o    set A_i to 115 }( A7 f8 _6 y& ]* N% f
    move into Q_induct2: \' y! H7 f2 u& O5 G. O
    move into pickaisle.induct2
' V& X9 A- m" _7 S4 q4 L    while A_i<=30 do begin
! l( L5 f  e9 |) }2 \% ~' }        travel to pickaisle.con(A_i)
" H) U6 w$ P' \9 n4 a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! x$ {  @' J  r$ Y* c        else wait for 10 sec6 {6 v! ~/ N7 x$ c& K
        if A_i=A_leave then send to die+ W, M- t% i$ O% ^  a* S. n, E
        else inc A_i by 14 _0 B. ~# p! q5 p) H1 d
    end! N, x# f& c* O8 a6 L
end
0 u* O: U3 @3 f( `, b+ B) R  g4 l: U
begin P_pick3 arriving) {5 Z1 R0 _# u8 R* z
    set A_i to 21
% J5 {$ R& d7 L7 E) k: W  Y% ^5 R" w    move into Q_induct3/ g5 v9 {% k7 M- |" L2 E+ d
    move into pickaisle.induct3
  j; Z2 p! U3 i6 ]& u; O9 y* s& @3 i( ]& O    while A_i<=30 do begin
) N9 O: ]' x; |* X4 }        travel to pickaisle.con(A_i)# \8 s+ a" |/ Q) ?5 S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 B$ K! j0 F! f% p$ q6 ~" y
        else wait for 10 sec5 d1 N) j6 j4 U3 e$ z
        if A_i=A_leave then send to die$ q+ E* r$ D& g4 B# d3 q' [& i
        else inc A_i by 1
& L# p# ^1 o. @0 `) Q6 X2 r    end) {6 \; g# Q( w# {9 l
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是个什么东东?
5 E% q3 x( n" H7 x( vmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' o6 j/ A( d! `$ O
6 l, \0 y) |5 a2 Q- w4 o8 XAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。, ~+ e: X# S1 X2 B  O
2 p, C. ?; m/ Y+ ?& n
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
9 t- t7 A7 b) p8 y  M1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
9 S% C- y& I' w" G* D# z2 j2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
& }) }$ l; V. n) X3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:: z7 x& J6 K$ l/ Z# ]
begin P_induction arriving% A1 n. ~6 v8 O# w3 Z6 e! a
    clone 1 load to P_pick(A_induct)
" I- [9 K  P, L9 q0 r' Kend最大的系
' Y. t: H% f: I% [# `9 b2 G, S( u: H: @0 x* ]
begin P_pick arriving
: N4 j% B! @4 j; H6 O, C1 l    set A_i to procindex * 10 + 1
6 G% n7 S& z, y    move into Q_induct(procindex)
! [  j9 d: _" ]4 G0 E    move into pickaisle.induct(procindex)
- U$ G7 }- V' @1 g( i1 a; J# R    /*check the type of pickaisle.induct(i), for your last problem.*/
6 C# f1 `+ a8 E6 h; h+ @; L
& e+ F# C+ E8 p0 p* j    while A_i<=30 do begin
- _, q8 p; \2 H        travel to pickaisle.con(A_i)  F! b* p- H8 U* q, e* Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% J7 Z* Z1 s& O: E4 r. @; f        else wait for 10 sec( T8 K! w: v6 j2 A7 u; u. Z# B
        if A_i=A_leave then send to die) H  k. w8 ]6 z0 B: F; ]5 m
        else inc A_i by 1) {6 h6 W7 N' E/ K
    end
, d5 u9 w* o5 z% Bend
# t+ {; {; r: `
+ P, m' ?. h! u) l  [1 O3 p; g/ J其中的procindex为整形,代表当前process的序号。
: ?) u1 T# b& L1 }" Y7 I4 n: pstation和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-8-13 17:12 , Processed in 0.019396 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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