设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15125|回复: 2

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

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

: D9 D. c5 A/ _" G4 u: M我的问题是,在每个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 _8 c9 ], o
* B' L) O' Z9 K. }
begin P_read arriving4 p1 b8 a: Z- f' C6 E# i8 V
    while 1=1 do begin
, k9 P+ k) S' E" r' D8 w        read A_tote from "data.txt" with delimiter "\n"2 O4 [8 c0 L' R& b
        read A_time from "data.txt" with delimiter "\n"
% \8 N; Z/ |7 @        read A_leave from "data.txt" with delimiter "\n"5 i: T* o0 f2 d6 [
        read A_picks from "data.txt" with delimiter "\n"
! H' F+ s1 V# g! @6 y        set load type to A_tote. w3 f2 G5 P; x  z' I& ]1 d% s
        if A_tote="tote 1" then set A_induct to 1
  v! \5 E7 {" R        else if A_tote="tote 2" then set A_induct to 2
5 Y$ x  \4 G5 \7 ~/ c            else set A_induct to 3   
' E- ], a( Y7 X9 ~9 [        set A_i to 06 M& ^/ v5 v( ~
        clone 1 load to P_induction5 W! y4 e/ [: o% H6 X7 I; c( o
        wait for A_time sec
  l. H! V0 T3 Q% o( f9 Q    end' K) w" A- T. Z0 P
end$ G; G/ r5 j4 {! F
6 D7 }4 r) J4 N7 X& A; }' |
begin P_induction arriving
8 u) @9 F9 v: o+ ^2 L    if A_induct=1 then clone 1 load to P_pick1
; |, u& r4 F. I0 M6 W9 z* `: d, _    else if A_induct=2 then clone 1 load to P_pick26 o% {2 F' U( T- J3 e
        else clone 1 load to P_pick39 f' D. z6 h7 w& r& L
end' a2 \0 J* Q" U3 N! ~

1 D- L  Y& I/ t/ dbegin P_pick1 arriving3 s, B! ~$ P  M; G: _3 y8 L
    set A_i to 12 n" ~, l0 c. L  l' F9 K6 \: G: q
    move into Q_induct17 b2 m' A' A3 N; ]/ R: x
    move into pickaisle.induct1
; [% \8 l0 M4 A" Z6 E' W, X8 G    while A_i<=30 do begin
+ e( K* a) k$ _4 {2 |. r        travel to pickaisle.con(A_i)
, c" _. Q& o) H; J! a) p4 E+ c# n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ e' Z. s  E% k$ ^1 |& f        else wait for 10 sec! Y  }5 s0 Q: F: }& Z
        if A_i=A_leave then send to die
. U" b1 W& `& n2 W! B1 O        else inc A_i by 1
0 Q1 A. `, h' u/ J, l: n    end1 Z; m0 A& M& C$ [9 E- P" s& J
end5 A5 K2 C4 K2 a0 B2 `

* g$ V: W# @! V1 e/ \: v+ vbegin P_pick2 arriving" M, L- d. T& \6 ~; M% B
    set A_i to 11
0 ?- F# t, J& u4 W* M    move into Q_induct2% [: _( q. f7 v$ V9 N
    move into pickaisle.induct2
3 q+ g* }) p& o9 g7 X% F* t    while A_i<=30 do begin( W+ [6 L, o7 }5 B) H
        travel to pickaisle.con(A_i)( Q! D$ i; D% x2 R4 l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  _5 {. R' m& v( k) `        else wait for 10 sec( X" r/ K; |3 m# x' n+ a
        if A_i=A_leave then send to die5 _4 w  O. J% V4 a
        else inc A_i by 1* g* L; Q- {5 _0 ], x( M
    end0 n& T* ~; e4 C% h2 G
end
* F# _8 f1 o3 Y& Z5 E. b: b0 {& }! A( [5 f7 c
begin P_pick3 arriving. J# c, e: m+ U% h0 F3 }: `- M1 \1 @
    set A_i to 21( C% u9 j2 l4 h0 O
    move into Q_induct3
1 e: O8 I5 w! t    move into pickaisle.induct3
  }8 e% |- h# w* Q$ C    while A_i<=30 do begin# ~$ a' |2 O0 v: ?
        travel to pickaisle.con(A_i)
7 S$ {  M" ^( L. g4 D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" G1 j0 H5 v- U- Y
        else wait for 10 sec3 @, ~7 ^$ X3 H8 _1 T9 |( y9 _' H
        if A_i=A_leave then send to die1 M- x' ~# W- N2 D/ y0 A4 @& j
        else inc A_i by 13 R! o) z8 u2 F% _
    end& s8 d* i# S! s, Z3 ~: D) T, H& D" M
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是个什么东东?
( z9 h- V  Q8 @2 R3 R0 Emove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! i0 T/ Z$ h: Y+ A
+ h/ S. K" ?; W  NAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. e' S$ H- w+ g) a) _, h# @
5 H0 D3 n  F" g4 M
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  {7 A8 N' r" T) G$ P4 B: W$ d) o1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;6 c2 g7 S6 Q) Y7 E! [, @$ z
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! q" r5 y( k% c. S2 r
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
" Z# K+ Y+ B2 N8 Nbegin P_induction arriving; A* A( I+ q8 f: {4 ~
    clone 1 load to P_pick(A_induct)
, e3 [6 L9 h3 Q, i/ v& a! Oend最大的系
. f4 w# i9 O- H, w. c' S9 l3 v7 _/ J7 G+ n- Y
begin P_pick arriving
0 {# t: i1 D- Z6 R% }. y" Q" `    set A_i to procindex * 10 + 1, x/ O) p# A2 ]3 }2 x0 j
    move into Q_induct(procindex). j6 R& {* S  {) ^6 t1 \6 M9 z
    move into pickaisle.induct(procindex)" w0 u. _0 X( ~- I
    /*check the type of pickaisle.induct(i), for your last problem.*/3 ~& v" M% o3 N6 N" P8 z/ o4 N7 N8 d

2 g# ^: B0 {$ s) t    while A_i<=30 do begin
' I. Y, N4 {* t8 G( b  k. D/ T! h        travel to pickaisle.con(A_i)
/ @* O. c$ Y0 `, g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 }, \: N) u" ?        else wait for 10 sec
! B* t$ g" O/ h, F  L, G- r        if A_i=A_leave then send to die7 r- B1 E2 `; W3 O
        else inc A_i by 1$ p' c* U0 Y# {" {3 F$ }! \9 \
    end
6 O  U7 f8 C% R1 y4 @& t' Kend" x8 i3 o; ]6 ?. g
- \: g* Z! V% x# W0 _/ v. K
其中的procindex为整形,代表当前process的序号。
5 `6 v% g! R7 [& Pstation和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-12 16:43 , Processed in 0.015307 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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