设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15485|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 ]+ g- v9 ^9 N1 p& ]% Q
8 u5 w: Y7 R+ D
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ r" U& c3 X9 e; A, h( `8 p

7 `3 p7 \! {( B7 u/ ~& rbegin P_read arriving
7 S4 R3 C+ `: u4 h6 |/ b2 Y    while 1=1 do begin* B/ U# F; [2 z
        read A_tote from "data.txt" with delimiter "\n"
+ i# j* c9 A1 B        read A_time from "data.txt" with delimiter "\n"
2 q* M- X( g; y) L0 x8 ]        read A_leave from "data.txt" with delimiter "\n"
% b% F& y+ ?# m/ _3 `* x! _, ^        read A_picks from "data.txt" with delimiter "\n"
. w$ P! ^& W* B* }$ e" z        set load type to A_tote
2 s: V' @: f$ A7 \  ?: M) g        if A_tote="tote 1" then set A_induct to 1; {# H1 U" h# J# T9 J+ T
        else if A_tote="tote 2" then set A_induct to 2
  }% P$ X! s' |& S            else set A_induct to 3   
3 b6 Q! r7 D7 G& s& R9 Y        set A_i to 0
6 R" Q) W; s; q# x3 g/ |        clone 1 load to P_induction
& ]+ g( w+ T: O) e        wait for A_time sec. M) S$ o  z: S% @  D
    end
$ M$ G" {  o" j+ V  Oend+ ?. l* v+ [' f1 w+ ]) B

! V8 d7 y3 o# O9 \+ _$ l: {begin P_induction arriving
) j6 q* z1 d9 U. }* h; ]    if A_induct=1 then clone 1 load to P_pick16 T' E6 Y# ~/ ~4 E! ~
    else if A_induct=2 then clone 1 load to P_pick22 B+ o! C4 _! }: y
        else clone 1 load to P_pick3
7 ?! L# t$ l, x, lend' @+ n( X4 \* A# F4 c1 z2 h

0 Z0 n, Q2 \: B* D6 Pbegin P_pick1 arriving" P0 K5 E7 r+ y5 L$ K# a+ X
    set A_i to 1
& o7 ]# ?8 q- M9 k; M% F/ z    move into Q_induct1
2 y0 P& [9 Z+ ?    move into pickaisle.induct15 S; E. W1 m/ t3 Y
    while A_i<=30 do begin
7 `: T$ ]! C( s- e! S3 ~3 ]        travel to pickaisle.con(A_i)0 {* E) l8 \! b- U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 Z. _4 @. u6 `  A
        else wait for 10 sec1 f8 t8 ]& \6 ]" r( U) Q
        if A_i=A_leave then send to die( e! N) {9 T* r# h# `, `5 E& v
        else inc A_i by 1
" n( |- J* q' u- X$ ]    end
  o! b0 }. |8 E- ?2 J0 @5 ^end' G- a& U# I3 k6 A! h" s( _

/ x; m- O; W0 g8 v4 X- U9 T3 x( wbegin P_pick2 arriving
0 [% H% v* D( e0 e. E    set A_i to 114 R4 O0 I# |. @9 J
    move into Q_induct2
8 o" G0 ~; M8 Z+ k    move into pickaisle.induct26 G: u! t% z3 X4 Q4 o. g% ?8 Q+ k, Q
    while A_i<=30 do begin
, [5 Z9 |0 l# H        travel to pickaisle.con(A_i)
4 A9 g5 K( t( z. ^% x1 J4 ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- f2 y) @5 b4 i/ j# W        else wait for 10 sec
9 e8 A- j7 V7 x        if A_i=A_leave then send to die9 s) y5 X9 q. X
        else inc A_i by 1, n  b# h3 c  Q8 G0 ~) x
    end
- `% S+ Q/ v0 \. A7 Dend& x- m6 R  M& ~7 R2 J' Z3 m

0 v1 J' H' ~  W% U3 T+ t% Hbegin P_pick3 arriving. ?8 T' Y# s5 |* `/ x+ ^2 D
    set A_i to 21& \6 s- F5 h! k. d( s3 S6 D
    move into Q_induct3
  g( i: t/ |/ i2 h9 U# Q( M    move into pickaisle.induct31 M/ M" [& ^) H' v
    while A_i<=30 do begin" b) G  n/ b9 L: v, W$ |, k
        travel to pickaisle.con(A_i)8 \( g( K! g$ s, u# i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( }& I2 e: k  R" c' Y! g        else wait for 10 sec
% \" v% f; g* P  D: ?7 Z+ D. `* [        if A_i=A_leave then send to die9 G8 q. w& \. F% w5 G
        else inc A_i by 1+ B. D' B" d- E$ k1 d! u7 n* g8 W
    end) v& Y2 \, y; j; d" l- }6 Z  _$ m
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是个什么东东?$ X/ P3 ~6 A0 b* m% V/ i
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?: R1 J* b1 Q, w0 i% ]
% I2 ]* v# t7 [5 _4 y5 R
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) c3 t% n/ N- B# |$ s* M0 F

+ @- C* V# K4 D; |# X& d6 X) L另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
: H  R" F, o% ]7 s7 B& t  I, @1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;. G0 |( I" Q( C1 ~1 s* h( n
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;  j  K5 c: b" ?& D! K
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
& m- r6 Y3 X" C: vbegin P_induction arriving3 i! G. v' ~) m4 z8 @* y2 n
    clone 1 load to P_pick(A_induct)8 Z# @1 E1 a& |
end最大的系; B/ F$ _* l! _2 Z
. F9 c3 E2 B1 t4 ~' G5 C, O
begin P_pick arriving- G$ c) L  l3 m& V; I) U
    set A_i to procindex * 10 + 1& M2 {" w+ f) g5 a+ V6 l4 v& p  v
    move into Q_induct(procindex)
3 a0 r* ~: G' K  h    move into pickaisle.induct(procindex)/ C' r9 U0 v* D; @
    /*check the type of pickaisle.induct(i), for your last problem.*/
5 O6 `- ^* c# @/ O7 z7 q
4 Z2 f8 w& s6 h4 R9 z9 z# A    while A_i<=30 do begin& L' [4 Y3 S8 G0 O8 f/ @
        travel to pickaisle.con(A_i)! `  h4 ^2 }* G) B: I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, _/ x3 {3 X- c& h0 ^; ^) f        else wait for 10 sec: n& Q: ^& G4 d5 b$ s) ?7 j  k; t
        if A_i=A_leave then send to die  D) k- O+ l* C: R4 D) G
        else inc A_i by 1
1 u* j( r8 @7 s, C1 R    end
- C. s5 a9 d: T  g- ^( xend
# i7 I# n. V: k- r. w& B! l  r$ u* r+ h
其中的procindex为整形,代表当前process的序号。  ~5 l3 J$ x/ M
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-9-14 11:39 , Processed in 0.015603 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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