设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13814|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 A' c$ N$ M4 X# b
, s( I! D- f5 ]# b  y! 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中的数值,不知道会不会有什么不妥。
3 Z: f# h. L6 k6 V
, M! P  p* C! cbegin P_read arriving- t0 V' k9 ?3 w
    while 1=1 do begin2 i  x. ]8 }6 u3 l- s4 w$ C
        read A_tote from "data.txt" with delimiter "\n"9 V/ H' v" C- Q9 m  C" o
        read A_time from "data.txt" with delimiter "\n"
" A. Z0 J3 \: m7 `& y        read A_leave from "data.txt" with delimiter "\n"
0 H) Z( I6 }8 w% l! g) b) C! A8 G        read A_picks from "data.txt" with delimiter "\n"
5 x' @/ {7 b8 m# X: H        set load type to A_tote
' h' v5 F, \. ~5 T' ]        if A_tote="tote 1" then set A_induct to 1; o7 }1 |/ o  J+ y! ^
        else if A_tote="tote 2" then set A_induct to 2
& }$ w& T+ u0 J$ Q  y7 E            else set A_induct to 3    8 D. t0 B$ @) \% [' P8 ~+ d
        set A_i to 0* N3 `2 O: M) G
        clone 1 load to P_induction% M4 s# a5 p: e& y2 [
        wait for A_time sec9 g$ }3 Q! h6 X' j8 ~7 m
    end% A" p: J5 c* d; ^
end
1 u# Z) {$ H1 ?. h( [! [+ U' y) Z. m8 @3 Z: k# H( E
begin P_induction arriving
& A7 G  A7 Z3 Q' {* V7 b* y    if A_induct=1 then clone 1 load to P_pick1" ?5 r3 e  P) p: ?4 S! s# _
    else if A_induct=2 then clone 1 load to P_pick2
4 r- u  r* \' B* {* O. c" n1 N  S        else clone 1 load to P_pick3
% j( `3 W/ i1 _! L( k7 Uend
4 T8 ~) q' W9 Q% F8 Q9 L! x
2 T( J8 U7 A8 M) u- l. @begin P_pick1 arriving2 G7 F) l5 D3 k" {  K2 ]
    set A_i to 1
# b4 N9 w/ z( t6 I1 z    move into Q_induct1
; Y7 R8 p, d0 K% r& i* k    move into pickaisle.induct1& x# W: B  Z2 M0 K2 r( @! R; |
    while A_i<=30 do begin
' e* R+ v% S; [2 J8 G& x! ^        travel to pickaisle.con(A_i)
5 T' v" u+ `  G  B/ E0 C2 m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* m& Z1 J9 |8 P2 {, X        else wait for 10 sec. u4 y) S/ ^/ T
        if A_i=A_leave then send to die
; X1 Q: U9 k* P4 h( j# Y        else inc A_i by 15 p7 a, B6 k0 Y
    end
1 e& [& u( @0 Rend1 C; V* Z- [+ `: x4 E; F: [
2 J) L. v/ n% Y0 z! b3 ?( u+ `& _
begin P_pick2 arriving+ ]7 u2 M7 w4 N' g  C
    set A_i to 115 l/ O/ r. U" i  v  K3 T$ k
    move into Q_induct2) ~9 g2 N9 R/ L, g" Y$ u8 L4 w
    move into pickaisle.induct21 _/ K- C. n2 M/ d! n5 X
    while A_i<=30 do begin
, R& Z/ n; V1 @6 Z- J2 t        travel to pickaisle.con(A_i)
. U8 N# j. y* e- d4 y8 H( `/ b; {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% b3 }- o% `' s) j
        else wait for 10 sec1 L# R' [2 q' o% e# _, Q
        if A_i=A_leave then send to die+ `+ ?1 m; N) Y) _
        else inc A_i by 11 }) `' u8 J- ~
    end
/ x$ V) E9 k6 o* Aend
3 n# h0 ]& l6 c& e" ~
. S3 B: Q' d! j. m( V1 Xbegin P_pick3 arriving
: Z  B2 o6 i( N9 \$ r    set A_i to 21: }- C/ |: }* A7 k) n
    move into Q_induct3
5 ~2 }) K; V" p( P8 `0 o1 W* ^) w    move into pickaisle.induct30 {, J8 y" A( o; ]0 h
    while A_i<=30 do begin( V  d- X* I) S  Z
        travel to pickaisle.con(A_i)
# s% U5 W" u, \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ X% Z( I% n% \0 [# P. Q- T% w7 S
        else wait for 10 sec9 W- {9 I  D3 V7 z
        if A_i=A_leave then send to die
* V, D: p  w- ]& C+ l9 s        else inc A_i by 1
2 P" w6 L' ]7 j; o; R# V    end1 t8 H, R( ~& s+ h' R
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是个什么东东?
5 a' P$ u: j* d; M3 tmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
- L. W4 v8 _; ^7 r, R5 |! M1 V" x% |! w; U, X& w
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- h, I( N) B$ d. H) e/ S
; ]' }7 F; b0 s
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:  S+ x$ M1 V4 r$ O( t7 H
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% m4 p. i3 f0 B$ G2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;1 J# S* H. K) j# ]( |% y. l( y9 m
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:$ \% O( _* w0 }8 b3 t
begin P_induction arriving
) y! e1 l) ^- @" e/ O* \    clone 1 load to P_pick(A_induct)- S8 O& c9 @8 M: c- w1 u) D, a
end最大的系
+ T- ]: Q  C: o* F. B, b+ L/ x5 H5 s' j! N; R
begin P_pick arriving& O+ t5 J8 v, F) r$ @
    set A_i to procindex * 10 + 1* \. i5 H0 A) [' \5 l  c2 {
    move into Q_induct(procindex)
7 A+ y: s! y, W& ~: u9 T# [    move into pickaisle.induct(procindex)/ ]9 Q5 M* n. `6 Z9 l
    /*check the type of pickaisle.induct(i), for your last problem.*/* @" s- P3 Y7 s
: H/ \& ]2 `8 Q6 G, m% A# n$ m# Z
    while A_i<=30 do begin" n8 |! \1 [; J1 ^9 d1 _
        travel to pickaisle.con(A_i)1 d( [, R! X: r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ s! p) ^9 D* Y5 j6 M$ ~; u
        else wait for 10 sec
- R! O" N1 D5 ^( ?0 i8 W        if A_i=A_leave then send to die
) r4 U8 J6 {$ Z  B        else inc A_i by 1$ P* Z- B4 r! c5 P' P
    end0 g0 L6 |+ r4 ]; y. R3 m! C
end
; V4 P3 ~/ k  ]
" {. L# n2 N0 F( S) s7 h其中的procindex为整形,代表当前process的序号。+ _, e  ]7 D1 C+ 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-5-7 15:19 , Processed in 0.014220 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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