设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14210|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: B, \4 @+ n1 `; y1 C

) h1 X3 }, G/ W3 B- 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中的数值,不知道会不会有什么不妥。6 c2 z/ u( z! s& }- [) n- V
' h% y' n, a  H( S5 n  }! o
begin P_read arriving/ z; [  ^" d8 E% X) H
    while 1=1 do begin" V+ M3 M6 M, C0 a9 b: Y% J
        read A_tote from "data.txt" with delimiter "\n"
1 M0 W" ^. A6 D! A        read A_time from "data.txt" with delimiter "\n"
( H: W$ N+ M/ ?) i( X6 \+ Q* G) Y        read A_leave from "data.txt" with delimiter "\n"
; s' @3 o. [9 ?; z( B+ F5 N        read A_picks from "data.txt" with delimiter "\n"
9 d+ w/ A- P2 y8 n) e& }6 A        set load type to A_tote
  m6 a$ _0 p4 k: Z& S4 b2 X% B. J        if A_tote="tote 1" then set A_induct to 1- ]& x8 T1 i( y# l$ v: A
        else if A_tote="tote 2" then set A_induct to 2
2 a6 ]) ^/ S0 h7 h, M3 J' x; @            else set A_induct to 3    9 C, N* K+ A! k( E$ D( u4 S
        set A_i to 0) t1 Z$ Q( h4 [; X9 z  V4 A
        clone 1 load to P_induction% s" e# T/ \# Y0 T2 w
        wait for A_time sec
8 b7 e% C4 D" @) ]- I" N" D    end" X5 t! i3 f: ]6 {  m3 f
end- h8 h0 {( Q8 R- J$ I0 `( F
2 c, t0 Z& [+ @3 J' D) d. X2 S
begin P_induction arriving! E, l# {! D; ~. B3 v
    if A_induct=1 then clone 1 load to P_pick18 x. y' D6 @1 h+ l
    else if A_induct=2 then clone 1 load to P_pick2
) h3 T- f2 m6 a/ @1 Z! G7 k$ O8 b        else clone 1 load to P_pick3
% F; o+ o: H% U  Q4 m& N  Wend6 V. ?2 p6 m( N# j7 u2 I8 K: P

( y0 F7 J: X5 Jbegin P_pick1 arriving( j0 \/ ~1 K: T* X: X
    set A_i to 1
- j8 S2 g* U/ R* p: V" m( r    move into Q_induct1: M% D9 Z* K0 I* R$ m& n
    move into pickaisle.induct1
: L" S- U6 l- G    while A_i<=30 do begin4 Y1 J9 @9 Q6 b  ?
        travel to pickaisle.con(A_i)) U3 V7 a2 e9 Q5 H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 s4 z5 [+ P* m6 O# X/ @1 M        else wait for 10 sec
6 s: {' n3 F+ r        if A_i=A_leave then send to die
/ X( g: F% m3 [  U1 g        else inc A_i by 1
( I2 N: B. l7 ?5 c' M; U; x5 x    end
$ B4 q; O; w% S6 M0 qend" V1 X  ^9 C; a0 H/ a2 `
- G; V0 H  I; b# N, l% Y; r3 {
begin P_pick2 arriving$ L4 t# C/ m& o% [7 Y# _) c1 V$ H, H
    set A_i to 11
- x4 C3 Q6 j) ^# v) t0 k1 O    move into Q_induct2
; L6 b% O/ R# ]    move into pickaisle.induct2& S3 |4 y# ]/ U2 C; t* l
    while A_i<=30 do begin
0 E9 a3 U9 `9 E; u  h6 `" f        travel to pickaisle.con(A_i)
) @* G6 W% I( F- ^. L2 t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 C3 N; d5 E% q" D- v
        else wait for 10 sec0 Q, H; d: ?* O$ T/ x, _9 l+ @# k
        if A_i=A_leave then send to die* I" D: W" E0 T: K6 z1 [! B
        else inc A_i by 1  L0 j. ?  q% R+ V) _! {4 G6 P! `; Q) N
    end
+ [6 }; H' k2 z( @+ A- Fend
8 l, a. l3 H  }2 G
6 F0 A8 ]5 {, |( T8 ^begin P_pick3 arriving
! H9 F. L3 l; Y# J  j) h    set A_i to 21
; G8 p6 b/ h; w; A6 H    move into Q_induct3
& {" O5 @) Y/ ^$ B" v( f( K    move into pickaisle.induct3$ l: C! i3 e+ R' j5 w  H$ |) l
    while A_i<=30 do begin
8 p- Z% F5 W% H) q        travel to pickaisle.con(A_i)
9 g7 V# J& O! v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 L' \; L# I$ ]$ u" g$ A        else wait for 10 sec
% R! Q  G- N( S, h* O) [3 X        if A_i=A_leave then send to die
2 \. k. H* q6 L        else inc A_i by 1& u% n4 ?5 ~1 Q/ A% |5 f( h
    end& y3 C+ l: {- T* `' f# J7 G
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是个什么东东?
. C( h5 s+ y$ ]9 R! |& y! ~) J6 Dmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 Z* V. f( d" A! r0 u0 e  p1 v5 p* j& s% N0 e- v. {
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 Z4 H" i; O1 [( G. V
. O/ |) L8 R1 Q$ `5 O' |另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
3 b5 Y3 q/ a3 w1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
7 X' c: l9 d- r; Y! ]2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 c- k+ q) J, r( y) |3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
2 I, P9 x% U( f( H  d5 ubegin P_induction arriving
* [1 j+ Z" @0 P2 }8 P: S7 u    clone 1 load to P_pick(A_induct)
1 H* e4 h: K0 f6 v( hend最大的系" k( Q; ]3 t* Z- q0 e! S- Q
$ |4 n1 u$ P: e6 R
begin P_pick arriving
2 A; {1 \5 l# t* Z  b    set A_i to procindex * 10 + 1& r2 E5 `# r! {0 c2 e
    move into Q_induct(procindex)
! h7 F1 S! k. l8 d9 t    move into pickaisle.induct(procindex)- P. n; ~( n- ]' w1 F: y1 }# ]7 Y# w6 O
    /*check the type of pickaisle.induct(i), for your last problem.*/
- T: @9 y9 H" j% Q( R* {4 \) O& o2 j$ u8 z2 S+ }0 p# a4 b
    while A_i<=30 do begin+ v2 C( d5 ^& h- ~/ H9 s  R
        travel to pickaisle.con(A_i)
; t/ Q5 \$ d3 g4 @3 C$ z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( a+ R9 I; ^4 h* U) y/ T8 v* p& v; T" d
        else wait for 10 sec
9 H2 K  {6 }7 d2 j        if A_i=A_leave then send to die! Y# r, L( p1 n- D
        else inc A_i by 1
7 I8 i7 l2 X, d4 @1 d5 c. A    end
# q0 c% G6 @9 U3 y$ o6 l. Jend
9 B6 M( x) K/ K! n" _/ {& ?0 E" V/ ~; A" |7 t2 F4 z. k" t8 i5 H
其中的procindex为整形,代表当前process的序号。
; |0 ^: @. Z2 o# g5 d& W: \4 V* Xstation和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 23:01 , Processed in 0.016336 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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