设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12713|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) |- i" _0 `( p/ }- B, c
5 K! x  q, I4 J; Z9 d, 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中的数值,不知道会不会有什么不妥。
8 H! s8 m% a4 k9 G4 \2 N5 e& O; ?; d! z/ y! n( o* I# B
begin P_read arriving: k4 c7 X7 o6 d7 T$ B+ f; b
    while 1=1 do begin  x, }8 c5 @: D. ]+ i* [5 _( w
        read A_tote from "data.txt" with delimiter "\n"" b! K2 M2 G" P
        read A_time from "data.txt" with delimiter "\n"
/ |* m: M9 u: Z7 |        read A_leave from "data.txt" with delimiter "\n"% p8 J9 D6 F1 W1 D" g
        read A_picks from "data.txt" with delimiter "\n"
( Y* k' }- c) w9 ]# _5 b        set load type to A_tote
; {- P* h' W* G        if A_tote="tote 1" then set A_induct to 16 I# l! t6 h9 M4 o% G
        else if A_tote="tote 2" then set A_induct to 2
6 v) u/ J, r3 v& z. e" x            else set A_induct to 3   
# s# Y5 N$ D1 x% ?3 o6 E        set A_i to 0
! Q- W3 T: a0 K1 g* v        clone 1 load to P_induction4 }# B8 ~- J1 F4 }0 p; @1 r" K
        wait for A_time sec
7 ~1 F) b' ?; m& `% v    end6 J7 V7 H3 i' P
end) @0 x8 h9 P+ X& n9 Y' u# o& Q
0 q# S  @7 G" Z0 i. N" g
begin P_induction arriving/ v5 o9 I- e8 U4 O
    if A_induct=1 then clone 1 load to P_pick15 O/ J# [, }2 M- W
    else if A_induct=2 then clone 1 load to P_pick2
4 ~4 X* G# }6 v! y6 i        else clone 1 load to P_pick32 w8 v8 Y: x/ y  O  y- t
end. f3 ~: R: n/ J  f: j" y; E

3 S. J6 [$ m- X( ?4 l1 Q9 Hbegin P_pick1 arriving
) J. \( q! {0 r, c  Q! N& u' p0 I% r    set A_i to 1
  Y( ^/ `. y9 M* z    move into Q_induct14 _2 c8 j" |+ b% H! Y
    move into pickaisle.induct17 b+ E6 N" s' ]& ^7 G& R
    while A_i<=30 do begin
4 J) C5 a/ t, ^* L        travel to pickaisle.con(A_i)5 O( x: }7 \$ I4 T' S/ U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ c1 q5 I% \  E) v
        else wait for 10 sec
; k0 a2 }3 M" J4 D2 }        if A_i=A_leave then send to die
" n: K. U" O- D: ?! J+ s" L        else inc A_i by 1
# l5 H- x/ N: _: {    end
1 A* g5 b) V) `8 a/ G- u6 aend
' F* R8 u9 g% ~' V# ^- }0 t# k! O# D! `" s: L) [+ f6 [3 Q9 u: E; A/ y5 o
begin P_pick2 arriving
5 X) u4 ~$ c* _0 b# `1 v    set A_i to 11
: J0 n6 L- A( @3 Y/ l" c) K4 H    move into Q_induct2
" i& H2 s0 X$ X! K: W) x    move into pickaisle.induct2
' e" x$ k. N; g" ^    while A_i<=30 do begin
, Y/ n" I: H( i$ k+ I        travel to pickaisle.con(A_i)( A' p( l9 p  u$ A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* a( K& ?9 l5 @: n" I5 ]        else wait for 10 sec
) v- q/ l8 l7 F* y& V" r# u: w" ~6 k        if A_i=A_leave then send to die
* \& v+ F7 U( ~6 {% M/ y        else inc A_i by 10 f( y( N9 e3 J. C: s. ?
    end
9 }" u9 \' p5 t% ^6 nend4 Y; [% X8 p7 x- p! \& Z
5 P! g+ ~- s0 F* v$ u" V
begin P_pick3 arriving4 x% @: M* z: |2 C8 G! ?
    set A_i to 21
4 Y( Z; v! a" s1 F9 k    move into Q_induct3! i# l8 k0 L! C" `7 S
    move into pickaisle.induct3
' a7 D0 H. o% \$ t  z    while A_i<=30 do begin7 ?5 M5 q9 X  X+ s
        travel to pickaisle.con(A_i)
, v8 x- N' c6 I, Y+ x; G5 S: m) R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  l; ?( k! x# Z! c$ N7 O% N& H        else wait for 10 sec% r$ U- v/ i: V
        if A_i=A_leave then send to die- v" T, I, z3 d8 G& A
        else inc A_i by 1
3 L; F. Q7 H$ F    end1 k7 s) _( ?) z6 r$ B9 @
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是个什么东东?( Z9 ]4 |0 d7 y
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. _: y, g, b, k9 Y* E
8 c9 Z6 ?3 a5 _+ `( D# uAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。! v" {" V+ E6 z0 p) ^

4 U$ R5 {) F- I" _: D  r1 e1 j另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:1 E( s2 \. w2 j4 x# Z0 ~  P/ e& N
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% w* }( N6 o* Y  @2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 D" l* r  V' O/ h5 r. k3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 K7 L; _" s. r1 Z
begin P_induction arriving
, V  j$ J7 n' F, X( r    clone 1 load to P_pick(A_induct)
5 x! F: N5 z- a8 x6 R  X2 u( @" ^" Pend最大的系3 }, \, N5 @; Q& L; L
9 s4 x" l4 w. ^/ }" [  Z6 R) k& ?
begin P_pick arriving  p: W( _# y! q8 ^4 A9 o
    set A_i to procindex * 10 + 1
2 {+ l7 J% X0 H' m4 x# h1 U* P2 O& s    move into Q_induct(procindex)
- i0 Q1 A6 c: d+ b/ w$ o    move into pickaisle.induct(procindex)3 s8 k4 R5 G1 p$ H5 o( H
    /*check the type of pickaisle.induct(i), for your last problem.*/: s6 X- _" o. N* r& @0 \; [! f/ V3 U
: @, i; [9 h4 E1 X" t2 F
    while A_i<=30 do begin$ S- m6 D6 j# u: ?8 i: B
        travel to pickaisle.con(A_i)
: x, [1 E$ I5 A" _; i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 f3 E8 \0 Y; g% ~
        else wait for 10 sec4 M& g: S5 b# ?) S) R6 e# M
        if A_i=A_leave then send to die7 [6 E& {  i3 l7 g
        else inc A_i by 1, S* [- g) g4 s$ [) e4 ^( l
    end
; _3 n1 w- g! P) Y8 Y$ eend
3 @( [) B2 T8 F+ x' H1 L1 ~. o7 g4 ]# a5 K
其中的procindex为整形,代表当前process的序号。7 @- o& d0 W6 L; 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-2-13 08:52 , Processed in 5.005184 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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