设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13898|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 J5 }: n& q' m, y. c- `

* f, V3 A$ M- l0 ]我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ e" U( Z* ^6 v* r0 [9 q, a

( i' R, A3 P1 V* ?( ~: {( Y6 d% I, Obegin P_read arriving: T+ J' R$ m1 }6 K
    while 1=1 do begin
. j8 }1 q  o( C8 u0 C2 j5 G        read A_tote from "data.txt" with delimiter "\n"
2 I: F: b  t- a% B9 ?        read A_time from "data.txt" with delimiter "\n"9 X( `7 j" v1 R# F+ o$ w- f
        read A_leave from "data.txt" with delimiter "\n". e$ O/ f; M6 s4 y/ f
        read A_picks from "data.txt" with delimiter "\n"0 C" G" m1 i% f% t% \, ]
        set load type to A_tote3 C, l  N# M" m! i) t. P2 R. }# ]
        if A_tote="tote 1" then set A_induct to 1: h% F* r* ?4 \2 E
        else if A_tote="tote 2" then set A_induct to 2& P% z* c% R: e& Z
            else set A_induct to 3   
) [  \6 M- x/ x  x        set A_i to 0' [( _4 K! s/ L* N* G; J2 o
        clone 1 load to P_induction
" V( {6 I, T' T; r& V) {        wait for A_time sec
  C0 A( e: o. z9 Q( W, K4 A    end
" t( g# z. T( mend
, L  w! t9 `$ w" O
% t. a. p7 E9 f: C$ H4 qbegin P_induction arriving
* U1 f' V/ p6 @" g  h! B2 @    if A_induct=1 then clone 1 load to P_pick1
, {3 s: g/ l3 A2 e  G- K    else if A_induct=2 then clone 1 load to P_pick2
* o* ~9 `6 l( f! W1 J' B        else clone 1 load to P_pick3. R- A# N' e* }4 X& B) ^6 ]2 J/ k
end
" {0 w! J5 ?. X' F, `# T5 K3 v9 r6 M& P
begin P_pick1 arriving
$ [" J. \; Q, v    set A_i to 1; q# q" @% K/ r5 C# i' `2 I8 D
    move into Q_induct1
& _: W4 O  h' {( ?  |5 j4 f    move into pickaisle.induct1
5 \# W3 N% H% k% c1 e    while A_i<=30 do begin
6 `& k9 _8 L: t& q8 d2 m$ r& f4 N  Q        travel to pickaisle.con(A_i)" o5 a6 l# I: Y4 j# W: W2 P* t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) x# P3 T7 P9 X4 j' ~4 |8 X4 m        else wait for 10 sec. b: B! X7 h& q( @7 G
        if A_i=A_leave then send to die
8 r8 @" P/ ]" P3 V5 a6 m. s/ ^        else inc A_i by 1+ Z' S, Q$ S; h" h* U$ o' G7 d
    end
* A1 Q; x% x+ A. r7 ?- K  xend5 f  E! k# p( x: x
3 b6 ~- u6 A7 L1 I
begin P_pick2 arriving
4 v5 G' I5 i  q$ U    set A_i to 11  o  }: W5 {3 T2 a: h/ b
    move into Q_induct26 ^3 z! }7 w, J8 \/ o
    move into pickaisle.induct2
% X/ Q/ r0 K! n3 w( e5 o7 B" u) f& t) J    while A_i<=30 do begin
" y' x1 M0 T. K0 ?        travel to pickaisle.con(A_i)
* K3 Y6 V! @3 O, p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 U8 k) ]* v, D, N
        else wait for 10 sec( r% V4 n$ f; O# x; |
        if A_i=A_leave then send to die6 I, \8 X) H& P" n2 O) D3 a
        else inc A_i by 1
2 J3 _2 i- E( `" J) [+ z5 w    end7 S0 l9 }. T2 s; e+ L! Y
end" f% h+ ]/ Q7 m! \

" F2 i9 z( b1 o/ I( e* g6 vbegin P_pick3 arriving! l9 H; }" W# x$ a+ R. z* O
    set A_i to 219 H2 m) U, s# c7 @
    move into Q_induct35 E" _! K! ~) h0 r$ b
    move into pickaisle.induct3$ z& y, {) s. W7 i. O' z
    while A_i<=30 do begin
8 k- j# C9 ]1 t& V) t        travel to pickaisle.con(A_i)
* _) E& U! u' P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 ~" I. ~# Q; ^6 Q4 J5 ~) E
        else wait for 10 sec* F2 k1 f1 a9 J) U  Y1 q
        if A_i=A_leave then send to die
8 G3 I+ u+ q1 |% {) A( u# J9 U# J        else inc A_i by 1& C* |) {' ^$ ?3 p  o8 ^6 M
    end! U9 y  T1 ]$ y$ O6 r
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是个什么东东?
5 t/ f$ q  O( n; M" Xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
5 y5 a6 b, i% F& A3 v, A2 @# K! D4 ~) T: o9 v' w* N% S, L
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 d' e6 }& W2 b! Y  f) y: m+ X) q% S2 ?4 c$ E
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:( E9 u, ?# E& E/ i
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
- Y! K0 b# [& V; Z+ }. g2 [2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) P9 u# L. W+ p* x1 f- Y
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ |8 s* u% f+ x- I. s3 fbegin P_induction arriving  d( A' i9 [7 Y. y
    clone 1 load to P_pick(A_induct)% R# x  {6 ^+ d$ k
end最大的系
* a% [- ?7 J* c8 w2 }5 R4 U9 Z% I+ ~! S! `5 G1 C& X5 y  m: Q1 z
begin P_pick arriving) W1 y# k+ k: O  F- m
    set A_i to procindex * 10 + 1% A! e. G/ T" v+ ]# G0 i: p
    move into Q_induct(procindex)1 G- Y% e6 J( ^" I: o, Q7 w0 Y
    move into pickaisle.induct(procindex)
( j$ {9 h) z/ Q: ?2 m* L    /*check the type of pickaisle.induct(i), for your last problem.*/7 H; J3 ~+ N5 L6 z4 a1 D

6 F$ \1 F" b' q    while A_i<=30 do begin# L' P& @, ^! e, E' E2 p- I
        travel to pickaisle.con(A_i)
7 S7 D& j& @; i0 R" F7 K7 \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ v: }: }; N, d2 \6 I        else wait for 10 sec+ D: l3 [4 {3 U3 c
        if A_i=A_leave then send to die
( i  [* A( S% M. `3 `: x        else inc A_i by 1
% L: v+ g* @+ E" e0 V) S% T    end& u  L% s* g+ O0 @0 F/ n4 `  h7 x0 \
end
  i; m8 O3 J. H) O$ l( m( N
; i  E9 U3 |/ g# X* R  _6 B  E其中的procindex为整形,代表当前process的序号。
2 ~4 Z) _& x% @* k" L3 ostation和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-16 15:12 , Processed in 0.018729 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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