设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12482|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# f( R) b# ?, ~  ~$ D% s2 w1 H; A1 [9 ~0 Y8 e* G9 W. \
我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 E- e; Q4 u3 k& D1 o* K
/ F* d1 _3 I" X  M! I$ I( i" i
begin P_read arriving
2 O  p! H: I# Z5 ~, f    while 1=1 do begin/ E, n9 u' ?" ?3 \, G/ u* ]
        read A_tote from "data.txt" with delimiter "\n"
  M3 {" ~- o5 t  a" A3 f        read A_time from "data.txt" with delimiter "\n". c+ i& @0 }. v
        read A_leave from "data.txt" with delimiter "\n"
, {6 H. j9 ~3 f9 }+ L3 ]. g        read A_picks from "data.txt" with delimiter "\n"( c! n! }6 y6 n
        set load type to A_tote
8 ^) v+ C" `, {% Z        if A_tote="tote 1" then set A_induct to 1/ A/ s2 J8 h( v) {1 O
        else if A_tote="tote 2" then set A_induct to 2
# N. z4 `$ Y& W' M" a  [4 ?9 f            else set A_induct to 3    % P  j' C% u6 j/ O; Y9 p, ]
        set A_i to 0
( c7 R. r. f- I        clone 1 load to P_induction
6 t' V4 Z- c6 X6 O        wait for A_time sec
  O! ^5 v5 |& k& _/ L4 d    end+ _" q( X! K& J3 k( M) O) L
end+ b- l. H( a! }2 c
3 O; d$ G/ P2 T6 O7 Y! L9 x0 r
begin P_induction arriving; I7 p: O, I* Z/ A& g+ a9 b
    if A_induct=1 then clone 1 load to P_pick1& d: M" d/ ]7 J
    else if A_induct=2 then clone 1 load to P_pick2
* T6 V) c+ T7 n+ o        else clone 1 load to P_pick3
. c, O  P( V3 Z9 U$ e, Wend
* Q+ G; e& W8 @
/ `# F# Z. c# N( W% b, ~begin P_pick1 arriving
( A7 B  U& @2 g5 j7 ~1 b    set A_i to 1
- v' L; Y# G! K! {) B4 Y' a! o; D# H    move into Q_induct1, M2 j- Q) k( b# c! P1 w. [9 z5 E4 {
    move into pickaisle.induct1! Q" N! {# n2 N% c9 d5 w- O* U; T
    while A_i<=30 do begin
* N9 ]+ C/ ]/ J9 u9 a3 C7 ]9 b4 V        travel to pickaisle.con(A_i)
' z& T0 m. ^1 l* t9 W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& b# l8 d: x+ Y! r
        else wait for 10 sec* X: H, h; }* C' R8 t
        if A_i=A_leave then send to die/ D* {4 V! S+ K" W- K2 I5 o! @9 Q6 X
        else inc A_i by 1
- G% q' H3 T3 D/ l- m    end
! Z0 ^. `6 H7 dend
% \! y" B" R* r# K( C
4 G- |" H( Z) R! R2 T! g9 gbegin P_pick2 arriving
$ o4 `* l; S7 O7 a% I    set A_i to 11/ c! Q' p. a! U4 z* o! r" I
    move into Q_induct2
3 A$ |5 t" R6 Q: Y4 H$ v    move into pickaisle.induct2
  ]( @- D/ S1 ~    while A_i<=30 do begin
5 V6 L& |0 c; x: D% d        travel to pickaisle.con(A_i)
/ P, `; B, U! I5 n) ]3 \/ o, B: @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 F- e3 t# ]8 g1 Z( j& j
        else wait for 10 sec0 ^3 @2 T2 {" M
        if A_i=A_leave then send to die& H: w9 R, C* _
        else inc A_i by 1: E3 ]+ R' T, O& g+ i" l8 b8 `
    end
$ [# A) ?: b( c4 G2 P* dend0 F2 K7 r$ W; \# C

2 m9 y& U% [& C) xbegin P_pick3 arriving
4 q- T! v% k$ i9 V& h  z7 H5 b. X    set A_i to 21
! m7 g; Z, V+ K  \- f6 [7 G+ y    move into Q_induct3* A, u& o% o: B0 i: ?2 v
    move into pickaisle.induct39 H! k& p  b- Y* d/ x+ b! z/ S9 e7 G
    while A_i<=30 do begin0 R2 b  d9 Q4 I; [, i- @0 `% B
        travel to pickaisle.con(A_i)
' R; Q& i0 n/ D) S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' x$ d2 ?$ [" C
        else wait for 10 sec: E7 T2 `1 J6 f- o- b6 d, g8 n
        if A_i=A_leave then send to die
- C1 ^* [) f$ d% I3 g' y        else inc A_i by 1
% g4 s. T4 `5 n& @    end# E' f4 G3 [* B8 Y% U- X& 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是个什么东东?+ {4 k' T% \% t( V1 E  T& j
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! I& ]% K4 j2 I' n0 L5 c5 b2 J! M: I
" N6 G( l) n; E+ q' j& X0 \7 O
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ v2 p5 j" c- g2 D' |3 \

& f  n$ S' U9 ~1 R" t另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% [& o( v) z1 q  E1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;. i- X1 L2 y# k' k  z2 F
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
2 Q( P- R$ m- X9 v( o( U2 y3 t3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
4 J' n8 J7 W, @3 K6 W  J: J' n  rbegin P_induction arriving
" }% C) T8 |& B* f3 Z3 B5 ]* _- d    clone 1 load to P_pick(A_induct)4 B; Y1 p  N  N: m
end最大的系7 K- u6 h" G* x3 @- O& d
7 K# e/ X* {8 w' K
begin P_pick arriving
: n2 ^, J# _7 u7 k8 Q' y* m* I0 m% U4 W    set A_i to procindex * 10 + 17 t" V+ K- B% f" ~, I! {. P
    move into Q_induct(procindex)
4 O" l, J$ O; @$ @    move into pickaisle.induct(procindex)
( Q8 j( J, G3 Q( @/ V2 H    /*check the type of pickaisle.induct(i), for your last problem.*/, s8 O! l+ S/ d  n! [

3 s! D7 r" I$ P" S) }    while A_i<=30 do begin
$ A# A/ Q/ Y+ D5 v' Q* s# [1 S' J        travel to pickaisle.con(A_i), ^4 L$ N0 y. w: x3 ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% M% i+ X1 u- r# L" @
        else wait for 10 sec1 r% U+ e; D  V8 H5 T: }; k+ I
        if A_i=A_leave then send to die2 t; s4 n( T3 z, N
        else inc A_i by 1
8 m6 [3 A$ ]2 u4 A2 ^5 ~1 [% |    end
/ ~  q" i2 m8 Xend
, }5 `) Y6 m+ T0 w) p
4 l6 y2 g- G8 e6 f. h$ x$ A其中的procindex为整形,代表当前process的序号。! E* T: @2 v) T, H
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-1-28 02:47 , Processed in 0.013971 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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