设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12953|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 o, t% W; ~# D/ p) `
! j( t4 k: a6 t我的问题是,在每个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中的数值,不知道会不会有什么不妥。
: F; E# n4 b& d# J3 ]9 F8 |% K, q* @5 o
begin P_read arriving
. H; t7 |4 D2 e; `# [1 ~2 E    while 1=1 do begin
1 Z; D- ^) h- B- X: _/ Q        read A_tote from "data.txt" with delimiter "\n"
4 ]& ?: c+ G1 W        read A_time from "data.txt" with delimiter "\n"
8 P9 i4 h' k2 A) Q# E" u        read A_leave from "data.txt" with delimiter "\n"
! [* t) X- p! X0 k. ?- H7 d$ C        read A_picks from "data.txt" with delimiter "\n"
9 M9 y  u! B" k8 c8 T! A1 ]  t        set load type to A_tote1 Z+ E  R# v" |# T+ X$ H
        if A_tote="tote 1" then set A_induct to 1
" f( i# Y: G5 S) ^$ o        else if A_tote="tote 2" then set A_induct to 2
. f; Z2 n) ^4 d& ~  G5 h5 d            else set A_induct to 3   
2 |$ N! {* Q+ \4 Z; ~( a, ^2 }        set A_i to 0" U2 r4 s& J" s# Y# Z
        clone 1 load to P_induction
' f, r$ Q7 G: `3 `" R) n        wait for A_time sec
" R. \8 z. x$ \    end
2 {- D8 _# l& D( c6 }8 gend
; o( L- d$ f+ o. Z' Y
; p5 [4 V* h- n) `! Gbegin P_induction arriving
4 `8 P& B' S9 q, I5 R    if A_induct=1 then clone 1 load to P_pick1
) x2 ]$ x) @4 {* S+ s% K2 @    else if A_induct=2 then clone 1 load to P_pick2
' Y1 A# E0 i* A7 @. |  ]7 ?        else clone 1 load to P_pick3
0 b1 p- D; f' T! r& `end( F# E" [  c4 G- R, J0 r3 S

! |2 _# l  S1 A. L( w6 I) X6 Zbegin P_pick1 arriving
' ~% A# Y: e& R. V# @  j) f% o    set A_i to 19 `# R. w, Y) g) g( n  O& r( s
    move into Q_induct1
9 s) g* G8 J; j! C) C' e    move into pickaisle.induct1& f7 v$ B  {5 ?  \$ c
    while A_i<=30 do begin
1 _8 r: j) ]: |& j: c+ e        travel to pickaisle.con(A_i)+ ?" H- B& X, C, _/ i1 E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% R4 g3 O! T% h$ d1 P8 l, h        else wait for 10 sec1 B7 N+ h1 ^) G2 O3 U" I
        if A_i=A_leave then send to die. i/ c4 Z0 Y( x
        else inc A_i by 1) Q; b3 F4 s8 E" [7 x8 |% \
    end
; _8 X6 q7 F; A: F" a; l1 g, |end
# `/ [. N0 L$ D% x8 _
1 F+ @: U% O. x. X% g8 `begin P_pick2 arriving
9 c# b* D% `/ }7 T    set A_i to 11
  p2 C( d9 n3 K. ^& V    move into Q_induct2
/ ?1 x$ D/ H. X- Y  X5 Q    move into pickaisle.induct2
+ \, F2 I$ B' {- w  a- L! @    while A_i<=30 do begin
* Y( `4 J: {" ~7 Q: d2 T        travel to pickaisle.con(A_i)
( s# Y4 \( B% C2 u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 |+ @# j% b5 o6 T5 q; O' N1 d! a        else wait for 10 sec
0 ~' |, [" u0 D. {- P7 I        if A_i=A_leave then send to die& V1 w9 T- b/ B' z8 v" _- [
        else inc A_i by 1
3 A1 V, C1 n8 R: j0 L. E    end
1 J6 x2 @. r/ [5 f9 O5 Hend
7 ?8 g' R. x# ?, z/ |7 q0 }% v' c. R
begin P_pick3 arriving
' [, u% L8 e+ R6 c% B) t  e    set A_i to 21
7 a/ w. ^' e: Y    move into Q_induct3+ V  R- }! j! ^' d* N( p. s
    move into pickaisle.induct3' H' z# S( K* }! A; |+ F
    while A_i<=30 do begin3 W$ `, F$ z. I1 _
        travel to pickaisle.con(A_i)7 f/ E7 a* q  v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 A* N! s  a( h7 D4 W
        else wait for 10 sec% q: D3 b5 c+ O# V
        if A_i=A_leave then send to die) }, r% z* c& j9 @- r6 e
        else inc A_i by 1( B3 M3 V+ T8 C" M  E
    end
/ g- u( }2 [" S3 h2 uend

最佳答案

查看完整内容

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是个什么东东?
" p7 c' K5 f( S$ Q8 L0 Wmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?+ A0 H+ P% l' s5 t; z2 u# q
2 }  \; d3 |2 U4 w3 y% ]3 d
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。8 a( R$ z) u' `: N

; Q$ A6 `/ o; @, H% }8 R另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! m2 p3 s, _# Z8 K1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;  i4 ]' V7 E$ {
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" x  e% W- Q& Z0 T% |
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:  l6 f* I) Q) r2 B4 b6 O% Y
begin P_induction arriving8 r7 v& \+ Y" o+ C
    clone 1 load to P_pick(A_induct)
4 @  q5 U5 K: n+ D( H# R  r; _+ fend最大的系- G; F3 F9 e/ d5 p' D7 D% \" T

: x( r- p6 T' d* H+ K1 C. Ybegin P_pick arriving
$ Z( l" a, q: ~3 v% w; Z* h    set A_i to procindex * 10 + 1
  O8 A8 q* X$ @7 }8 N( b    move into Q_induct(procindex)# v6 E/ G- ?  \4 ^. p: g% v. w; k
    move into pickaisle.induct(procindex)
1 \9 ~/ b  W! G    /*check the type of pickaisle.induct(i), for your last problem.*/' I. ?! F  j+ r2 [7 z% p! J
: g8 |2 Z+ Y2 h0 s
    while A_i<=30 do begin2 H8 b- o, R2 P$ R; z/ Z( |
        travel to pickaisle.con(A_i)- p  @0 d/ D* X' i& L- Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 L6 S; _; y, B        else wait for 10 sec( t3 D# N0 t2 p5 k- r& \
        if A_i=A_leave then send to die
0 ^% F9 `! ?  h2 K0 \* U3 N" P        else inc A_i by 18 x. V. N; h# {3 b2 \  w  g
    end: P& Z6 m# n; y" k3 m3 b: {$ }7 d
end
" l) D& q% A) l3 A% _/ r+ o' y( B
7 d! J. x1 K6 D0 U) g其中的procindex为整形,代表当前process的序号。
) J$ e6 E8 J# \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-3-5 11:21 , Processed in 0.020757 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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