设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12982|回复: 2

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

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

0 X! ]2 N- m# B; i我的问题是,在每个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中的数值,不知道会不会有什么不妥。
: {) O3 F; g% t: }8 |3 ^5 T* q. w: V1 B9 f. _4 L; j
begin P_read arriving# C; {! ]: V9 N- m6 L; d7 C
    while 1=1 do begin
7 T: D) B1 y, u5 v  U  P% F        read A_tote from "data.txt" with delimiter "\n"
" y( ?$ f' |/ I% m4 \  _        read A_time from "data.txt" with delimiter "\n"
0 G. n. ]" h+ d. D7 w$ H8 c( |8 d( }0 F        read A_leave from "data.txt" with delimiter "\n", t3 ]! |; W; e
        read A_picks from "data.txt" with delimiter "\n"+ }1 E6 m& R$ P: ~& l
        set load type to A_tote, h' p% j# o; E! |+ C
        if A_tote="tote 1" then set A_induct to 19 y+ m  v" g* ]. A
        else if A_tote="tote 2" then set A_induct to 2
# c5 T8 A6 T* }6 G5 E! T            else set A_induct to 3    0 G) ?  j2 O4 w* k
        set A_i to 0
4 Z( i4 P  Q7 E0 e& X        clone 1 load to P_induction
* f. P+ E- t& `: G        wait for A_time sec1 X  v8 u) n5 l2 q; s/ D1 X8 m. H
    end
  N4 b: j0 z- o# e/ @* r1 Y8 Wend
1 j+ n' m+ J% \* W$ x6 X5 R8 A7 T' J( w  g/ ^
begin P_induction arriving
% E$ G/ G+ e- [0 ^8 U    if A_induct=1 then clone 1 load to P_pick1
0 B- {0 Y2 T7 Y6 h    else if A_induct=2 then clone 1 load to P_pick2
' c1 `9 j: S* `) j) K! p4 H        else clone 1 load to P_pick3: ?% R7 l% X* P! O
end% [  Q* l! M& [& j. o9 s
0 h4 ]$ I: {) S: n
begin P_pick1 arriving
+ \$ @: {5 ~- o4 T5 |6 D( A    set A_i to 1
) e. }1 w' C* P0 t( ~, g    move into Q_induct10 ]9 I1 V8 G3 i& o# \9 e
    move into pickaisle.induct1
7 j' Q- D- u; d% K    while A_i<=30 do begin
! N& v5 ~+ D. h5 }1 X2 U        travel to pickaisle.con(A_i)
5 [: U( N( D/ D/ z( Z) w( g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; k6 M0 s, g6 d: i- f) m3 |
        else wait for 10 sec
! _* `8 E: a/ O2 X& v9 _; q        if A_i=A_leave then send to die
% {4 C# k- c& m; g% A0 _        else inc A_i by 1
( r5 r, S( O0 J! {4 a" v9 H) u    end, ]0 F9 x3 `1 `
end' N) f/ z' n7 m. ?$ p

( O" V( H1 S  Ubegin P_pick2 arriving2 @8 Q4 T( e/ z
    set A_i to 118 H. x" m& a; h% t# O4 z( X9 A- Z9 |- H
    move into Q_induct2
' I6 D" Y  W  E: Z& E& z& r    move into pickaisle.induct24 {( n8 e- _! W
    while A_i<=30 do begin2 t2 a+ a, [: ?  U" v# K
        travel to pickaisle.con(A_i)
' E7 _7 s  V# B- }8 E1 ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. Z7 W) A/ [$ h1 o/ L! K' y' c. D2 u        else wait for 10 sec
: O1 p  _# c/ D; L# d! {        if A_i=A_leave then send to die
( y" u9 h9 k: o- l        else inc A_i by 1+ h5 L1 F. E8 K
    end+ |1 ?! y* B$ n
end
" g( T: J7 ?- Y1 P7 j' {$ K9 z% l
begin P_pick3 arriving
! x* `! F) h  P* T/ i: T, x; m! U) D    set A_i to 21
, [( l) f* ~1 N% I7 W    move into Q_induct3: Y1 I4 G) N" j! O; z
    move into pickaisle.induct38 {  f" N) s) b+ K% Y/ _4 u# H) H9 a
    while A_i<=30 do begin- T' o: y% d, A% H, M! W& E
        travel to pickaisle.con(A_i)5 E) _3 Y% y  j0 T$ _, X) Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ z# J8 M8 Q- e- h- {
        else wait for 10 sec
3 K& Q% R+ |' W9 w2 e( _0 m5 u        if A_i=A_leave then send to die0 C4 q7 B* d' c( d3 _3 B% l
        else inc A_i by 1
  E; m7 o' c( u( n- e    end+ I$ ?4 c; @: a4 K; ^; 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是个什么东东?
! q6 ]8 P4 v" ?# a5 lmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! Z+ g; M- v) c3 `
4 q! m( V3 p: F: g" r& I: tAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% j& ^$ v, J" E; _/ j. K" n6 b+ @( L" I) j7 w6 V$ R
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
9 Z+ b9 j) J- @, y! A3 L) i5 S1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
; l0 E( m. h7 s( w2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
6 r# V7 a" W3 B$ S$ ?3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) I, t9 |6 F6 {1 l- f, K" q, ~
begin P_induction arriving
2 W& W( M2 U9 N, X/ l    clone 1 load to P_pick(A_induct)+ b" r* u, d& X; N* m
end最大的系% }& M' [( U! g# A, \: i9 p+ w

* y# W/ V9 {, |9 zbegin P_pick arriving0 G' f. P# x5 F+ k, j  G' j
    set A_i to procindex * 10 + 1
+ ^- n$ N% y9 _8 W5 k+ H    move into Q_induct(procindex)1 Q/ A/ H% I/ m% l/ L
    move into pickaisle.induct(procindex)( j" Q, e; Z' Q7 c0 f2 _# W
    /*check the type of pickaisle.induct(i), for your last problem.*/: f- G( I0 Q/ R- T# e$ [7 @; Y

$ [! c2 K5 G9 d    while A_i<=30 do begin0 `, ?* o2 K( d/ D
        travel to pickaisle.con(A_i)
4 g. Z1 ~3 \3 w* E9 ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" W; @. w  L1 x: ^        else wait for 10 sec
' s3 ]* D7 j2 d! z. s        if A_i=A_leave then send to die8 b3 T. a8 T5 G  T
        else inc A_i by 1# U" m4 K# H! q' H- V% R# L: {& i
    end
) C2 y" D6 h, R; k4 L# Q! B( Fend
5 [: q7 `! u' R0 p; Y! }" G
8 {6 g6 U0 L5 U- E其中的procindex为整形,代表当前process的序号。
  O$ v6 i( D$ m* ystation和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-3-7 15:08 , Processed in 0.017591 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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