设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 6380|回复: 2

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

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

' e- g7 C9 O0 k1 B% U. j  S' Z我的问题是,在每个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中的数值,不知道会不会有什么不妥。
  b6 F% k, k- }4 L! B
% z+ x$ w- P, O/ S, _8 b, Pbegin P_read arriving
$ q. N9 {) B% E% o8 [/ x    while 1=1 do begin, \; L/ O  F0 w' U
        read A_tote from "data.txt" with delimiter "\n"5 V+ B. p$ u, W
        read A_time from "data.txt" with delimiter "\n"3 _7 Z$ ^: Q0 a$ S! f* v
        read A_leave from "data.txt" with delimiter "\n"
0 B0 {$ y9 [9 H+ m/ `( }1 A$ L; g1 G        read A_picks from "data.txt" with delimiter "\n"+ m* {) j# M8 g+ i) M9 T5 f9 X
        set load type to A_tote. q8 l; ?4 R) o( w
        if A_tote="tote 1" then set A_induct to 1; y" a+ ], y0 t. Q
        else if A_tote="tote 2" then set A_induct to 2
8 {# ^3 X' m% X! o1 Z* @5 ^            else set A_induct to 3   
/ U7 H: `4 ^" o7 q/ u2 o3 ~        set A_i to 0, Z8 ~- x, U! N. g
        clone 1 load to P_induction
; ~& ?2 d2 v& `5 F& T        wait for A_time sec
0 X+ I$ }& J; _0 C, ?    end! |, X/ O0 t3 K! e$ q% ~, @7 q
end
9 }7 b/ j3 w! P$ G9 K) X" F% L. p2 V; Y6 x5 g( ]3 a+ }- H
begin P_induction arriving
! ]& @' B* t. P' \& Y    if A_induct=1 then clone 1 load to P_pick1% `# i/ a8 ^+ z- s9 R' S5 L  p
    else if A_induct=2 then clone 1 load to P_pick2
5 Y2 z( t. y8 A, x  ~6 G# G        else clone 1 load to P_pick3
; K% L. [$ {0 d$ G# N. \end
* s" @$ p4 e' i" @! ?  P
3 m. W( ?. k, L4 [) ^begin P_pick1 arriving8 H2 }/ U2 h" V1 T, F9 b4 [
    set A_i to 1
4 \8 U  H- R% Z1 @# m( V/ t8 _2 [    move into Q_induct1( g& ^$ R% R  B; G9 z4 _: `5 i6 M0 Z) x
    move into pickaisle.induct1
( ^' i/ B: ~9 c8 Z    while A_i<=30 do begin5 M# _; D, }0 `) i8 |
        travel to pickaisle.con(A_i)6 W6 ?% X" j" F3 H/ A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 f0 D3 |& _% M, u$ H/ s, r4 W1 A        else wait for 10 sec0 w' D4 b% X4 K$ c8 h9 j3 I
        if A_i=A_leave then send to die3 s- q1 ^* d, F( |6 c, l
        else inc A_i by 1
- Q! ]8 ?4 h8 g5 o. b+ g; D+ B    end
3 x  o* q! G5 s9 J- Z5 V9 t4 Fend
9 o5 {( @& y8 R; P% T) L% X+ V8 f' c, P+ V$ a1 ?" o
begin P_pick2 arriving" W6 [3 {+ `; x4 I+ }2 x$ K& g
    set A_i to 110 d1 i1 G! a5 {' |6 T
    move into Q_induct29 r( S6 p% Q0 z+ P* q. X
    move into pickaisle.induct2
8 T# \2 x+ `, ?% |' ^$ m    while A_i<=30 do begin
* _( s, l+ n, m& |        travel to pickaisle.con(A_i), ?5 K2 c6 ]* u+ m+ u3 C9 |4 f3 y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; H+ E( ?5 R7 V3 y& k+ [        else wait for 10 sec
( j( l. z8 ~: w( w4 G        if A_i=A_leave then send to die. o9 e; N3 Q1 T! N/ h4 A4 f1 B5 q
        else inc A_i by 1
' m' b; R7 w+ x0 q    end
; H- h  @( [$ A" R( ^5 y+ Dend" z/ J9 i7 ?3 }5 C* ]& c2 }% O
: h( Q" J* y# r3 u6 q) \
begin P_pick3 arriving
$ k5 E4 J5 s3 w* b8 R. l4 V7 ^    set A_i to 21( k0 [% X$ R% |1 v  ]8 r7 M! ~
    move into Q_induct38 o" Z" c( Y, C! c
    move into pickaisle.induct34 p! M2 R% ?: h+ |
    while A_i<=30 do begin
7 R6 ~0 D% K! L1 r: ]2 j        travel to pickaisle.con(A_i)
2 E. i( H# Z" e4 m! b9 N2 M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 [+ g3 Y# c# ]5 x        else wait for 10 sec0 o7 @0 S, P% W8 l7 J
        if A_i=A_leave then send to die# X5 g( E, ^4 `7 b
        else inc A_i by 1
1 ?; w2 U1 d, {9 \3 o    end
$ ]0 V  P7 B: a% F( Iend

最佳答案

查看完整内容

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是个什么东东?$ ^# [6 x, J1 X9 _& q1 S# }
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" g/ y, I. j# Z5 Z) f. G6 C* n/ W& Z7 t
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。7 s. \6 v4 f. o$ t% i- w, s
* o- Z1 \% y0 M
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:( B5 f3 w3 Q7 ?5 @+ _( D
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 F! l3 X' G# K2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& Y$ E* [4 S' v  Y( D& j
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. W7 k# F( r) Z8 c' L" f* p6 l# B
begin P_induction arriving
/ K5 w  V! A6 ~: f9 ~    clone 1 load to P_pick(A_induct)
# a% i3 q6 |, [9 T$ }* M' Yend最大的系
4 {* k4 |! J. M' y! L
3 A  O# j) |! b3 F* D5 Q: h/ ?begin P_pick arriving! W) w% l) t9 z; J  E' G' [; Y1 P
    set A_i to procindex * 10 + 1
/ m; Q$ X: A* p    move into Q_induct(procindex)
: J" R, z7 u9 G& o) i# I% {    move into pickaisle.induct(procindex)
+ i2 E" H3 Z0 C2 S$ F3 f    /*check the type of pickaisle.induct(i), for your last problem.*// U( P* \0 ?' g* D- ~
+ b. ~5 _+ I8 Q& s
    while A_i<=30 do begin4 }2 Q/ D4 ]* X! q# \% ^+ d
        travel to pickaisle.con(A_i)
+ b4 U, ^* ~5 ~* ~  A* j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) B7 W* u9 C3 {( @0 R
        else wait for 10 sec
3 O+ i1 d2 ?1 f5 Y( x+ X        if A_i=A_leave then send to die
) s6 }1 s  G6 S3 e        else inc A_i by 14 J/ o- ?) b* ?" N2 L
    end
5 k7 h( }# a/ W. V- `end: k- a; ^9 \& r5 B7 `. [  T1 k" l

4 {. n! X4 S. i2 A+ A- {其中的procindex为整形,代表当前process的序号。  Z. y$ n! V! l* i9 E: ]
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, 2024-5-18 11:38 , Processed in 0.016459 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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