设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10382|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ Y8 ~; ^) Y) I7 l2 G, T9 b4 O2 n/ _6 N* ?: m6 E& h& S
我的问题是,在每个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中的数值,不知道会不会有什么不妥。* Y6 o, _( P- W

1 b. t4 g6 w9 A+ q. z: qbegin P_read arriving# q8 w# e8 @9 Y1 u
    while 1=1 do begin
" g) g$ H6 X! t3 R/ A        read A_tote from "data.txt" with delimiter "\n"
- ^% K* S) c  }/ @% I  N- q        read A_time from "data.txt" with delimiter "\n"" v6 @' }/ A4 F4 y) Q+ N4 N
        read A_leave from "data.txt" with delimiter "\n"- ?6 K; W8 b2 F) L+ O- T% {
        read A_picks from "data.txt" with delimiter "\n"
8 M0 C9 A4 e& d, f3 h: C        set load type to A_tote: a. r/ S: f% J
        if A_tote="tote 1" then set A_induct to 1
5 |( `5 z+ y. {& q        else if A_tote="tote 2" then set A_induct to 2
  M1 d, y" G' Z7 Z/ G: M            else set A_induct to 3   
3 i# F+ [# [+ {" x$ b) {* q% A        set A_i to 0
9 I3 U" H) [. [, _        clone 1 load to P_induction' v, u  i' L. @' {% Z; ]6 }- |1 y
        wait for A_time sec7 Y2 W8 H, V- L4 [' J: _8 s
    end
* {8 @9 F9 d  c  w/ J& W/ lend
/ b$ `& {/ C9 ]9 O! K5 _% O& ?- r1 i  r/ p# z- b/ R& ]% Z% G
begin P_induction arriving- D% x. m& w  t
    if A_induct=1 then clone 1 load to P_pick1
$ n* |! q' g* g    else if A_induct=2 then clone 1 load to P_pick2
. R/ v7 t5 ~; x- Z5 A0 i. m: a        else clone 1 load to P_pick3
" G; I9 D: e  z# E' Fend
8 @4 m8 v' R$ p1 B: m! H0 J, ~) A4 Z4 |0 u+ y- _6 R0 y
begin P_pick1 arriving% H8 h" q# F" ~2 n7 [' P" ?
    set A_i to 1& U- Y. k: {- d2 J; q
    move into Q_induct1
; n# C+ h& a7 G3 [# n5 E    move into pickaisle.induct19 a2 ?7 ]5 |; H! Z+ q" X3 H
    while A_i<=30 do begin: `/ H& Q, Y. b. {
        travel to pickaisle.con(A_i)
1 S# z7 l6 U/ Y& q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 v' O9 O! P7 f! o7 y4 Y- Q
        else wait for 10 sec4 @! S0 A: [- S7 C% O! L
        if A_i=A_leave then send to die6 v- L6 j, }* D3 I9 {
        else inc A_i by 1
$ l/ F8 {- @; Y* j) p    end
  e0 p; O: u  @: C& q  rend
6 n3 d7 \! P$ B! f4 \  P1 E1 |! Y) e6 P3 E- b, e0 l: |
begin P_pick2 arriving
7 A0 u+ {2 _  h: U    set A_i to 11  I0 A0 F2 B* z# j! G# Q3 Q, w
    move into Q_induct2& w: F: G% E2 F9 D- H4 q  J1 s0 K8 q
    move into pickaisle.induct28 F0 B. U. k9 l! X$ f1 k
    while A_i<=30 do begin
' H$ F) _" x  z( b        travel to pickaisle.con(A_i)$ x& s; B& R/ }( |+ U2 x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: ?" W5 W; d0 P7 K0 }        else wait for 10 sec
+ L9 F, g( s  x( M4 [' J' U+ p        if A_i=A_leave then send to die
6 R# W5 C8 o/ S" b$ O7 L% ~% v        else inc A_i by 1
' H4 d6 K, z# c  U  ]7 Y( q) F    end$ g$ u" X1 Y# C9 x7 g, O, d( i
end- b% ^* h/ E5 b
3 M* q$ m1 z; ^" y7 u+ P
begin P_pick3 arriving
8 G" w  M4 S! C+ E# E) {' m    set A_i to 21
% b' [/ m4 D( R/ F    move into Q_induct30 [+ n- B# m/ A# T% z' }0 I) R
    move into pickaisle.induct3; }  n( E  V" v" ^2 o! C6 Z+ c; N4 V
    while A_i<=30 do begin
5 y! f7 ~6 L5 [" |. ~9 E& G& z        travel to pickaisle.con(A_i)1 y) p; Y+ |- o. o2 [' E% v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" q/ Q0 F$ N1 ~. b' Q        else wait for 10 sec1 {7 t  T9 K/ @5 J/ i5 c
        if A_i=A_leave then send to die. G% |, \+ O4 z) k
        else inc A_i by 1
( [4 t0 u* G8 @* l    end
/ k& d1 m" H4 w; ]" ^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是个什么东东?
9 p' M) ~. C6 n  fmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' q( R; f1 k3 e: ~8 y  D+ x9 G3 s* G
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 |0 G* @% x0 L% i" B! V: t9 K) C
4 Z3 S4 L/ _+ a! H
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* m' c1 i4 j7 |4 R1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' @. ^, ]; g, o$ ^: e
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
' c( n7 F* A+ u: h3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
$ n" T4 i2 c; H% U" O# Cbegin P_induction arriving9 v* O' k: @" P7 b7 P
    clone 1 load to P_pick(A_induct)' ]' r+ ]$ ^2 Z  ]' ~' t2 T
end最大的系
( H# ~- c% {8 I5 {" C" Z, P8 W/ D
$ }7 d6 p/ Z2 Y0 Ebegin P_pick arriving1 @! U8 M3 X9 U4 Z" [- W
    set A_i to procindex * 10 + 1& }7 S8 u; f( H& n) U/ F* V* D
    move into Q_induct(procindex)
  @. J( Y- n9 m4 l. J    move into pickaisle.induct(procindex)+ L; w. t2 i( T3 z& {
    /*check the type of pickaisle.induct(i), for your last problem.*/6 ?$ w$ q0 A4 {4 x

5 O. [, h+ X6 F! q8 D    while A_i<=30 do begin0 z  V* @  J8 @( X. `
        travel to pickaisle.con(A_i)0 @, \5 [8 n: c9 [% o0 w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ |) J; m+ i5 l* R4 m4 V/ C7 M. k
        else wait for 10 sec& l5 s& f( [# k
        if A_i=A_leave then send to die
: ^' }* K) [, E. r+ c        else inc A_i by 1: R) d6 q9 x; \! E" _9 G
    end
1 a4 B* f& R# r1 S3 z3 z# ^% ?& ~end9 t% p# n8 A; w$ j

4 L$ i3 I+ B) s9 ]; ~- j其中的procindex为整形,代表当前process的序号。7 P2 ]7 N7 H% C& 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, 2025-8-27 09:03 , Processed in 0.013117 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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