设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13975|回复: 2

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

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

9 b% r1 w6 [& f1 V2 F2 l我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 Y) P% Z' g5 W  [
$ r! e* d( |/ bbegin P_read arriving9 c- n! _4 ~9 ~
    while 1=1 do begin
; O7 U# I5 I4 W& k& ]        read A_tote from "data.txt" with delimiter "\n"8 i) t. k: P% H% x# X4 t; x
        read A_time from "data.txt" with delimiter "\n"
- I( C. v5 w3 f4 |, }) ]        read A_leave from "data.txt" with delimiter "\n"4 z5 F9 o. k; R# ]3 g& p4 R; z, @
        read A_picks from "data.txt" with delimiter "\n"
* |2 O! ]% K3 p3 \        set load type to A_tote
, }$ s/ \+ ~) O  \! I! O, }        if A_tote="tote 1" then set A_induct to 1
7 r' V( w5 P& L3 o0 h8 \* W        else if A_tote="tote 2" then set A_induct to 28 I- {) b! v, b$ B
            else set A_induct to 3    8 [9 f5 y1 [& i* S3 ]
        set A_i to 01 g5 B: R7 B& S9 g
        clone 1 load to P_induction
) k4 L8 j+ r+ y# w4 ^( @5 U) h        wait for A_time sec5 ^4 E  r# F1 r5 z
    end
3 H) z+ Q- e  {  C! w9 A. B% ?; [end& ]- [# w1 Z$ s& y& x6 c
1 _. ?0 n6 A3 H& Y0 U9 m7 i
begin P_induction arriving
% G- e4 |2 S: _2 p) O    if A_induct=1 then clone 1 load to P_pick1+ Z$ K. f( n, _- g) v* U& }9 M
    else if A_induct=2 then clone 1 load to P_pick2
% }  T) ~) D8 k, f! \- q        else clone 1 load to P_pick37 H  l! p8 p+ E. S# ^5 w/ J
end
/ E# r9 w' A. l& A
& p# ?, V$ D  s4 _2 j; Rbegin P_pick1 arriving
- F6 A- U0 z, ~    set A_i to 1
. G( m0 }. W, g9 E    move into Q_induct1
4 Y# d! G: u# c! t! P/ y' x" Q    move into pickaisle.induct19 `4 P; X# p+ K8 E3 a, W& \/ O* y
    while A_i<=30 do begin- w- m9 k" ]6 c! \2 H
        travel to pickaisle.con(A_i)
3 C6 K; V, c. E, X! |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! m+ V8 g; K. u0 u/ J( U, r2 `
        else wait for 10 sec
8 k1 S0 D+ ?& V        if A_i=A_leave then send to die
3 a  |6 `% m0 Z6 M9 x8 [        else inc A_i by 1" T0 Z) ]2 D. i( `4 d
    end
0 P8 \/ s: T2 nend/ W9 a3 ?" ^# |$ E9 y

% K- k; A/ l1 b3 v% cbegin P_pick2 arriving
+ s: W# c8 t! Z& d" Q$ X    set A_i to 11
) Z0 ]. l7 W4 e8 Y7 [    move into Q_induct2" w$ M" N$ A/ h. }, m
    move into pickaisle.induct2
0 i9 j( S* y$ C" b1 {    while A_i<=30 do begin
2 i3 @( [" m) }$ _) ~        travel to pickaisle.con(A_i): @7 q4 f7 W! G7 c2 O+ s( d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; w; A& v, |3 h        else wait for 10 sec
1 K& D* `. ^, Z  C1 g4 F4 `        if A_i=A_leave then send to die' V$ Q$ J" [% R  y" U, H5 q
        else inc A_i by 1
/ d$ v3 S$ H  l    end2 Q6 L8 U* k& R& O' |0 I/ }/ h
end
. ]" H- e4 _. M! y: a9 a2 {4 {2 j( P- S$ x8 ?2 i5 n$ G# u0 G" f/ y; B) X
begin P_pick3 arriving4 A7 _( V" P; t5 i4 }+ K7 d6 P
    set A_i to 21! N" H0 @) H' p4 Y: g" d2 g: U. U2 U6 r
    move into Q_induct3
: B- ]# G! Y6 \9 O" Z    move into pickaisle.induct33 S+ B9 c0 Q! u2 y. M% k: R. l
    while A_i<=30 do begin$ b4 \/ Y( I) z: m( u9 d; `
        travel to pickaisle.con(A_i)
# B" X1 z9 e% p9 n; v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 W3 J% M* A& n5 v* g        else wait for 10 sec
# ~. M# p' s8 B        if A_i=A_leave then send to die
$ l  n( P" [& g1 y1 b        else inc A_i by 1
6 p+ ~! U, C! m6 q$ }    end
5 G( @+ \' v, X6 Zend

最佳答案

查看完整内容

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是个什么东东?
* q5 Y% k% H( t0 S1 Cmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- @& E6 O  u/ |  c; a0 j8 ?

0 c# h5 _  J4 a) Q8 @: Z: VAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 z5 e* ^: J  V3 T- `+ c/ s
/ B. i0 y: ]7 e另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
+ j. {" C# y" @7 A4 H7 V; {- Q1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 e0 h4 p! p' X+ Y! w$ V  f0 Y2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 A) q3 g% F, A4 g
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
$ Y. s! x. P( k0 z3 |0 Nbegin P_induction arriving
: W" z+ [# D; }6 p5 j    clone 1 load to P_pick(A_induct)
  Q/ i) M( t% K& |3 F8 kend最大的系
( R( F1 W& R# \! K$ X) {3 @4 [+ X2 x$ g1 Q- _* F' L
begin P_pick arriving
4 Y4 Z; r2 g4 p/ @6 Z    set A_i to procindex * 10 + 1
5 p  {2 f5 H+ m# o    move into Q_induct(procindex)
- S0 t, U5 a0 H, R' i1 a0 y3 ?; i    move into pickaisle.induct(procindex)
2 S' H* [8 T5 I    /*check the type of pickaisle.induct(i), for your last problem.*/
( e4 y( ^' ^+ z1 j6 L& j( K% N
+ M8 D: l4 r0 i+ J3 e    while A_i<=30 do begin
3 H7 }. t. T( n% k9 q3 a6 ~        travel to pickaisle.con(A_i): }* o1 q4 @% z  J. m/ n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 A. X6 C2 u' W9 c  u7 T        else wait for 10 sec
2 C) Y( i8 |1 r2 c        if A_i=A_leave then send to die
5 e8 J* N. c$ [+ P3 Q$ g4 H        else inc A_i by 1; ]) J; E8 |8 Q+ \6 K( F" v  L
    end
2 L- \2 [8 @/ \& W+ {end4 _4 Q0 J7 U" p: ?1 [
. S6 m' y& c; P1 x
其中的procindex为整形,代表当前process的序号。
! m4 a/ W6 U6 W5 F( jstation和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-26 15:44 , Processed in 0.017593 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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