设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14224|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 }' s- Q! B* h
2 m2 R2 i$ T8 |! c7 ]1 V我的问题是,在每个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 H: _8 K& E" @; l
: o8 [: R9 h3 ]& ibegin P_read arriving( d3 y, N( r+ C' a
    while 1=1 do begin
6 n5 P2 r& M1 h9 Y        read A_tote from "data.txt" with delimiter "\n"
8 `4 `. _+ k/ U9 ~* ~2 R2 O) f        read A_time from "data.txt" with delimiter "\n"
6 i9 s* V3 |' G6 F' J# j6 _        read A_leave from "data.txt" with delimiter "\n"
2 ]' d, {$ v6 {3 K( B" o  I        read A_picks from "data.txt" with delimiter "\n"
# y& B& q* z, x7 O/ u        set load type to A_tote
" }8 m) V+ M. n+ P: @        if A_tote="tote 1" then set A_induct to 15 B0 w$ H1 m' C0 |" i" `
        else if A_tote="tote 2" then set A_induct to 2
) c& z: \7 w( z. k            else set A_induct to 3   
7 E% O+ n4 T7 {# v# e        set A_i to 0
. [) q6 K3 A% ~- [& z2 d        clone 1 load to P_induction; g) I* H% Z' a
        wait for A_time sec
" n3 D! }3 U4 `! |# [4 U7 Y# V    end
. t/ }" _# n5 _end) p. K. g- Z) J( R  A7 O

0 V. H* L7 _5 v  Bbegin P_induction arriving' k$ T/ |/ M7 i: v/ Y
    if A_induct=1 then clone 1 load to P_pick1
& M" Y9 l; x0 u; I0 H    else if A_induct=2 then clone 1 load to P_pick2
- r  b  a2 Y- |        else clone 1 load to P_pick39 {  L8 t- Q5 y
end% s5 n9 \( W5 |+ I
( {  q7 H. T* J. a) q4 x9 d' r1 R
begin P_pick1 arriving0 a( H: p8 E* B4 C! ^, j
    set A_i to 1* ^- J/ }( ]; l# ~/ K; P
    move into Q_induct14 t' Z' U7 O: z. e, x
    move into pickaisle.induct1
- b! ~1 C! \! F% A( \    while A_i<=30 do begin
% V7 ~0 H2 ?# l1 G# e# E9 S        travel to pickaisle.con(A_i)- K0 l  g/ A+ y% M' k$ p- F+ c1 ?0 ~5 |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! F. S9 c4 E5 v: {/ W. Q7 V  ~
        else wait for 10 sec. a! p7 w: J" \9 S) \
        if A_i=A_leave then send to die
+ r7 P) G" s% ^& L- ^) ~+ y9 ^        else inc A_i by 14 @. @! ?% q' H* V; b, I1 P. d
    end
8 ^# b$ d! K+ Q: U) Bend/ }/ l$ b- w7 J! S* Q; N

$ z. j7 x- H! Abegin P_pick2 arriving8 J3 S9 ^8 p/ e+ S
    set A_i to 11/ y/ R6 O3 ~3 j! _+ T7 v
    move into Q_induct2
+ |+ i2 L' a' W5 e* X    move into pickaisle.induct2. P  [' K( c! z- @0 U* h" C
    while A_i<=30 do begin
. {3 v% w) w# @/ h        travel to pickaisle.con(A_i)/ c8 {" V% l* j' @( t. J* {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& Z- t+ \8 W5 T, R: F* v
        else wait for 10 sec8 Y7 e: e$ n& a5 h
        if A_i=A_leave then send to die
  g9 y  `- i1 Y6 @        else inc A_i by 1
$ t: I3 @7 M  f    end
8 Q8 A, _1 ^5 aend" n/ l1 b( T( i
0 i; O% w& y$ e! H( v  `# g9 w
begin P_pick3 arriving- ^" }, L/ [6 L
    set A_i to 211 ^7 X, N% l5 S9 Q
    move into Q_induct3/ G$ w9 y  G' \- ^4 s( I' V3 D* l% n! n
    move into pickaisle.induct3' B) N1 Z2 i; A
    while A_i<=30 do begin
: Q+ M* d* f! S4 u2 u! B% s# f        travel to pickaisle.con(A_i)
. D1 _* c$ y/ V9 K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: Q/ U% N4 Q. }: d4 w+ v        else wait for 10 sec
/ M2 l% {$ M, r0 E1 r# I* }        if A_i=A_leave then send to die
" `) R" E: A* v/ b4 s# O" l& V        else inc A_i by 1% X% y5 d4 J3 d4 o1 H4 U) N
    end$ e& }6 A' U& S  ^, X$ t- |( L- c$ Q4 l
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是个什么东东?2 i8 P* ^/ |  b2 ?+ w
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 Y& m* V! [# Z* U- {

* W7 m% v. c- {3 A) cAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。& j1 I- g' \; S& `: N  {
/ P$ O9 c6 B" ?" o* l+ \% \! E
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, ]# U+ R. h# c
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
+ w0 P& x) a0 a; S5 I/ G1 l2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 R* f- ~1 {' ?! O8 m) M3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
# B7 q* M( T9 d4 N( Gbegin P_induction arriving: @4 |2 ^+ o4 W* \% v& V0 U
    clone 1 load to P_pick(A_induct)$ K( V. n2 f+ }$ v# S* m
end最大的系9 w( m& c% z9 E& p) l
* f6 ]  f. V1 O7 M
begin P_pick arriving( |) u' ^  k, @) }" b
    set A_i to procindex * 10 + 17 ?. k9 r) X1 t8 E
    move into Q_induct(procindex)
2 j+ P/ V* m. L/ Q" X    move into pickaisle.induct(procindex), R7 e6 ]! k) ?/ s; p0 ^, H/ p
    /*check the type of pickaisle.induct(i), for your last problem.*/
7 H' m5 Y1 S! m+ y0 k! ]# }: L4 `; h* R+ j" H
    while A_i<=30 do begin
, h3 N5 J+ z5 a4 }3 ]        travel to pickaisle.con(A_i)+ j$ U9 `) Z( Z# m% y% x) u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, J6 c6 K5 l; X$ J$ q2 K$ Q# K        else wait for 10 sec
% `. |/ {( p6 J1 r7 T        if A_i=A_leave then send to die
+ n% C5 L4 s1 a: @* V+ s' a5 e        else inc A_i by 1
  u0 K9 L9 u( t& Z    end
2 q  u5 Q9 L+ x- w5 Y) l* g- Gend
1 r. W; i/ q  M  _! U( j2 n0 g  f4 A, ?/ H" m
其中的procindex为整形,代表当前process的序号。$ b7 n1 y+ z+ h6 U  D+ f" r/ W
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-6-22 20:14 , Processed in 0.013580 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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