设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14203|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! Q& }( `( |) _2 m  V# D# l
- l. i4 f% d" I2 N7 P$ 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中的数值,不知道会不会有什么不妥。
) a) c# b0 O! u) @! M, R! C
0 G/ q3 p+ n& @begin P_read arriving
$ c6 P# S) `4 ]& y( e2 o9 Y  U    while 1=1 do begin& d0 z* k/ a& @" {
        read A_tote from "data.txt" with delimiter "\n"! K  ?% C; s5 u! f/ {8 l' u
        read A_time from "data.txt" with delimiter "\n"2 l1 m- W) {% y: }8 L
        read A_leave from "data.txt" with delimiter "\n"1 g. y2 R6 n9 z' {
        read A_picks from "data.txt" with delimiter "\n"
/ z, c7 K  d! p* x        set load type to A_tote
) C0 b( c; G9 q& {        if A_tote="tote 1" then set A_induct to 1
2 q7 q  @$ Z/ q  {+ m* Y% a4 Y        else if A_tote="tote 2" then set A_induct to 2
( l! D8 w5 m9 W( ^            else set A_induct to 3   
/ {! }1 t! q0 s6 o' Q* k        set A_i to 01 p4 D2 e3 O$ o6 ^
        clone 1 load to P_induction
9 I  I  Y4 p+ W0 q& o) c        wait for A_time sec- P5 r6 F3 D8 m. w6 W: ?% V
    end9 u# u4 I, G1 z6 N' u9 L- ?- u
end
* F3 C2 s" v/ c3 [4 f/ k7 ^
8 E* P% C% X/ K5 u! Jbegin P_induction arriving3 g1 D, f, U& B, ^5 z# z
    if A_induct=1 then clone 1 load to P_pick1
/ x* B, M6 c/ }5 i    else if A_induct=2 then clone 1 load to P_pick2* s+ b& ]$ Y7 _. Z8 x; f
        else clone 1 load to P_pick3
$ q! [; `. S+ X1 I6 Tend6 X6 ^8 @5 ]5 w7 u' h/ J9 d! @( ~
: K- K; W; f5 ?/ F6 s  a1 L
begin P_pick1 arriving' V$ m# r$ H( I: }4 @3 M- e
    set A_i to 1( I: f/ b( Q8 A4 D5 m  `
    move into Q_induct1! X5 e% A* W- q( H1 n0 y
    move into pickaisle.induct1
3 B6 D- @- V8 t    while A_i<=30 do begin6 c/ j7 t& z1 a
        travel to pickaisle.con(A_i)
; G& X, s/ S9 r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% S# P6 k$ y5 _5 y- e: t2 T7 {        else wait for 10 sec: Q5 ?9 c* ^. u  `
        if A_i=A_leave then send to die4 t8 D. d! ]: l5 v2 H
        else inc A_i by 1! N4 O+ _6 |2 u, w# b+ a
    end
: o2 u4 L! x& ~8 S- f5 o" f" E. S2 pend$ T6 ^/ w+ c# ?6 M: Z% l( o: M- r
, N: H: h" {9 F6 [3 G! B, P
begin P_pick2 arriving
0 h7 I3 _0 M9 R5 `* ~! I; r/ M    set A_i to 11# U4 m6 ]% y4 S" M" A7 |9 J. N
    move into Q_induct2
3 v: `  F0 u, q& v    move into pickaisle.induct21 F# M! a8 I4 k1 h& [3 W
    while A_i<=30 do begin9 M/ g$ s* v) C. N. {
        travel to pickaisle.con(A_i)4 v2 T9 d3 O* f6 `6 L0 r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: g5 Q! T; J  ^        else wait for 10 sec
* t5 d1 C  M! N. P        if A_i=A_leave then send to die* }+ C4 D2 @' ?& O6 E6 @
        else inc A_i by 1
9 ?, W' ?/ A3 d& d  Y    end
4 p, v. R) P5 @% zend, w4 C" ~6 Y4 U" }0 E

+ K4 ?' o; O$ [8 Y! o& f. j. ybegin P_pick3 arriving/ u" C) ]  K/ _+ T
    set A_i to 21/ F- |, C- B( s4 C* _6 L! h1 a
    move into Q_induct3* a" I* e$ L- B& }8 L! }8 o
    move into pickaisle.induct3; i5 X# H, j3 @) K5 s1 D
    while A_i<=30 do begin
, u) m# w; t0 h4 ], L        travel to pickaisle.con(A_i)- t1 Q7 l+ G4 V. M4 B: m/ u8 F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; r( u9 o7 o/ g
        else wait for 10 sec
! Y2 o' c5 C, L7 s        if A_i=A_leave then send to die
# t. y. e* u7 Z$ r7 a; Z# V9 `        else inc A_i by 1& s% @  D2 x* U! Z& f( b9 `1 `1 v
    end- i+ y" r4 ~2 ^% u5 k0 |
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 U+ r0 R9 r% C) x6 f0 ]
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?3 r2 d9 ]9 r4 }  @0 ~3 P

+ X& d' `$ j- i7 Z" L# {' ^# GAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。6 b% K2 X, W# ]/ G" g

+ t8 {) M6 S' u另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:# E/ ~. k9 `" q: O! k. o: @7 _
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;: i" x4 l# F* ]/ Y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 @; ]# K3 R+ b. J& f/ M9 G5 P
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
" ^: ]8 x5 e1 {  C. A0 u" {: G0 a1 ~begin P_induction arriving
. T, u. R5 ?+ m' ^# q* U4 [- ?    clone 1 load to P_pick(A_induct)- `: K' ^! z! O% L
end最大的系
% ], |3 d' W9 g, b& W& G0 m3 a2 q0 n0 }
begin P_pick arriving
6 I; Y2 I1 f7 e+ |( G  [' t    set A_i to procindex * 10 + 1
5 d! A3 \2 v: L/ W0 A% E    move into Q_induct(procindex)
, ^. Q# T& u( x- Q3 q    move into pickaisle.induct(procindex)7 `( k5 x# o6 E; F% ?- C  n
    /*check the type of pickaisle.induct(i), for your last problem.*/9 `. n) i" m9 V* v8 h0 K$ T

# ~% u( N' S- [& C( d  R    while A_i<=30 do begin& v& D5 ?# G0 v
        travel to pickaisle.con(A_i)
- g8 s4 s; ?: P% B. l' H' C" H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ X3 {! n0 W) l& _1 J! p
        else wait for 10 sec
  }/ ]( T0 b$ i) \; F0 R) o        if A_i=A_leave then send to die6 K( d% X+ r3 L
        else inc A_i by 1
$ w" c& c8 _( l* n0 j    end; S9 V# T# a) r+ O! m
end4 }9 y# w1 ]9 w# c

$ I4 `7 z+ u% ]; N) P; Y8 X其中的procindex为整形,代表当前process的序号。# c  v. {6 c- Q
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-6-20 00:48 , Processed in 0.014291 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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