设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14987|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: R% \$ f$ v" M3 C$ Y
, D/ |! p7 s- y4 ?" {! I我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 ~" I% R- Z1 }" O; m
; q/ K4 B4 F) D) Rbegin P_read arriving
; n. [3 |+ p/ r  E& ~    while 1=1 do begin9 z, t3 g9 P% ~( g% ~
        read A_tote from "data.txt" with delimiter "\n") s: P& G) H- G8 U& C3 Z5 E
        read A_time from "data.txt" with delimiter "\n"! a8 d9 v( J. u8 F
        read A_leave from "data.txt" with delimiter "\n"
% }5 K; b5 D/ N  {9 A4 x) W        read A_picks from "data.txt" with delimiter "\n"
: B/ `9 }+ A/ g* u% B% c        set load type to A_tote. ?+ v7 X, Q# X
        if A_tote="tote 1" then set A_induct to 1
+ H+ t% n8 v' d/ k        else if A_tote="tote 2" then set A_induct to 28 S& q/ C8 d1 x
            else set A_induct to 3   
! p: j' ?8 C1 O& `* B0 g        set A_i to 07 J" g$ [' n; D& E1 Y- `, c# `7 w1 W
        clone 1 load to P_induction+ z" }7 v% t+ X' r
        wait for A_time sec
2 H1 G3 p$ K. h4 T8 R    end
! I/ H5 L, J4 [3 [end
3 n/ j: d2 m/ K( u8 y2 l, I/ f9 X$ h  {5 a, W2 C5 G: K
begin P_induction arriving8 S% e8 t3 U+ p
    if A_induct=1 then clone 1 load to P_pick1/ H/ Z) M! x. i2 {6 R9 c0 v
    else if A_induct=2 then clone 1 load to P_pick2
! ^; r1 {; |/ U6 Q4 [, |* Q        else clone 1 load to P_pick31 o! t& z# q( T. b0 P' _9 T
end# J9 j% b- S3 B  a/ `* L
6 W  v6 M/ {# O; _7 ^# Y
begin P_pick1 arriving+ J& t: Z  E3 a- I0 B1 _3 N
    set A_i to 1* `& X( J& d3 E* A) E6 Q1 g
    move into Q_induct1
6 h8 F/ ]2 y/ }8 J    move into pickaisle.induct1
* v# \! u3 l: `/ d7 j    while A_i<=30 do begin3 t' f0 Q& N% r& k2 I' P. x
        travel to pickaisle.con(A_i)
1 Z( X- E8 y9 u$ c4 X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 A0 U$ Y* `1 b" t0 Q6 m        else wait for 10 sec
+ {+ r" e( c8 n4 }( h9 D        if A_i=A_leave then send to die
8 J9 `/ ^" S0 D; G1 n- N        else inc A_i by 18 E  d4 S1 Z; |) J( G$ \
    end) o+ g& l' Y8 c1 z; @" K& L
end
2 l8 T/ E1 L9 j; T/ G5 i5 K3 `0 N. Y3 @
begin P_pick2 arriving/ @1 x. }3 S8 V# S, S, w
    set A_i to 11$ m6 G! \. H5 l
    move into Q_induct2
- l! h+ D! s, ?7 {! |; j    move into pickaisle.induct2
+ D( |. G% ?9 |7 m    while A_i<=30 do begin
% V/ R# Q: O) A( ]* @0 ^5 I        travel to pickaisle.con(A_i)
  M! X) ~4 J/ a; A: F' I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 T2 q6 t0 v* \) i9 a7 i5 v1 Y% B5 q: |
        else wait for 10 sec/ G0 Y2 l4 P: X" J
        if A_i=A_leave then send to die
9 A6 i+ J; o) }- c: p3 `+ a        else inc A_i by 1
6 q3 [) s0 a4 Y  w9 D: F* V    end
! E. e. B( ?! w% b" T* e& V) hend, a) O! r" Y" w( r( S
2 {+ D7 k  S: y; _* @
begin P_pick3 arriving) z  J7 o1 L1 i& w" o
    set A_i to 21
# \: B0 B7 D: }) V. E/ L    move into Q_induct3. N( |: ]* H' ~( s- n9 U5 N$ `" P
    move into pickaisle.induct3+ ]  D! R1 y+ M5 J! B3 Y
    while A_i<=30 do begin9 d8 q( Q, G- ~
        travel to pickaisle.con(A_i)4 e7 }# \( c  d2 `# b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ K$ ~' R* r/ l) ]+ u+ `7 m        else wait for 10 sec
! A+ L+ R" ], g: A  s9 ]2 o* q9 m: }        if A_i=A_leave then send to die3 l1 S7 H4 z, u" ?
        else inc A_i by 1/ @7 v$ o: a) o! h6 q, u! A: h
    end9 i! ?! `( P  ^1 e, V2 a6 i
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是个什么东东?
' z! I, m0 e, o& H) S/ R& }move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?% T! r0 {: I- E: B+ p/ ]

/ g5 f5 D8 l0 U' |AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 v4 z9 E- L( T: r

6 Q$ g# Z3 o2 M- ^另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
0 I) h7 q/ o9 C8 t) ^: @( C1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;0 l1 E: i3 P4 a' @0 l
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;7 K2 a, a7 E4 X' D7 U
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 Y# [7 W. N5 `1 [8 P* {6 L) Pbegin P_induction arriving
( M; D, |+ I8 _+ Y& s! k    clone 1 load to P_pick(A_induct)9 [3 [' R7 a8 w9 w  n9 |
end最大的系( G* t4 [( Y& C* c
- _3 L( x6 C! B; ~  A5 @0 F
begin P_pick arriving
! H6 q" q+ Z8 B, t: N) X    set A_i to procindex * 10 + 10 y, B! c( \9 Y5 ^
    move into Q_induct(procindex)
' e9 L1 a6 A9 h( k  W    move into pickaisle.induct(procindex)
& ?' ^, _# g# L) A( L: m    /*check the type of pickaisle.induct(i), for your last problem.*/$ u. X* e: w+ c
; Y3 H0 d  q# z  K. k7 ^3 v' ]
    while A_i<=30 do begin
  t! B0 Z  p  I. d4 ]1 K6 r9 }& I        travel to pickaisle.con(A_i)
8 q- p  F/ M  u: X3 R* S, W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ X# d- R4 T' ~- x! F
        else wait for 10 sec7 K3 ]3 v7 w* d$ ^. @
        if A_i=A_leave then send to die9 x$ m& `/ j: f4 X
        else inc A_i by 1
5 `# U% V; R( L3 ]. ~9 y' J& ^    end7 k# @+ Z6 W; X( e& H! L  m
end$ Q1 O  ~. Z: q  @9 f
( O4 M( W9 e, H0 h
其中的procindex为整形,代表当前process的序号。. |. b+ k2 m0 l7 Y0 Q* ^( y
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-2 06:43 , Processed in 0.018451 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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