设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11905|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# X$ ?5 K0 H3 ^4 H0 b4 j
- E+ ^. H" _; X. 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中的数值,不知道会不会有什么不妥。- Q. E1 X4 |+ }6 h2 }# L3 O

/ P# ~. G$ U' obegin P_read arriving9 q; k4 F, T& f6 H! |
    while 1=1 do begin4 d" o7 v+ _5 ~1 }! x7 Z
        read A_tote from "data.txt" with delimiter "\n"
% d" I) n6 }9 s/ b- v; i& S        read A_time from "data.txt" with delimiter "\n", I0 D; c8 Y. |' E, a( W
        read A_leave from "data.txt" with delimiter "\n"
! |) z$ K% [' N6 o- @4 ~. Q7 A) _" w        read A_picks from "data.txt" with delimiter "\n"- m/ d* V. v# R0 U1 N( W
        set load type to A_tote
* V% n; U" S1 w        if A_tote="tote 1" then set A_induct to 1
* h! a! j9 ?, T/ C. e$ X8 f5 E        else if A_tote="tote 2" then set A_induct to 2! `  T; e  a  N4 f( p
            else set A_induct to 3    2 \& a0 `$ y& \- T9 L) i9 C3 O" D6 [
        set A_i to 0% d: u- Z) ]+ g
        clone 1 load to P_induction
: D4 Z% L% f4 W! o$ ~# ?9 g# A, b        wait for A_time sec
. m1 ~0 Q' B2 P4 v( \3 z, j    end
% i& ]- E; A$ o, E% C4 }, |end: t5 P, ^: Q9 _6 x6 B# V, b( E
7 S1 v" Y. A/ w
begin P_induction arriving6 h1 o* {8 C, @( @  b7 q' n
    if A_induct=1 then clone 1 load to P_pick1
! _( E3 S9 O1 _+ x$ O    else if A_induct=2 then clone 1 load to P_pick27 O9 s' T* F9 l4 T9 I* b8 M1 \
        else clone 1 load to P_pick3
% _4 S4 q% X! G8 Z9 i, w" Y: cend+ a# @9 Y2 `# V* y" u

( ~6 {; ]. Z9 R7 [begin P_pick1 arriving
* x( T/ X9 G( `    set A_i to 1* s2 j5 C& r% l3 q( S+ u
    move into Q_induct1( b" `' @4 d- j# x
    move into pickaisle.induct1" s! e, C) P) c( H7 w) h' y
    while A_i<=30 do begin
. h; J7 [! u& r3 y  {; ^        travel to pickaisle.con(A_i)- v" {- p2 m5 S% B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 F9 e0 ?1 Z/ m$ I8 I: N        else wait for 10 sec
3 o8 Q0 |9 a% B. X        if A_i=A_leave then send to die/ G' f3 @( ^; {! b! v3 t  D* C
        else inc A_i by 1
' B- W8 i$ `9 @; i1 @: e    end
4 u: r* N" M/ Eend9 W* X/ P' r, W1 {  `
" }" V# t9 |; s# E0 U* e) P
begin P_pick2 arriving$ }) e3 Z3 L" p, x
    set A_i to 11/ R( a8 U0 b7 L8 x
    move into Q_induct2; q$ n+ {' D( ]: q: j0 T% F, N- Y
    move into pickaisle.induct2& G  ]2 Y' Q+ v: I6 p& ~  [7 {/ k
    while A_i<=30 do begin
) f; L4 |( e( S* l+ r; ]  n        travel to pickaisle.con(A_i)
' v2 T/ O0 S: y% ~1 X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' v7 ^# c: ?7 w! Z' _        else wait for 10 sec
( T: }' d4 y9 ~# J/ u' R' X        if A_i=A_leave then send to die
4 s. x& i8 p6 E8 g- a        else inc A_i by 1
' f; i: i. E" P    end3 o; r+ d. ]6 ]/ d, m
end4 F# l6 R1 J; W& w  G
- F$ K" u7 ^$ r8 H; L
begin P_pick3 arriving
, A* P8 g' n- x9 c1 o% ~    set A_i to 21
; D/ y. x/ b0 S3 ?4 z' t    move into Q_induct3
. V. \1 L/ q3 `8 s$ j! Q    move into pickaisle.induct37 G( j' G3 s2 I6 `- \8 \! |/ v
    while A_i<=30 do begin
4 J7 U) @4 ^" |" y2 m' B$ [$ |) o        travel to pickaisle.con(A_i)
7 G* Z# N7 P9 y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ ]4 t2 c9 x6 _! ^4 u7 |: R" `* @6 y        else wait for 10 sec
+ v5 V- `# Q) N8 Y        if A_i=A_leave then send to die
/ y7 P5 u6 o0 i" O        else inc A_i by 1
& y3 t& G$ ~8 r% f    end
" N# H/ X- T* w, G. s2 W+ Wend

最佳答案

查看完整内容

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 n* M7 ?- Y5 F; d. |) l
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?1 o0 F& n' \( t* b8 N
- x% o6 E3 e- Q; ^5 l. N! b. P
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 a" S* f6 W7 y! B/ N  g. U! I
7 G7 G# O, R$ ?" _# o  L/ u( L6 K* L
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 _( U0 S4 W$ P
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
9 x& R) \1 j; P2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
2 N; k9 U. _2 ~; p3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
6 ?5 `8 u# @& w  \. Nbegin P_induction arriving
& V+ n3 X6 N5 ^0 H. |2 H* e    clone 1 load to P_pick(A_induct); N2 W1 A' F( r/ a8 q4 Q! f: ]
end最大的系* u; Y: `" h9 f. I' B" v2 G9 y& ~

3 q( S. j5 ~( Y2 C, D# f: Zbegin P_pick arriving
* ^! ~! L2 c) V  P8 `. A6 b0 G* c    set A_i to procindex * 10 + 1
# A0 |1 i' C, B8 \, y    move into Q_induct(procindex)
4 F& Q% s( T3 q$ M6 C/ ^6 [; [    move into pickaisle.induct(procindex)
3 J) }/ \% r4 h* r! z. f- O    /*check the type of pickaisle.induct(i), for your last problem.*/
) G' q2 Z$ e' D; g4 `" E: m
( x5 T; N$ f: w! M    while A_i<=30 do begin9 f& C5 I6 v6 x
        travel to pickaisle.con(A_i)
4 C1 M. s# a3 Z. {( Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( P2 Z( M5 u) K, _( l% v
        else wait for 10 sec
: h9 a8 ~" |" ^9 u8 m2 U        if A_i=A_leave then send to die! A! _/ l# r2 y( \+ s& t# a
        else inc A_i by 1$ n1 b  ]  b: _
    end6 q. H$ {" E6 i
end' Y2 q; u" L  x
% D" W: j9 j  M, b$ k4 {
其中的procindex为整形,代表当前process的序号。
* r% r' I" w$ r- W8 ~7 \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, 2025-12-14 08:00 , Processed in 0.014552 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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