设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12547|回复: 2

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

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

1 f. g+ k1 o4 [" u# n我的问题是,在每个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中的数值,不知道会不会有什么不妥。. `+ ~/ M8 u7 R5 y' v* `

) C4 c* J$ q8 i9 F* abegin P_read arriving2 g0 k( u1 F. W. I
    while 1=1 do begin1 n  ]- n, @! a0 i; Q
        read A_tote from "data.txt" with delimiter "\n"# c4 B1 t6 Z0 L" D
        read A_time from "data.txt" with delimiter "\n"
! \9 E& R$ ^# j- e: w        read A_leave from "data.txt" with delimiter "\n"3 O  D( u- D/ ]
        read A_picks from "data.txt" with delimiter "\n", p9 w/ F1 ], X! D6 U5 x
        set load type to A_tote
8 C9 i8 b( u" i0 q; S9 r4 t        if A_tote="tote 1" then set A_induct to 1, t- @& v+ ~% B( e9 X. D4 a( p
        else if A_tote="tote 2" then set A_induct to 23 d* T  _5 ]% c9 |0 s4 q
            else set A_induct to 3    ; [8 N7 Y8 W' M& B, K- Y2 S
        set A_i to 0" o0 A1 i# X$ y6 ^7 m1 B. X
        clone 1 load to P_induction* J& }  a. I+ T; u
        wait for A_time sec
) C; c6 ]" ?( q& `    end
; Z  t+ v, L+ M0 {end+ o- b! S& Q# e$ r' }1 U. f. E
5 ]6 T' S" {" ?
begin P_induction arriving
3 o: ^! m1 q& T    if A_induct=1 then clone 1 load to P_pick1
. D3 p- `' @8 y5 J) c    else if A_induct=2 then clone 1 load to P_pick2! E% n' X+ \8 G2 {5 b
        else clone 1 load to P_pick3( K( A6 z$ u1 n. w! M" A8 x( g, Z* w
end9 |' ~- P! Z! S5 L1 ]4 u
1 P3 r# T6 n. [% e; n, u, U
begin P_pick1 arriving3 }% m) F. l" B( }) g
    set A_i to 1
; _: k! s( ~; f2 h/ G5 X' D    move into Q_induct11 H' y/ X: v0 ~* N
    move into pickaisle.induct1
  g+ G. {- ]% y  s; x    while A_i<=30 do begin
4 A1 q) x! E9 w* B        travel to pickaisle.con(A_i)
% d0 ^- J/ `( K' F- }( S. p& H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 K, H5 g0 y1 s1 |        else wait for 10 sec2 f5 {; E/ T$ f  `# E
        if A_i=A_leave then send to die
' o) R* c6 J/ |( B        else inc A_i by 1
* y8 o( Q* s: h1 K# ^& I" d8 u/ w    end2 U1 n5 l  H3 b: ^# P
end
; H% y* X/ _2 X: @, I
# Q: W2 Q. H2 F5 Vbegin P_pick2 arriving
5 @3 n1 j6 J2 X) x- w% s" W# q    set A_i to 11  g! P& O% `# I/ |0 E% d) K/ B
    move into Q_induct2  m- F$ }4 s8 ~+ A% ?  i% H
    move into pickaisle.induct2  m, `- Z" v# M, ~
    while A_i<=30 do begin' `% j$ j& j1 ]: r- g
        travel to pickaisle.con(A_i). H7 A! I* ^, H3 j, r2 V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 M3 q3 D$ G0 \8 f( W5 h. ^        else wait for 10 sec
; H/ D( E' ?! w. d1 `- ^1 p# a+ ~' E        if A_i=A_leave then send to die
) e* k+ w. A5 E+ a( {* O2 P( @        else inc A_i by 1, h; h6 E" p% f: w6 U$ m# [( |
    end
' [0 g; z; S% O! c9 i' oend+ X1 K( `& z( b) V0 L# w7 u
! O- d( i) d) `5 S+ ?
begin P_pick3 arriving' I" ~5 L) H" K8 v  k
    set A_i to 21
2 M$ b$ Y- t2 G" c" X    move into Q_induct31 s* n2 j7 |* E. q1 |( ?. t# r
    move into pickaisle.induct3
/ ]& h/ Q* d' ^0 t    while A_i<=30 do begin
/ c, p1 u- W8 l2 v9 ^. Z        travel to pickaisle.con(A_i)
; [7 C2 b3 x) r0 s  Q0 N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  Z1 \* B  }# ]. |4 }. U0 h9 s' W3 m
        else wait for 10 sec
: W8 G0 u: o7 Z& G& P9 L% e7 l4 G4 z; [        if A_i=A_leave then send to die
# H% K1 P; \! I2 `8 @        else inc A_i by 16 \# r6 x& ^6 n
    end
+ x& Q0 P0 o) h/ T2 m" Fend

最佳答案

查看完整内容

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是个什么东东?
. ]( N  k7 R  L! i# B1 {, A) qmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?: ~: |+ b7 f" x' y$ @2 K3 a  j0 d
! {/ Z8 W3 a8 x# {) t
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 Q5 d4 j7 ~9 `1 l2 \5 I

- \8 F: e' O& s: K  z另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
' @1 X! m! X9 M1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
/ ~* e* y. U) y7 v% l2 m: t2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 p8 v0 e9 M% Y# ?3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 u: m/ u2 E8 I' i5 ~: X! G
begin P_induction arriving2 W. @6 M( ]7 f- ^3 _7 ^" V8 M
    clone 1 load to P_pick(A_induct)* D4 L. }1 G0 _5 _' b+ l
end最大的系
0 W; `/ M8 u) `
% s* D- F2 K2 z+ J! Mbegin P_pick arriving3 A; n+ T, n1 s% X- q' J3 U2 `
    set A_i to procindex * 10 + 12 N7 Y" n2 b2 y
    move into Q_induct(procindex)
) Y1 y* U/ h3 Y! R7 C3 q" d: n    move into pickaisle.induct(procindex)" Q; s! U# Q9 }5 k. Z
    /*check the type of pickaisle.induct(i), for your last problem.*/
$ Y6 @. P6 L; I* O8 I8 X* a# ~
- S4 ]" ~6 H$ {3 S8 U    while A_i<=30 do begin7 r' d- F; `6 ^8 @. V
        travel to pickaisle.con(A_i)
, W" c5 }, a9 z! L3 a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ v$ m  r! R6 {1 ~5 c        else wait for 10 sec
8 }7 D/ E; Q9 k        if A_i=A_leave then send to die2 T. [' K( T% B9 K; b, h$ d
        else inc A_i by 1
- Q( K  q1 i# k; Y( v( W) [( X    end% r* }$ w: s. t" L, f, `
end
7 E( f/ w2 W( g
: w/ P) v. O4 [+ l& `其中的procindex为整形,代表当前process的序号。- a1 e' b  S# y9 I( F8 M" P6 t: A
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-31 06:57 , Processed in 0.015598 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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