设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13805|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- {9 c) D: Q$ T
/ B7 L; b/ g7 X# \8 X5 R6 p我的问题是,在每个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中的数值,不知道会不会有什么不妥。! t5 _$ i# S+ y! w& K
. p" C: B$ k4 `' I/ P( D
begin P_read arriving
& t- p/ f* s* ^) W5 ~! B    while 1=1 do begin
% r1 \; M% |& u7 ]        read A_tote from "data.txt" with delimiter "\n"
2 X8 ]8 x( M0 J/ R; Q- N        read A_time from "data.txt" with delimiter "\n"6 S( ~3 h# m) R) u" ^! [6 _
        read A_leave from "data.txt" with delimiter "\n") C( x' m* b5 X
        read A_picks from "data.txt" with delimiter "\n"1 p' A% o; X0 {8 m  g; N
        set load type to A_tote. R. g2 t- k9 s0 C) ~* @
        if A_tote="tote 1" then set A_induct to 1# W: ~8 e) `: f( S! T7 Q5 p
        else if A_tote="tote 2" then set A_induct to 2, ]  ?1 ~6 ?6 E! A
            else set A_induct to 3   
9 F# L9 I) w8 n) B7 V- {  I. i1 p        set A_i to 01 u: C# r7 {( l
        clone 1 load to P_induction
2 {' L' I5 l# |- x- K' d        wait for A_time sec
! Z& q& V' _  L2 Z% j9 U    end" N1 N8 ^- |4 d2 [5 u
end
) i' f7 D  X; y% u; R
8 F$ z, J! ~7 Z: N- C: Vbegin P_induction arriving0 ^. ]5 K  r8 ^6 v6 I3 G
    if A_induct=1 then clone 1 load to P_pick1# K  ]/ N" \1 |) W$ T6 b5 h$ O8 {) I
    else if A_induct=2 then clone 1 load to P_pick2, O2 N! v8 O4 ]8 {0 n
        else clone 1 load to P_pick3
* A* \! R9 _4 q( p% k, Qend
" y  }7 v2 _4 e* \
. [, L. l: y1 O& {. Bbegin P_pick1 arriving  h4 N( ~$ J" q0 T* @
    set A_i to 1
( r) H1 ^+ s! c' E6 ^    move into Q_induct15 r; Z& d" Z2 P3 H4 Z
    move into pickaisle.induct15 ?8 N# V) l9 a0 ^2 f/ K( Z# K
    while A_i<=30 do begin8 W! c8 P8 a& R" \" ^
        travel to pickaisle.con(A_i)- b( u2 A" Q/ r7 F! @# f; @4 C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, L+ h" k$ y2 G( i# l        else wait for 10 sec# |/ p; `9 Y* H0 R! s
        if A_i=A_leave then send to die& N5 z: z! k8 p# Y8 ~% F, u
        else inc A_i by 1
9 ]7 M) j( {! Q    end
$ J# i* j! w9 F1 i+ ?1 X6 A" Zend$ X/ P9 {* n5 k) a! `
+ H0 }. s! Y% D: z
begin P_pick2 arriving
0 u6 C$ N5 S6 B. A: u) G    set A_i to 11: w7 b( W- k2 u& ?: F- z$ x
    move into Q_induct2  `% \; p; o5 J& k' a
    move into pickaisle.induct2
: z$ [# S! q7 J  f" d    while A_i<=30 do begin
+ ~3 x- m5 j( j        travel to pickaisle.con(A_i)7 s1 D4 ?% y4 N) J  V$ n, F( [: t8 y/ k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 w$ W- `+ C2 a7 n( ?; ?        else wait for 10 sec5 X( M& ]6 u+ Y. b* c. A, w9 ^1 g
        if A_i=A_leave then send to die( \5 c' W1 A2 ]0 J% B# D
        else inc A_i by 1
& |% a, f3 a9 s: ^    end, r) I  R3 U* [
end3 J6 Q* T9 R2 o/ e) R' ?( ]
; m7 J* G5 m0 }
begin P_pick3 arriving  i4 t" F2 b1 r8 H1 L
    set A_i to 21
' e1 a0 g) Y. ?: {    move into Q_induct3
! s2 x2 {7 {3 X5 Y3 ^  z6 j    move into pickaisle.induct3" a: p/ g9 y1 {- D1 p
    while A_i<=30 do begin
6 H( c' g$ Y3 |- l) W" b0 F* `, q* V        travel to pickaisle.con(A_i)
5 q5 K& v6 G# m- J& @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ d) u7 g8 A  v: E        else wait for 10 sec/ Q( g5 k; w+ n9 T
        if A_i=A_leave then send to die2 T) G0 u3 V2 a) m+ J; R
        else inc A_i by 1* e& N& N/ n& |8 P, p3 G  q
    end/ g. K: e* k% ^7 b8 a' @$ c
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 E. J' |0 j  U' Q
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
; m6 @; G4 b; |' ~1 Z% \5 e# a% e1 P/ L" |, I, v# D
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。$ v2 I( o! G. `" _

5 X% t; }: h" {" O; ?" [! t( ?$ B5 {另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
3 t# I, K; F0 ~- h1 ?1 }2 y" `7 X1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;- H" A& f9 e' I) P+ c
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: I4 g- u6 y1 v0 }) D* A5 \1 e% j& V3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 i0 @, M# E( P" n. O( g0 q1 X
begin P_induction arriving$ b% l- U! z0 V1 k; u( @
    clone 1 load to P_pick(A_induct)
  v& a: }; E+ z: B4 r1 I) Oend最大的系
: a/ ]6 T: Q. K: H; O% ^
. f  I* K" R$ E: ^7 E) Vbegin P_pick arriving* Y- ~2 P& W: i; |4 ?, m2 H- r* S/ w
    set A_i to procindex * 10 + 1
& ^6 K2 T" [! k* m( u7 e" w    move into Q_induct(procindex). x2 H2 e: a. S
    move into pickaisle.induct(procindex)3 x9 f- C" J/ @% k) \/ n+ j4 q" o
    /*check the type of pickaisle.induct(i), for your last problem.*/
& l' `8 u/ K) r7 m* l* O: n; ^7 q: x1 M
    while A_i<=30 do begin. m) u' C9 i* O0 d
        travel to pickaisle.con(A_i)
. c( G# z! K% z% b) h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, w+ ?' u6 {( Z  F/ K  ~        else wait for 10 sec3 |. \5 j+ J% Q" l9 ?! `( z% b
        if A_i=A_leave then send to die9 o: Z- |7 M" H% I
        else inc A_i by 13 G4 M0 F/ t" q9 ]' e
    end
( D: D! G& Q5 z4 W4 F( Q+ E0 Z8 uend
% G; D% c7 u1 E8 L1 N/ e& a& P( e" @7 k' R, O$ R5 ~& d
其中的procindex为整形,代表当前process的序号。2 q* H& {% ?# M; n* r- @
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-5-6 13:53 , Processed in 0.013310 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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