设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15095|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, x" a  E) D2 q  K9 V% n
, H; \: [+ R* r: x" [, m' V/ X0 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中的数值,不知道会不会有什么不妥。
* V! v) j/ P# F7 Z) _7 g1 `6 J
' Z% Z/ @7 [% R; zbegin P_read arriving
( \! A6 z! Y- Q7 F6 `! R1 a5 `    while 1=1 do begin
, c1 \5 n: P% W& p) r; Y- S        read A_tote from "data.txt" with delimiter "\n"
7 u) B$ x6 |* |* D        read A_time from "data.txt" with delimiter "\n"# c+ u5 b* W- }# K
        read A_leave from "data.txt" with delimiter "\n"
8 f' \5 _! W2 |3 {        read A_picks from "data.txt" with delimiter "\n"4 B2 O9 n% N9 F7 ~) K7 a
        set load type to A_tote- h" }: V4 u5 I( z' P
        if A_tote="tote 1" then set A_induct to 1
0 D7 y& C7 n5 f6 Q. Y! f5 n/ x4 k        else if A_tote="tote 2" then set A_induct to 2
/ E# x6 H5 a7 q' a9 S7 G- x            else set A_induct to 3   
2 P* c( }+ M/ L2 G3 F4 E        set A_i to 0
8 |/ F3 |9 j& W. x9 `3 J- {        clone 1 load to P_induction
* Q- F2 a2 W$ K0 x# x        wait for A_time sec9 ]8 {0 f" k& u/ i  e% r. w
    end, b7 F! R3 s/ V( F8 _5 {
end% r$ h- j2 @% B! j$ _
' }5 [- C3 M! _- I. N' `- @
begin P_induction arriving
7 }; ^. m6 w* U1 U4 s    if A_induct=1 then clone 1 load to P_pick1
  m  I2 k  U2 _6 S& W4 Z    else if A_induct=2 then clone 1 load to P_pick2! f" q/ L& v9 d/ J- w
        else clone 1 load to P_pick3
$ ~0 {4 v% |# _2 g, H! ]: q+ ^) \end
$ {' i4 o  U$ L$ u  d( d; R# a7 v: U* P2 a- @/ W+ R7 D* J
begin P_pick1 arriving
2 N8 n, `3 W0 W    set A_i to 1
/ d# v. |" p+ k! I7 n) e. F    move into Q_induct1
+ |/ g8 |( \' H$ p0 m4 p    move into pickaisle.induct1
9 U3 M4 P" c( D2 R5 B7 P! W    while A_i<=30 do begin
2 x/ d/ V' x& P. N% T+ w$ w% S& ?        travel to pickaisle.con(A_i)/ Y' B& D9 x; h. T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% k3 [- p+ p/ A% t6 k2 |5 I3 ?( ?        else wait for 10 sec
0 A, H" ?% s+ U( }9 Y* {        if A_i=A_leave then send to die
, u" E/ u9 \# w* r! b  f$ ^8 z4 v        else inc A_i by 15 c) f) j# [/ e. h, b" k4 k. h
    end
2 Q' e; n3 u# J# G8 N9 Nend1 C. {8 D8 v# v# j- |9 t
6 v0 D  C. d# `+ d" _; U0 `# ~
begin P_pick2 arriving
, N7 X* ]; d  @4 ^    set A_i to 113 Q6 R. X) @5 B; x8 H
    move into Q_induct2- k; c3 J4 m" |+ ^" |
    move into pickaisle.induct2
3 M$ E* V* W2 ?/ c! M    while A_i<=30 do begin( T" t4 f$ \6 w8 w  J" C0 l* C
        travel to pickaisle.con(A_i)
2 \4 u1 U) f4 s% A/ i- ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 M# u; r2 H% t. _# |8 ^0 R  e) Y1 Z
        else wait for 10 sec
3 ^/ R) m( G! p        if A_i=A_leave then send to die
. ^- b3 L) d) b) S5 `; W        else inc A_i by 18 I' ^9 w' l7 z2 \
    end
/ {1 l/ Z, q& kend" P0 y; ?( g  z9 {
/ X7 ^0 O- {% D
begin P_pick3 arriving4 B' L6 P% t/ h
    set A_i to 21' I% X# e- y: w
    move into Q_induct38 h$ `# }3 A' B3 T1 i% H6 c
    move into pickaisle.induct3, ]2 o, ^0 R' \  y6 N7 |
    while A_i<=30 do begin  I) E3 ^0 X- X, v0 X
        travel to pickaisle.con(A_i)
3 u: l3 |/ L9 i* W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" D8 j; }5 q- O/ W$ {1 z. u+ Z        else wait for 10 sec
! y7 r$ }- q( S# D% g        if A_i=A_leave then send to die
% e% ?) q, s3 x* M5 U        else inc A_i by 12 P: v( f* l# {+ y
    end
+ a; f1 P! B3 H7 Y: x! A' Eend

最佳答案

查看完整内容

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是个什么东东?  X+ h+ a. L- M/ n: r. _; v, O
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, x0 K) R: {0 D6 t9 U9 B3 K) m$ a6 C' q7 i3 L% I
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
: }/ `/ ]8 o- G/ y% i
4 }: m3 z2 a4 _4 E另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:" ~9 r5 D  \5 e6 s* z
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;7 o5 P1 u- @; p: p7 K3 C2 s3 E
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;  w4 J+ V: l+ @
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. [6 x& |, ~7 h
begin P_induction arriving" B, I$ I5 k7 ~. }/ I  V3 S# ^
    clone 1 load to P_pick(A_induct)' }  c# i8 o! ^4 K' p
end最大的系* @; x; O9 j, ?" J% ?# w- _

3 Q" s, g( J& Rbegin P_pick arriving$ J4 k: A6 R$ n* j" K+ v
    set A_i to procindex * 10 + 1
8 K0 i9 d% T5 P3 b7 h    move into Q_induct(procindex)
- A5 F$ G- ?0 U- l$ F    move into pickaisle.induct(procindex), v: K8 P+ u  h& ?% A
    /*check the type of pickaisle.induct(i), for your last problem.*/
* R- G" E. L) h1 }1 d+ r1 F4 g- K3 M6 G- ?9 @/ `* B5 S# D
    while A_i<=30 do begin
2 L* A9 F+ }) C* H        travel to pickaisle.con(A_i)
6 L6 S$ e* G. U5 P% V, j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) ^* f5 M- G' h! [* c        else wait for 10 sec
5 t2 f5 f  j' Q/ k6 C- \5 T        if A_i=A_leave then send to die
* S9 s& `8 I4 K) U! j        else inc A_i by 1. D4 ]1 D; q& c: O& X# m/ P
    end
0 j- e  r- v, D1 B- F  d0 X: P+ xend" W, c3 u* \) K2 a
$ @2 u1 W" S, R
其中的procindex为整形,代表当前process的序号。
& v5 @3 C' T5 y0 m6 J/ h' [, ?+ |0 }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-8-10 03:36 , Processed in 0.017433 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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